summaryrefslogtreecommitdiff
path: root/set_wallpaper.sh
blob: 0ee00a89ded01c6357e46e892d57cc4cf7f855c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
[ -z "$WALLPAPER_DIR" ] || [ -z "$(ls -A $WALLPAPER_DIR)" ] && {
  printf "empty dir\n"
  swaybg -c '#000000' & # '#4A3700' &
  exit 0
}
printf "setting random wallpaper\n"
WALL=$(ls -d $WALLPAPER_DIR/*|shuf|head -n1)
notify-send "WALL=$WALL"
case $XDG_SESSION_TYPE in
	wayland)
		swaymsg output '*' background $WALL center
		;;
	x11)
		xwallpaper --center $WALL
		;;
esac