blur swaylock background

This commit is contained in:
2025-02-05 18:30:58 -05:00
parent ad8059b30c
commit b5ae17bf36
4 changed files with 35 additions and 4 deletions

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/
'';
}