21 lines
686 B
Nix
21 lines
686 B
Nix
{ 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"
|
|
'')
|
|
];
|
|
}
|