nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e80ba2e44a66a7c02d51d8be933993ba9c4167b2
parent 2a4231ea89a108beafaba8edd02250ab6fe3f0fd
Author: Darukutsu <darupeter@pm.me>
Date:   Tue,  1 Nov 2022 16:40:25 +0100

fix plugins/wallpaper support for wayland

Diffstat:
Mplugins/wallpaper | 26++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/plugins/wallpaper b/plugins/wallpaper @@ -9,14 +9,24 @@ if [ -n "$1" ]; then if [ "$(file --mime-type "$1" | awk '{print $NF}' | awk -F '/' '{print $1}')" = "image" ]; then - if type nitrogen >/dev/null 2>&1; then - nitrogen --set-zoom-fill --save "$1" - elif type wal >/dev/null 2>&1; then - wal -i "$1" - else - printf "nitrogen or pywal missing" - read -r _ - fi + if [ "$XDG_SESSION_TYPE" == "x11" ]; then + if type nitrogen >/dev/null 2>&1; then + nitrogen --set-zoom-fill --save "$1" + elif type wal >/dev/null 2>&1; then + wal -i "$1" + else + printf "nitrogen or pywal missing" + 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. # notify-send -a "nnn" "Wallpaper changed!"