blur swaylock background

This commit is contained in:
Simon Gardling 2025-02-05 18:30:58 -05:00
parent ad8059b30c
commit b5ae17bf36
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
4 changed files with 35 additions and 4 deletions

View File

@ -54,11 +54,11 @@
]
},
"locked": {
"lastModified": 1738753876,
"narHash": "sha256-yXT82kERWL4R81hfun9BuT478Q6ut0dJzdQjAxjRS38=",
"lastModified": 1738789832,
"narHash": "sha256-HdlMPfObPu5y7oDfH/w3vvlU3UTQ/bQjSULChZARm5M=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f20b7a8ab527a2482f13754dc00b2deaddc34599",
"rev": "30ea6fed4e4b41693cebc2263373dd810de4de49",
"type": "github"
},
"original": {

View File

@ -37,7 +37,7 @@
(defwidget window-title []
(label
:text "${windowtitle == "" ? "" : "[[${windowtitle}]]"}"))
:text "${windowtitle == "" ? "" : "(${windowtitle})"}"))
(defpoll windowtitle :interval "1s" `scripts/currentWindow.fish`)
(defpoll currentworkspace :interval "1s" `scripts/currentWorkspace.fish`)

View File

@ -1,4 +1,7 @@
{ pkgs, ... }:
let
blur = pkgs.callPackage ../util/blur.nix;
in
{
programs.swaylock = {
enable = true;
@ -32,6 +35,8 @@
text-caps-lock-color = "f5a97f";
text-ver-color = "8aadf4";
text-wrong-color = "ee99a0";
# image = builtins.toString ../wallpaper_blurred.png;
image = "${(blur { src = ../wallpaper.png; })}/output.png";
};
};
}

View File

@ -0,0 +1,26 @@
{
stdenv,
imagemagick,
src,
}:
stdenv.mkDerivation {
pname = "blur-image";
version = "1.0";
inherit src;
buildInputs = [ imagemagick ];
# input is a file, not a directory, skip unpackPhase
unpackPhase = "true";
# command taken from: https://old.reddit.com/r/swaywm/comments/oz3t7v/setting_a_blurred_background_with_swaylock_and/
buildPhase = ''
magick ${src} -filter Gaussian -resize 20% -blur 0x2.5 -resize 500% output.png
'';
installPhase = ''
mkdir -p $out
mv output.png $out/
'';
}