aboutsummaryrefslogtreecommitdiff
path: root/modules/home/i3wm/nord-blue/scripts.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home/i3wm/nord-blue/scripts.nix')
-rw-r--r--modules/home/i3wm/nord-blue/scripts.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/home/i3wm/nord-blue/scripts.nix b/modules/home/i3wm/nord-blue/scripts.nix
new file mode 100644
index 0000000..7dbfd19
--- /dev/null
+++ b/modules/home/i3wm/nord-blue/scripts.nix
@@ -0,0 +1,24 @@
+{ pkgs, ... }:
+
+{
+ (pkgs.writeShellScriptBin "lock-screen" ''
+ #!/usr/bin/env sh
+ set -eu
+
+ WALL="${1:-$HOME/Pictures/wallpaper.jpg}"
+ TMP="/tmp/lockscreen.png"
+
+ # Get current resolution (single-monitor friendly)
+ RES=$(xrandr | awk '/\*/ {print $1; exit}')
+
+ # Scale like feh --bg-fill
+ convert "$WALL" \
+ -resize "${RES}^" \
+ -gravity center \
+ -extent "$RES" \
+ "$TMP"
+
+ i3lock -i "$TMP"
+
+ '')
+} \ No newline at end of file