feat(wallpaper): use swaybg instead of hyprpaper
This commit is contained in:
parent
4737aec6e2
commit
e3a95c6dc2
4 changed files with 17 additions and 47 deletions
25
modules/programs/wallpaper/wallpaper.sh
Normal file → Executable file
25
modules/programs/wallpaper/wallpaper.sh
Normal file → Executable file
|
|
@ -14,20 +14,23 @@ function help() {
|
|||
}
|
||||
|
||||
function randomWallpaper() {
|
||||
find ~/.config/wallpapers/ -type f,l | shuf -n 1
|
||||
echo "$WALLPAPERS" | shuf -n 1
|
||||
}
|
||||
|
||||
function setWallpaperX {
|
||||
feh --bg-fill "$1"
|
||||
}
|
||||
|
||||
function setWallpaperWayland {
|
||||
swaybg --mode fill -i "$1" 2>/dev/null &
|
||||
}
|
||||
|
||||
function setWallpaper() {
|
||||
case "${XDG_CURRENT_DESKTOP,,}" in
|
||||
hyprland)
|
||||
hyprctl hyprpaper preload "$1" &>/dev/null
|
||||
hyprctl monitors -j | jq '.[].name' | xargs -I{} -P 0 hyprctl hyprpaper wallpaper '{}',"$1" &>/dev/null
|
||||
hyprctl hyprpaper unload all &>/dev/null
|
||||
;;
|
||||
*)
|
||||
feh --bg-fill "$1" &>/dev/null
|
||||
;;
|
||||
esac
|
||||
if [[ -z ${WAYLAND_DISPLAY+x} ]]; then
|
||||
setWallpaperX "$1"
|
||||
else
|
||||
setWallpaperWayland "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue