fix plugins/wallpaper support for wayland

This commit is contained in:
Darukutsu 2022-11-01 16:40:25 +01:00
parent 2a4231ea89
commit e80ba2e44a
1 changed files with 18 additions and 8 deletions

View File

@ -9,14 +9,24 @@
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [ "$(file --mime-type "$1" | awk '{print $NF}' | awk -F '/' '{print $1}')" = "image" ]; then if [ "$(file --mime-type "$1" | awk '{print $NF}' | awk -F '/' '{print $1}')" = "image" ]; then
if type nitrogen >/dev/null 2>&1; then if [ "$XDG_SESSION_TYPE" == "x11" ]; then
nitrogen --set-zoom-fill --save "$1" if type nitrogen >/dev/null 2>&1; then
elif type wal >/dev/null 2>&1; then nitrogen --set-zoom-fill --save "$1"
wal -i "$1" elif type wal >/dev/null 2>&1; then
else wal -i "$1"
printf "nitrogen or pywal missing" else
read -r _ printf "nitrogen or pywal missing"
fi read -r _
fi
else
if type swww >/dev/null 2>&1; then
swww img "$1"
else
printf "swww missing"
read -r _
fi
fi
# If you want a system notification, uncomment the next 3 lines. # If you want a system notification, uncomment the next 3 lines.
# notify-send -a "nnn" "Wallpaper changed!" # notify-send -a "nnn" "Wallpaper changed!"