Set wallpaper in sway

This commit is contained in:
Rodolphe Bréard 2020-12-21 18:32:41 +01:00
parent d31f971717
commit ad890cc43f
3 changed files with 20 additions and 2 deletions

16
bin/set_wallpaper Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
set -euo pipefail
IFS=$'\n\t'
WALLPAPER_DIRECTORY="$HOME/pictures/wallpapers/enabled"
WALLPAPER_FILE="$(find "$WALLPAPER_DIRECTORY" -type l -print | shuf | head -n 1)"
case "$1" in
sway)
swaymsg --quiet output "*" bg "$WALLPAPER_FILE" fill
;;
*)
hash feh 2>/dev/null && feh --bg-scale "$WALLPAPER_FILE"
;;
esac