improve: hakase-wallpaper-switch

This commit is contained in:
kenji
2025-12-27 20:31:19 -06:00
parent 7d04d1d840
commit 3f5f2fbcd6
3 changed files with 44 additions and 16 deletions
+29 -6
View File
@@ -1,12 +1,35 @@
{myConfig, ...}: {
{
pkgs,
config,
lib,
myConfig,
...
}: let
wallpaperDir = "${config.home.homeDirectory}/.config/nixos/assets/Wallpapers";
defaultWallpaper = "${wallpaperDir}/${myConfig.hyprland.wallpaper}";
cacheWallpaper = "${config.home.homeDirectory}/.cache/current_wallpaper";
in {
services.hyprpaper = {
enable = true;
settings = {
# preload = ["../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"];
# wallpaper = [
# "HDMI-A-1,../../assets/Wallpapers/${myConfig.hyprland.wallpaper}"
# ];
preload = [cacheWallpaper];
wallpaper = [
",${cacheWallpaper}"
];
};
};
# systemd.user.startServices = "sd-switch";
home.activation.setupWallpaper = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [ ! -f "${cacheWallpaper}" ]; then
mkdir -p "$(dirname "${cacheWallpaper}")"
if [ -f "${defaultWallpaper}" ]; then
cp "${defaultWallpaper}" "${cacheWallpaper}"
else
echo "Default wallpaper not found at ${defaultWallpaper}"
touch "${cacheWallpaper}"
fi
fi
'';
systemd.user.startServices = "sd-switch";
}