add: switch-wallpaper.nix
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeShellScriptBin "switch-wallpaper" ''
|
||||
WALLPAPER=$(${pkgs.zenity}/bin/zenity --file-selection --title="Select Wallpaper" --file-filter="Images | *.jpg *.jpeg *.png *.gif")
|
||||
|
||||
if [ -z "$WALLPAPER" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Preload and set wallpaper using hyprctl (requires hyprpaper running)
|
||||
# We attempt to unload all other wallpapers first to save memory, optionally
|
||||
# ${pkgs.hyprland}/bin/hyprctl hyprpaper unload all
|
||||
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$WALLPAPER"
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$WALLPAPER"
|
||||
'')
|
||||
];
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
../../apps/walker/home.nix
|
||||
# ../../apps/fsel/home.nix
|
||||
../../apps/hyprpaper/home.nix
|
||||
../../apps/hyprpaper/switch-wallpaper.nix
|
||||
../../apps/tte/home.nix
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user