aboutsummaryrefslogtreecommitdiff
path: root/modules/home/i3wm/nord-blue/scripts.nix
blob: 4c263a1b5dc1e566372dc023b0dfdf56bad13aa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ pkgs, ... }:

{
  (pkgs.writeShellScriptBin "lock-screen" ''
    #!/usr/bin/env sh
    set -eu

    WALL="${1:-$HOME/Pictures/wallpaper.png}"
    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"

  '');
}