Last active
January 25, 2026 12:20
-
-
Save maninalift/258a2f97cb1f912d420ef6719b1f600b to your computer and use it in GitHub Desktop.
Niri sniper configuration - for efficient, direct window switching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ~/.config/niri/config.kdl | |
| // Niri Sniper - for quickly jumping to a specific window | |
| // looks like a hand-cramping key combo, but I have left-alt | |
| // mapped to Mod+Ctrl+Alt (using kanata) | |
| Mod+Ctrl+Alt+1 { spawn-sh "niri-sniper-go 1";} | |
| Mod+Ctrl+Alt+2 { spawn-sh "niri-sniper-go 2";} | |
| Mod+Ctrl+Alt+3 { spawn-sh "niri-sniper-go 3";} | |
| Mod+Ctrl+Alt+4 { spawn-sh "niri-sniper-go 4";} | |
| Mod+Ctrl+Alt+5 { spawn-sh "niri-sniper-go 5";} | |
| Mod+Ctrl+Alt+6 { spawn-sh "niri-sniper-go 6";} | |
| Mod+Ctrl+Alt+7 { spawn-sh "niri-sniper-go 7";} | |
| Mod+Ctrl+Alt+8 { spawn-sh "niri-sniper-go 8";} | |
| Mod+Ctrl+Alt+9 { spawn-sh "niri-sniper-go 9";} | |
| Mod+Ctrl+Alt+0 { spawn-sh "niri-sniper-go 0";} | |
| Mod+Ctrl+Alt+Shift+1 { spawn-sh "niri-sniper-set 1";} | |
| Mod+Ctrl+Alt+Shift+2 { spawn-sh "niri-sniper-set 2";} | |
| Mod+Ctrl+Alt+Shift+3 { spawn-sh "niri-sniper-set 3";} | |
| Mod+Ctrl+Alt+Shift+4 { spawn-sh "niri-sniper-set 4";} | |
| Mod+Ctrl+Alt+Shift+5 { spawn-sh "niri-sniper-set 5";} | |
| Mod+Ctrl+Alt+Shift+6 { spawn-sh "niri-sniper-set 6";} | |
| Mod+Ctrl+Alt+Shift+7 { spawn-sh "niri-sniper-set 7";} | |
| Mod+Ctrl+Alt+Shift+8 { spawn-sh "niri-sniper-set 8";} | |
| Mod+Ctrl+Alt+Shift+9 { spawn-sh "niri-sniper-set 9";} | |
| Mod+Ctrl+Alt+Shift+0 { spawn-sh "niri-sniper-set 0";} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nu | |
| # ~/.local/bin/niri-sniper-go | |
| def main [target: string] { | |
| let dirpath = ([$env.HOME .local state niri-sniper] | path join) | |
| let filepath = ([$env.HOME .local state niri-sniper $target] | path join) | |
| mkdir $dirpath | |
| niri msg -j focused-window | save -f $filepath | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nu | |
| # ~/.local/bin/niri-sniper-set | |
| def main [target: string] { | |
| let filepath = ([$env.HOME .local state niri-sniper $target] | path join) | |
| niri msg action focus-window --id (open $filepath | from json | get id) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment