This commit is contained in:
kenji
2025-12-27 20:00:13 -06:00
parent 3b35cc12d3
commit f8cdd03c17
3 changed files with 20 additions and 14 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
]; ];
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
exec = [ exec = [
"pkill -x hyprpaper; uwsm app -- hyprpaper" # "pkill -x hyprpaper; uwsm app -- hyprpaper"
"killall -SIGUSR2 .ghostty-wrappe" "killall -SIGUSR2 .ghostty-wrappe"
]; ];
exec-once = [ exec-once = [
+5 -5
View File
@@ -2,11 +2,11 @@
services.hyprpaper = { services.hyprpaper = {
enable = true; enable = true;
settings = { settings = {
preload = ["../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"]; # preload = ["../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"];
wallpaper = [ # wallpaper = [
"HDMI-A-1,../../assets/Wallpapers/${myConfig.hyprland.wallpaper}" # "HDMI-A-1,../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"
]; # ];
}; };
}; };
systemd.user.startServices = "sd-switch"; # systemd.user.startServices = "sd-switch";
} }
+13 -7
View File
@@ -1,20 +1,26 @@
{ pkgs, ... }: {pkgs, ...}: {
home.packages = with pkgs; [
{
environment.systemPackages = with pkgs; [
(writeShellScriptBin "switch-wallpaper" '' (writeShellScriptBin "switch-wallpaper" ''
WALLPAPER=$(${pkgs.zenity}/bin/zenity --file-selection --title="Select Wallpaper" --file-filter="Images | *.jpg *.jpeg *.png *.gif") tmp_file=$(mktemp)
target_dir="$HOME/.config/nixos/assets/Wallpapers"
if [ ! -d "$target_dir" ]; then
target_dir="$HOME"
fi
${pkgs.yazi}/bin/yazi "$target_dir" --chooser-file="$tmp_file"
WALLPAPER=$(cat "$tmp_file")
rm -f "$tmp_file"
if [ -z "$WALLPAPER" ]; then if [ -z "$WALLPAPER" ]; then
exit 0 exit 0
fi 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 unload all
${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$WALLPAPER" ${pkgs.hyprland}/bin/hyprctl hyprpaper preload "$WALLPAPER"
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$WALLPAPER" ${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$WALLPAPER"
exec matugen image $WALLPAPER
'') '')
]; ];
} }