t
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
];
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec = [
|
||||
"pkill -x hyprpaper; uwsm app -- hyprpaper"
|
||||
# "pkill -x hyprpaper; uwsm app -- hyprpaper"
|
||||
"killall -SIGUSR2 .ghostty-wrappe"
|
||||
];
|
||||
exec-once = [
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings = {
|
||||
preload = ["../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"];
|
||||
wallpaper = [
|
||||
"HDMI-A-1,../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"
|
||||
];
|
||||
# preload = ["../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"];
|
||||
# wallpaper = [
|
||||
# "HDMI-A-1,../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"
|
||||
# ];
|
||||
};
|
||||
};
|
||||
systemd.user.startServices = "sd-switch";
|
||||
# systemd.user.startServices = "sd-switch";
|
||||
}
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
(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
|
||||
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"
|
||||
|
||||
exec matugen image $WALLPAPER
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user