diff options
Diffstat (limited to 'home/pkgs/lockscreen')
| -rw-r--r-- | home/pkgs/lockscreen/default.nix | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/home/pkgs/lockscreen/default.nix b/home/pkgs/lockscreen/default.nix index b36b08b..4da4743 100644 --- a/home/pkgs/lockscreen/default.nix +++ b/home/pkgs/lockscreen/default.nix @@ -1,37 +1,28 @@ { pkgs, backgroundImage ? null, resolution ? "1920x1080" }: let useBackgroundImage = backgroundImage != null; -in pkgs.runCommand "lockscreen" { - buildInputs = with pkgs; - [ - # xorg.xdpyinfo - ]; - envVariable = true; -} ('' +in pkgs.runCommand "lockscreen" { envVariable = true; } ('' mkdir -p $out/{bin,share} -'' + (if useBackgroundImage then '' +'' + (lib.optionalString useBackgroundImage '' ${pkgs.imagemagick}/bin/convert ${backgroundImage} -resize ${resolution} -blur 0x5 RGB:$out/share/lockscreen.png -'' else - "") + '' - echo > $out/bin/lockscreen.sh \ - "export PATH=$PATH - ${pkgs.i3lock-color}/bin/i3lock-color \\ - '' + (if useBackgroundImage then '' - --raw ${resolution}:rgb \\ - --image $out/share/lockscreen.png \\ - '' else - "") + '' - --no-unlock-indicator \\ - --composite \\ - --clock \\ - --ignore-empty-password \\ - --time-color=FFFFFFFF \\ - --date-color=00000000 \\ - --time-size=100" - '' + (if useBackgroundImage then '' - chmod 444 $out/share/lockscreen.png - '' else - "") + '' - chmod 555 $out/bin/lockscreen.sh - chmod 555 $out/{bin,share} - '') +'') + '' + echo > $out/bin/lockscreen.sh \ + "export PATH=$PATH + ${pkgs.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} + '') |
