aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/home/i3wm/nord-blue/i3lock.nix29
1 files changed, 12 insertions, 17 deletions
diff --git a/modules/home/i3wm/nord-blue/i3lock.nix b/modules/home/i3wm/nord-blue/i3lock.nix
index 92ef450..3338616 100644
--- a/modules/home/i3wm/nord-blue/i3lock.nix
+++ b/modules/home/i3wm/nord-blue/i3lock.nix
@@ -1,24 +1,19 @@
{ pkgs }:
# Wrapper/script for i3-lock to use '~/Pictures/wallpaper.png' as the lock screen
-{
- pkgs.writeShellScriptBin "lock-screen" ''
- #!/usr/bin/env sh
- set -eu
- WALL="''${1:-$HOME/Pictures/wallpaper.png}"
- TMP="/tmp/lockscreen.png"
+pkgs.writeShellScriptBin "lock-screen" ''
+ #!/usr/bin/env sh
+ set -eu
- # Get current resolution (single-monitor friendly)
- RES=$(xrandr | awk '/\*/ {print $1; exit}')
+ WALL="\$\{1:-$HOME/Pictures/wallpaper.png}"
+ TMP="/tmp/lockscreen.png"
- # Scale like feh --bg-fill
- magick "$WALL" \
- -resize "''${RES}^" \
- -gravity center \
- -extent "$RES" \
- "$TMP"
+ # Get current resolution (single-monitor friendly)
+ RES=$(xrandr | awk '/\*/ {print $1; exit}')
- i3lock -i "$TMP"
- '';
-}
+ # Scale like feh --bg-fill
+ magick "$WALL" -resize "\$\{RES}^" -gravity center -extent "$RES" "$TMP"
+
+ i3lock -i "$TMP"
+''