diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-02-12 18:39:54 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-02-15 22:13:57 +0100 |
| commit | 365a7368718fc52964eb487058a34c7a124e6989 (patch) | |
| tree | 2f9e0fe71b2edebd0a695d69025430b558da7b74 /pkgs/lockscreen/default.nix | |
| parent | 6ea803da80558e269564c99070e92e285cf977ff (diff) | |
add pkgs
Diffstat (limited to 'pkgs/lockscreen/default.nix')
| -rw-r--r-- | pkgs/lockscreen/default.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/lockscreen/default.nix b/pkgs/lockscreen/default.nix new file mode 100644 index 0000000..dd68b79 --- /dev/null +++ b/pkgs/lockscreen/default.nix @@ -0,0 +1,28 @@ +{ runCommand, imagemagick, i3lock-color, lib, backgroundImage ? null, resolution ? "1920x1080" }: + +let useBackgroundImage = backgroundImage != null; +in runCommand "lockscreen" { envVariable = true; } ('' + mkdir -p $out/{bin,share} +'' + (lib.optionalString useBackgroundImage '' + ${imagemagick}/bin/convert ${backgroundImage} -resize ${resolution} -blur 0x5 RGB:$out/share/lockscreen.png +'') + '' + echo > $out/bin/lockscreen.sh \ + "export PATH=$PATH + ${i3lock-color}/bin/i3lock-color \\ + '' + (lib.optionalString useBackgroundImage '' + --raw ${resolution}:rgb \\ + --image $out/share/lockscreen.png \\ + '') + '' + --no-unlock-indicator \\ + --composite \\ + --clock \\ + --ignore-empty-password \\ + --time-color=FFFFFFFF \\ + --date-color=00000000 \\ + --time-size=100" + '' + (lib.optionalString useBackgroundImage '' + chmod 444 $out/share/lockscreen.png + '') + '' + chmod 555 $out/bin/lockscreen.sh + chmod 555 $out/{bin,share} + '') |
