diff options
| -rw-r--r-- | modules/home/i3wm/nord-blue/i3.nix | 4 | ||||
| -rw-r--r-- | modules/home/i3wm/nord-blue/i3lock.nix | 23 | ||||
| -rw-r--r-- | modules/home/i3wm/nord-blue/scripts.nix | 23 |
3 files changed, 25 insertions, 25 deletions
diff --git a/modules/home/i3wm/nord-blue/i3.nix b/modules/home/i3wm/nord-blue/i3.nix index 15081df..02dce9a 100644 --- a/modules/home/i3wm/nord-blue/i3.nix +++ b/modules/home/i3wm/nord-blue/i3.nix @@ -2,7 +2,7 @@ let vars = import ./variables.nix; - scripts = import ./scripts.nix {inherit pkgs; }; + lock-screen = import ./i3lock.nix {inherit pkgs; }; dmenu = import ./dmenu.nix {inherit pkgs; }; mod = "Mod4"; in @@ -52,7 +52,7 @@ in "${mod}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; # Lanuch alacritty as a terminal "${mod}+d" = "exec ${dmenu}"; # Launch dmenu (app launcher) "${mod}+q" = "kill"; # Close an app (kill the process) - "${mod}+Ctrl+l" = "exec lock-screen"; # Lock screen + "${mod}+Ctrl+l" = "exec ${lock-screen}"; # Lock screen "${mod}+Shift+r" = "restart"; # Reload i3 "${mod}+Ctrl+Shift+e" = "exec sh -c 'i3-msg exit'"; # Exit i3 (CAREFUL NO CONFIRM) "${mod}+Shift+s" = "exec flameshot gui"; diff --git a/modules/home/i3wm/nord-blue/i3lock.nix b/modules/home/i3wm/nord-blue/i3lock.nix new file mode 100644 index 0000000..9fc9738 --- /dev/null +++ b/modules/home/i3wm/nord-blue/i3lock.nix @@ -0,0 +1,23 @@ +{ 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 + magick "$WALL" \ + -resize "''${RES}^" \ + -gravity center \ + -extent "$RES" \ + "$TMP" + + i3lock -i "$TMP" + ''; +} diff --git a/modules/home/i3wm/nord-blue/scripts.nix b/modules/home/i3wm/nord-blue/scripts.nix index 47c49eb..e69de29 100644 --- a/modules/home/i3wm/nord-blue/scripts.nix +++ b/modules/home/i3wm/nord-blue/scripts.nix @@ -1,23 +0,0 @@ -{ pkgs }: - -{ - lock-screen = 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 - magick "$WALL" \ - -resize "''${RES}^" \ - -gravity center \ - -extent "$RES" \ - "$TMP" - - i3lock -i "$TMP" - ''; -} |
