Add 'legacy/dotfiles/' from commit 'e9a44f677d2852fd5856cecc49ecb984efeba66c'
git-subtree-dir: legacy/dotfiles git-subtree-mainline:382887df65git-subtree-split:e9a44f677d
This commit is contained in:
25
legacy/dotfiles/home-manager/util/blur.nix
Normal file
25
legacy/dotfiles/home-manager/util/blur.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
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 = ''
|
||||
mv output.png $out
|
||||
'';
|
||||
}
|
||||
26
legacy/dotfiles/home-manager/util/inverse_color.nix
Normal file
26
legacy/dotfiles/home-manager/util/inverse_color.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
stdenv,
|
||||
imagemagick,
|
||||
gawk,
|
||||
src,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "invert-image-avg";
|
||||
version = "1.0";
|
||||
|
||||
inherit src;
|
||||
|
||||
buildInputs = [
|
||||
imagemagick
|
||||
gawk
|
||||
];
|
||||
|
||||
# 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 = ''
|
||||
rm -fr $out
|
||||
magick ${src} -channel RGB -negate -resize 1x1 txt: | awk 'FNR == 2 {print $3}' > $out
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user