aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-02-06 12:57:03 +0100
committerNatasha Moongrave <natasha@256phi.eu>2026-02-06 12:57:03 +0100
commit7d66683a2fbefb0dff48bce86e9d332aced6ac95 (patch)
tree50b002de090b986ae0c29f2caa5acc769fd233d3
parent30efaf9bcb444895008a38affebc0fe98e958d67 (diff)
fixed i3lock.nix
-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"
+''