improve: hakase-wallpaper-switch
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
(writeShellScriptBin "hakase-wallpaper-switch" ''
|
||||
if [[ "$1" != "run" ]]; then
|
||||
if command -v ghostty &> /dev/null; then
|
||||
ghostty --class="wallpaper-selector" --title="Wallpaper Selector" -e bash -c "switch-wallpaper run || read -p 'Hit Enter to close...'"
|
||||
ghostty --class="org.hakase.switch-wallpaper" --title="Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'"
|
||||
exit 0
|
||||
elif command -v kitty &> /dev/null; then
|
||||
kitty --class wallpaper-selector --title "Wallpaper Selector" -e bash -c "switch-wallpaper run || read -p 'Hit Enter to close...'"
|
||||
kitty --class org.hakase.switch-wallpaper --title "Wallpaper Selector" -e bash -c "hakase-wallpaper-switch run || read -p 'Hit Enter to close...'"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
@@ -33,12 +33,17 @@
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ${pkgs.hyprland}/bin/hyprctl hyprpaper unload all
|
||||
# Persistence logic
|
||||
CACHE_FILE="$HOME/.cache/current_wallpaper"
|
||||
cp "$WALLPAPER" "$CACHE_FILE"
|
||||
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$WALLPAPER"
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$WALLPAPER"
|
||||
# Reload hyprpaper
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper unload all
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$CACHE_FILE"
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$CACHE_FILE"
|
||||
|
||||
exec matugen image "$WALLPAPER"
|
||||
exec matugen image "$CACHE_FILE"
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user