hyprlock uses wallpaper
This commit is contained in:
parent
402d9f4957
commit
c45983ca3a
3 changed files with 21 additions and 3 deletions
Binary file not shown.
Before Width: | Height: | Size: 575 KiB After Width: | Height: | Size: 668 KiB |
|
@ -23,14 +23,12 @@ in {
|
||||||
settings = with config.colorScheme.palette; {
|
settings = with config.colorScheme.palette; {
|
||||||
general = {
|
general = {
|
||||||
hide_cursor = false;
|
hide_cursor = false;
|
||||||
no_fade_in = true;
|
|
||||||
no_fade_out = true;
|
|
||||||
text_trim = true;
|
text_trim = true;
|
||||||
immediate_render = true;
|
immediate_render = true;
|
||||||
};
|
};
|
||||||
background = [
|
background = [
|
||||||
{
|
{
|
||||||
path = "${../../assets/lockscreen.png}";
|
path = "${config.modules.desktop.swww.lastWallpaperSym}";
|
||||||
color = "rgb(${base00})";
|
color = "rgb(${base00})";
|
||||||
blur_passes = 3;
|
blur_passes = 3;
|
||||||
blur_size = 6;
|
blur_size = 6;
|
||||||
|
|
|
@ -4,8 +4,11 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.modules.desktop.swww;
|
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";
|
wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds";
|
||||||
lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper";
|
lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper";
|
||||||
|
lastWallpaperSym = "$XDG_DATA_HOME/swww-last-wallpaper-sym";
|
||||||
in {
|
in {
|
||||||
options.modules.desktop.swww = {
|
options.modules.desktop.swww = {
|
||||||
enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes";
|
enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes";
|
||||||
|
@ -14,6 +17,21 @@ in {
|
||||||
default = pkgs.swww;
|
default = pkgs.swww;
|
||||||
example = "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 {
|
setScript = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.writeShellScript "swww-set" ''
|
default = pkgs.writeShellScript "swww-set" ''
|
||||||
|
@ -23,6 +41,7 @@ in {
|
||||||
echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
|
echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
|
||||||
fi
|
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
|
${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
|
${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}"
|
echo "$file" > "${lastWallpaper}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue