From 3a88f3e7fdd9aa41e44f4407d21679b9116155d5 Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Tue, 3 Feb 2026 18:51:30 +0100 Subject: added default keybinds for i3 and i3 stuff --- modules/home/i3wm/nord-blue/alacritty.nix | 7 +++ modules/home/i3wm/nord-blue/default.nix | 1 + modules/home/i3wm/nord-blue/i3.nix | 50 ++++++++++++++++++--- modules/home/i3wm/nord-blue/scripts.nix | 24 ++++++++++ modules/home/i3wm/nord-blue/variables.nix | 3 +- .../i3wm/nord-blue/wallpapers/wave-minimal.png | Bin 0 -> 352335 bytes 6 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 modules/home/i3wm/nord-blue/alacritty.nix create mode 100644 modules/home/i3wm/nord-blue/scripts.nix create mode 100644 modules/home/i3wm/nord-blue/wallpapers/wave-minimal.png (limited to 'modules') diff --git a/modules/home/i3wm/nord-blue/alacritty.nix b/modules/home/i3wm/nord-blue/alacritty.nix new file mode 100644 index 0000000..beccbd9 --- /dev/null +++ b/modules/home/i3wm/nord-blue/alacritty.nix @@ -0,0 +1,7 @@ +{ lib, pkgs, ... }: + +{ + programs.alacritty = { + enable = true; + } +} \ No newline at end of file diff --git a/modules/home/i3wm/nord-blue/default.nix b/modules/home/i3wm/nord-blue/default.nix index a26c37a..2ef727a 100644 --- a/modules/home/i3wm/nord-blue/default.nix +++ b/modules/home/i3wm/nord-blue/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./alacritty.nix ./i3.nix ]; } \ No newline at end of file diff --git a/modules/home/i3wm/nord-blue/i3.nix b/modules/home/i3wm/nord-blue/i3.nix index 609ac42..e3a3e17 100644 --- a/modules/home/i3wm/nord-blue/i3.nix +++ b/modules/home/i3wm/nord-blue/i3.nix @@ -10,12 +10,52 @@ in programs = { i3 = { enable = true; - config.bars = []; - + config = { + modifier = "Mod4"; + + keybindings = lib.mkOptionDefault { + "${mod}+Enter" = "exec ${pkgs.alacritty}/bin/alacritty"; # Lanuch alacritty as a terminal + "${mod}+m" = "exec ${pkgs.dmenu}/bin/dmenu"; # Launch dmenu (app launcher) + "${mod}+q" = "kill"; # Close an app (kill the process) + "${mod}+Alt+l" = "exec sh -c '${pkgs.lock-screen}/bin/lock-screen' ${wallpaper}"; + + + # === FOCUS === # + + # Vim bindings + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + + # Arrow keys + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + + # === MOVE === # + + # Vim bindings + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; + + # Arrow keys + "${mod}+Shift+Left" = "focus left"; + "${mod}+Shift+Down" = "focus down"; + "${mod}+Shift+Up" = "focus up"; + "${mod}+Shift+Right" = "focus right"; + }; + }; + extraPackages = with pkgs; [ - dmenu - i3-lock - polybar + dmenu # App launcher + i3-lock # Lock screen + imagemagick # Handle wallpaper resizing for i3-lock + polybar # Status bar + alacritty # Terminal Emulator ]; } } 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 diff --git a/modules/home/i3wm/nord-blue/variables.nix b/modules/home/i3wm/nord-blue/variables.nix index cdd0719..0a5d027 100644 --- a/modules/home/i3wm/nord-blue/variables.nix +++ b/modules/home/i3wm/nord-blue/variables.nix @@ -6,6 +6,7 @@ }; wallpaper = { - wave = import ./wallpapers/wave.jpeg + wave = import ./wallpapers/wave-minimal.jpeg + # Add other wallpapers eventually } } \ No newline at end of file diff --git a/modules/home/i3wm/nord-blue/wallpapers/wave-minimal.png b/modules/home/i3wm/nord-blue/wallpapers/wave-minimal.png new file mode 100644 index 0000000..5d322d4 Binary files /dev/null and b/modules/home/i3wm/nord-blue/wallpapers/wave-minimal.png differ -- cgit v1.2.3