20 lines
574 B
Fish
Executable File
20 lines
574 B
Fish
Executable File
#!/usr/bin/env fish
|
|
|
|
# This script switches the wallpaper to a random image found under ~/Pictures/wallpapers
|
|
# Supports i3, Hyprland, and Sway.
|
|
|
|
|
|
switch "$XDG_CURRENT_DESKTOP"
|
|
case i3
|
|
feh --bg-fill (find ~/Pictures/wallpapers -type f -regextype posix-extended -iregex "/(.*/)*[^\.]*\.(png|jpe?g|webp)" | sort -R | head -n1)
|
|
case sway Hyprland
|
|
swaybg -i (find ~/Pictures/wallpapers -type f | sort -R | head -n1) &
|
|
set newpid $last_pid
|
|
sleep 0.2
|
|
for pid in (pgrep -x swaybg)
|
|
if test $pid -ne $last_pid
|
|
kill $pid
|
|
end
|
|
end
|
|
end
|