diff --git a/.config/hypr/configs/binds.conf b/.config/hypr/configs/binds.conf index 7d0a8943..49cd5626 100644 --- a/.config/hypr/configs/binds.conf +++ b/.config/hypr/configs/binds.conf @@ -49,7 +49,7 @@ bind = $mainMod, D, exec, pypr toggle dots ## Other Modules bind = $mainMod, Z, exec, pypr zoom -bind = $mainMod CTRL, W, exec, pypr wall next +bind = $mainMod CTRL, W, exec, $scripts/random_wallpaper_hyprpaper # Windows ## Basic Operations diff --git a/.config/hypr/scripts/autostart/services b/.config/hypr/scripts/autostart/services index 9c11bde2..c21b402a 100755 --- a/.config/hypr/scripts/autostart/services +++ b/.config/hypr/scripts/autostart/services @@ -4,7 +4,8 @@ udiskie & # Wallpaper Backend -swww-daemon --format xrgb & +hyprpaper & +"$HOME"/.config/hypr/scripts/random_wallpaper_hyprpaper & # Pyprland Daemon pypr --debug /tmp/pypr.log & @@ -31,7 +32,7 @@ wl-paste --watch cliphist store & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & # Screen sharing and portals -"$HOME"/.config/hypr/portal & +"$HOME"/.config/hypr/scripts/portal & # xwaylandvideobridge & # Off when using Vesktop instead of Discord # Audio diff --git a/.config/hypr/scripts/random_wallpaper_hyprpaper b/.config/hypr/scripts/random_wallpaper_hyprpaper new file mode 100755 index 00000000..11cdc412 --- /dev/null +++ b/.config/hypr/scripts/random_wallpaper_hyprpaper @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +WALLPAPER_DIR="$HOME/.config/hypr/theme/walls" +CURRENT_WALL=$(hyprctl hyprpaper listloaded) + +WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1) + +hyprctl hyprpaper reload ,"$WALLPAPER" && notify-send "Wallpaper Changed" -i "$WALLPAPER" --app-name=Wallpaper diff --git a/.config/hypr/scripts/random_wallpaper b/.config/hypr/scripts/random_wallpaper_swww similarity index 100% rename from .config/hypr/scripts/random_wallpaper rename to .config/hypr/scripts/random_wallpaper_swww diff --git a/.config/rofi/scripts/wallpaper/wallpaper b/.config/rofi/scripts/wallpaper/wallpaper index 4e3a3e8a..b3619b07 100755 --- a/.config/rofi/scripts/wallpaper/wallpaper +++ b/.config/rofi/scripts/wallpaper/wallpaper @@ -20,12 +20,16 @@ choice=$( $rofi_cmd ) -wallpaper="$wallpapers_dir/$choice" +WALLPAPER="$wallpapers_dir/$choice" -swww img "$wallpaper" \ - --transition-bezier 0.5,1.19,.8,.4 \ - --transition-type wipe \ - --transition-duration 2 \ - --transition-fps 75 && notify-send "Wallpaper Changed" -i "$wallpaper" --app-name=Wallpaper +if pgrep -x "hyprpaper" >/dev/null; then + hyprctl hyprpaper reload ,"$WALLPAPER" && notify-send "Wallpaper Changed" -i "$WALLPAPER" --app-name=Wallpaper +elif pgrep -x "swww" >/dev/null; then + swww img "$WALLPAPER" \ + --transition-bezier 0.5,1.19,.8,.4 \ + --transition-type wipe \ + --transition-duration 2 \ + --transition-fps 75 && notify-send "Wallpaper Changed" -i "$WALLPAPER" --app-name=Wallpaper +fi exit 1