WASD binds + restore monitor toggle
Browse files at this commit4a5199f829a386d481950e276f4a50a248824ceaParent: 78691e8- feat
- WASD binds + restore monitor toggle
2 changed files +51 -37
.config/niri/config.kdlmodified+17 -6
| @@ -169,9 +169,10 @@ binds { | |||
| 169 | 169 | ||
| 170 | Super+L hotkey-overlay-title="Lock: hyprlock" { spawn "hyprlock"; } | 170 | Super+L hotkey-overlay-title="Lock: hyprlock" { spawn "hyprlock"; } |
| 171 | Mod+Escape hotkey-overlay-title="Power menu" { spawn-sh "bash ~/.config/scripts/system/power_menu.sh"; } | 171 | Mod+Escape hotkey-overlay-title="Power menu" { spawn-sh "bash ~/.config/scripts/system/power_menu.sh"; } |
| 172 | - Mod+D hotkey-overlay-title="Show desktop" { spawn-sh "~/.config/scripts/niri/show_desktop.sh"; } | 172 | + Mod+X hotkey-overlay-title="Show desktop" { spawn-sh "~/.config/scripts/niri/show_desktop.sh"; } |
| 173 | Mod+H hotkey-overlay-title="Toggle waybar" { spawn-sh "pkill -SIGUSR1 waybar"; } | 173 | Mod+H hotkey-overlay-title="Toggle waybar" { spawn-sh "pkill -SIGUSR1 waybar"; } |
| 174 | - Mod+W hotkey-overlay-title="Wallpaper picker" { spawn-sh "~/.config/scripts/niri/wallpaper_picker.sh"; } | 174 | + Mod+B hotkey-overlay-title="Wallpaper picker" { spawn-sh "~/.config/scripts/niri/wallpaper_picker.sh"; } |
| 175 | + Mod+Shift+M hotkey-overlay-title="Monitors menu" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh"; } | ||
| 175 | 176 | ||
| 176 | Alt+4 repeat=false { close-window; } | 177 | Alt+4 repeat=false { close-window; } |
| 177 | Alt+F4 repeat=false { close-window; } | 178 | Alt+F4 repeat=false { close-window; } |
| @@ -203,8 +204,12 @@ binds { | |||
| 203 | Mod+Shift+Q { move-column-to-monitor "DP-1"; } | 204 | Mod+Shift+Q { move-column-to-monitor "DP-1"; } |
| 204 | Mod+Shift+E { move-column-to-monitor "HDMI-A-1"; } | 205 | Mod+Shift+E { move-column-to-monitor "HDMI-A-1"; } |
| 205 | 206 | ||
| 206 | - Mod+M hotkey-overlay-title="Monitor menu" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh"; } | 207 | + |
| 207 | - Mod+Shift+M hotkey-overlay-title="All monitors on" { spawn-sh "~/.config/scripts/niri/toggle_monitors.sh on"; } | 208 | + // Left-hand WASD navigation (right hand stays on mouse) |
| 209 | + Mod+A { focus-column-or-monitor-left; } | ||
| 210 | + Mod+D { focus-column-or-monitor-right; } | ||
| 211 | + Mod+W { spawn-sh "~/.config/scripts/niri/workspace_nav.sh up"; } | ||
| 212 | + Mod+S { spawn-sh "~/.config/scripts/niri/workspace_nav.sh down"; } | ||
| 208 | 213 | ||
| 209 | Mod+Left { focus-column-left; } | 214 | Mod+Left { focus-column-left; } |
| 210 | Mod+Right { focus-column-right; } | 215 | Mod+Right { focus-column-right; } |
| @@ -217,6 +222,12 @@ binds { | |||
| 217 | Mod+Tab { focus-window-previous; } | 222 | Mod+Tab { focus-window-previous; } |
| 218 | Alt+Tab { focus-workspace-previous; } | 223 | Alt+Tab { focus-workspace-previous; } |
| 219 | 224 | ||
| 225 | + // Left-hand WASD moving | ||
| 226 | + Mod+Ctrl+A { move-column-left-or-to-monitor-left; } | ||
| 227 | + Mod+Ctrl+D { move-column-right-or-to-monitor-right; } | ||
| 228 | + Mod+Ctrl+W { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-up"; } | ||
| 229 | + Mod+Ctrl+S { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-down"; } | ||
| 230 | + | ||
| 220 | Mod+Ctrl+Left { move-column-left; } | 231 | Mod+Ctrl+Left { move-column-left; } |
| 221 | Mod+Ctrl+Right { move-column-right; } | 232 | Mod+Ctrl+Right { move-column-right; } |
| 222 | Mod+Ctrl+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-up"; } | 233 | Mod+Ctrl+Up { spawn-sh "~/.config/scripts/niri/workspace_nav.sh move-up"; } |
| @@ -288,7 +299,7 @@ binds { | |||
| 288 | 299 | ||
| 289 | Mod+F { toggle-window-floating; } | 300 | Mod+F { toggle-window-floating; } |
| 290 | Mod+Shift+F { fullscreen-window; } | 301 | Mod+Shift+F { fullscreen-window; } |
| 291 | - Mod+Ctrl+M { maximize-column; } | 302 | + Mod+M { maximize-column; } |
| 292 | Mod+Ctrl+F { expand-column-to-available-width; } | 303 | Mod+Ctrl+F { expand-column-to-available-width; } |
| 293 | Mod+Shift+V { switch-focus-between-floating-and-tiling; } | 304 | Mod+Shift+V { switch-focus-between-floating-and-tiling; } |
| 294 | 305 | ||
| @@ -312,5 +323,5 @@ binds { | |||
| 312 | Mod+BracketRight { consume-or-expel-window-right; } | 323 | Mod+BracketRight { consume-or-expel-window-right; } |
| 313 | Mod+Comma { consume-window-into-column; } | 324 | Mod+Comma { consume-window-into-column; } |
| 314 | Mod+Period { expel-window-from-column; } | 325 | Mod+Period { expel-window-from-column; } |
| 315 | - Mod+Ctrl+W { toggle-column-tabbed-display; } | 326 | + Mod+Ctrl+T { toggle-column-tabbed-display; } |
| 316 | } | 327 | } |
.config/scripts/niri/toggle_monitors.shmodified+34 -31
| @@ -1,36 +1,39 @@ | |||
| 1 | -#!/usr/bin/env bash | 1 | +#!/bin/bash |
| 2 | -set -euo pipefail | ||
| 3 | 2 | ||
| 4 | -. "$(dirname "$(realpath "$0")")/monitors.sh" | 3 | +source "$(dirname "$0")/monitors.sh" |
| 5 | - | ||
| 6 | -all_on() { | ||
| 7 | - niri msg action power-on-monitors | ||
| 8 | - niri msg output "$LEFT_MONITOR" on | ||
| 9 | - niri msg output "$RIGHT_MONITOR" on | ||
| 10 | -} | ||
| 11 | 4 | ||
| 12 | case "${1:-menu}" in | 5 | case "${1:-menu}" in |
| 13 | -menu) | 6 | + menu) |
| 14 | - choice=$(printf '%s\n' \ | 7 | + menu=$(echo -e "🖥️ All Monitors Off\n🖥️ $LEFT_MONITOR Off\n🖥️ $RIGHT_MONITOR Off\n💡 All Monitors On\n💡 $LEFT_MONITOR On\n💡 $RIGHT_MONITOR On\n❌ Cancel" | rofi -dmenu -p "Monitors" -i) |
| 15 | - "🖥️ All Monitors Off" \ | ||
| 16 | - "🖥️ $LEFT_MONITOR Off" \ | ||
| 17 | - "🖥️ $RIGHT_MONITOR Off" \ | ||
| 18 | - "💡 All Monitors On" \ | ||
| 19 | - "💡 $LEFT_MONITOR On" \ | ||
| 20 | - "💡 $RIGHT_MONITOR On" \ | ||
| 21 | - "❌ Cancel" | rofi -dmenu -p "Monitors" -i) | ||
| 22 | 8 | ||
| 23 | - case "$choice" in | 9 | + case "$menu" in |
| 24 | - "🖥️ All Monitors Off"*) niri msg action power-off-monitors ;; | 10 | + "🖥️ All Monitors Off") |
| 25 | - "🖥️ $LEFT_MONITOR Off"*) niri msg output "$LEFT_MONITOR" off ;; | 11 | + niri msg action power-off-monitors |
| 26 | - "🖥️ $RIGHT_MONITOR Off"*) niri msg output "$RIGHT_MONITOR" off ;; | 12 | + ;; |
| 27 | - "💡 All Monitors On"*) all_on ;; | 13 | + "🖥️ $LEFT_MONITOR Off") |
| 28 | - "💡 $LEFT_MONITOR On"*) niri msg output "$LEFT_MONITOR" on ;; | 14 | + niri msg output "$LEFT_MONITOR" off |
| 29 | - "💡 $RIGHT_MONITOR On"*) niri msg output "$RIGHT_MONITOR" on ;; | 15 | + ;; |
| 30 | - *) ;; | 16 | + "🖥️ $RIGHT_MONITOR Off") |
| 31 | - esac | 17 | + niri msg output "$RIGHT_MONITOR" off |
| 32 | - ;; | 18 | + ;; |
| 33 | -on) | 19 | + "💡 All Monitors On") |
| 34 | - all_on | 20 | + niri msg action power-on-monitors |
| 35 | - ;; | 21 | + niri msg output "$LEFT_MONITOR" on |
| 22 | + niri msg output "$RIGHT_MONITOR" on | ||
| 23 | + ;; | ||
| 24 | + "💡 $LEFT_MONITOR On") | ||
| 25 | + niri msg output "$LEFT_MONITOR" on | ||
| 26 | + ;; | ||
| 27 | + "💡 $RIGHT_MONITOR On") | ||
| 28 | + niri msg output "$RIGHT_MONITOR" on | ||
| 29 | + ;; | ||
| 30 | + "❌ Cancel") | ||
| 31 | + ;; | ||
| 32 | + esac | ||
| 33 | + ;; | ||
| 34 | + on) | ||
| 35 | + niri msg action power-on-monitors | ||
| 36 | + niri msg output "$LEFT_MONITOR" on | ||
| 37 | + niri msg output "$RIGHT_MONITOR" on | ||
| 38 | + ;; | ||
| 36 | esac | 39 | esac |