mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
hold overlays correctly
This commit is contained in:
38
packages/applicative-wallpaper.nix
Normal file
38
packages/applicative-wallpaper.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
runCommand,
|
||||
fetchurl,
|
||||
imagemagick,
|
||||
colors,
|
||||
}:
|
||||
let
|
||||
backgroundColor = colors.withHashtag.base06;
|
||||
foregroundColor = colors.withHashtag.base01;
|
||||
width = 1920;
|
||||
height = 1080;
|
||||
|
||||
svgUrl = "https://applicative.systems/_astro/logo-full.D8zRvqBZ.svg";
|
||||
logoSvg = fetchurl {
|
||||
url = svgUrl;
|
||||
hash = "sha256-qXDIEZsAPn4eUJ3kb5U6L3PMUCtWGYqhqyIaBt7FntE=";
|
||||
};
|
||||
in
|
||||
runCommand "applicative-wallpaper.png"
|
||||
{
|
||||
nativeBuildInputs = [ imagemagick ];
|
||||
}
|
||||
''
|
||||
# 1. We use -background to set the canvas color
|
||||
# 2. We use -fuzz and -opaque to replace the logo's internal colors
|
||||
# 3. We use -gravity and -extent to center it on a wallpaper-sized canvas
|
||||
|
||||
convert \
|
||||
-background none \
|
||||
-density 300 \
|
||||
"${logoSvg}" \
|
||||
-fuzz 100% -fill "${foregroundColor}" -opaque black \
|
||||
-resize 800x800 \
|
||||
-gravity center \
|
||||
-background "${backgroundColor}" \
|
||||
-extent ${toString width}x${toString height} \
|
||||
$out
|
||||
''
|
||||
Reference in New Issue
Block a user