diff --git a/assets/lockscreen.png b/assets/lockscreen.png index 6cd61d2..9501e27 100644 Binary files a/assets/lockscreen.png and b/assets/lockscreen.png differ diff --git a/modules/desktop/hyprlock.nix b/modules/desktop/hyprlock.nix index eaf4a56..325db53 100644 --- a/modules/desktop/hyprlock.nix +++ b/modules/desktop/hyprlock.nix @@ -23,14 +23,12 @@ in { settings = with config.colorScheme.palette; { general = { hide_cursor = false; - no_fade_in = true; - no_fade_out = true; text_trim = true; immediate_render = true; }; background = [ { - path = "${../../assets/lockscreen.png}"; + path = "${config.modules.desktop.swww.lastWallpaperSym}"; color = "rgb(${base00})"; blur_passes = 3; blur_size = 6; diff --git a/modules/desktop/swww.nix b/modules/desktop/swww.nix index 49de68c..71886fa 100644 --- a/modules/desktop/swww.nix +++ b/modules/desktop/swww.nix @@ -4,8 +4,11 @@ with lib; let cfg = config.modules.desktop.swww; + # TODO: this whole thing is a little silly, but i cant find a better way to ref it in the scripts + # maybe we can reference the config in the scripts? in a let of course :) wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds"; lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper"; + lastWallpaperSym = "$XDG_DATA_HOME/swww-last-wallpaper-sym"; in { options.modules.desktop.swww = { enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes"; @@ -14,6 +17,21 @@ in { default = pkgs.swww; example = "pkgs.swww"; }; + wallpapersFolder = mkOption { + type = types.str; + default = wallpapersFolder; + example = "$XDG_PICTURES_DIR/wallpapers"; + }; + lastWallpaper = mkOption { + type = types.str; + default = lastWallpaper; + example = "$XDG_DATA_HOME/swww-last-wallpaper"; + }; + lastWallpaperSym = mkOption { + type = types.str; + default = lastWallpaperSym; + example = "$XDG_DATA_HOME/swww-last-wallpaper-sym"; + }; setScript = mkOption { type = types.package; default = pkgs.writeShellScript "swww-set" '' @@ -23,6 +41,7 @@ in { echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}" fi + ln -sf "${wallpapersFolder}/$(cat ${lastWallpaper})" "${lastWallpaperSym}" # in case the hash of the pkg changes ${lib.getExe cfg.package} img "${wallpapersFolder}/$(cat ${lastWallpaper})" --transition-type none ''; }; @@ -38,6 +57,7 @@ in { ${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 1.0,1.0 --transition-duration 1.5 + ln -sf "$wallpaper" "${lastWallpaperSym}" echo "$file" > "${lastWallpaper}" ''; };