Personal dotfiles. Install via curl -Lks https://bit.ly/2Jlynh5 | /bin/bash -x
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add fuzzel based shortcut for switching windows

james7132 bc8d9163 0f3e264c

+21
+2
.config/niri/config.kdl
··· 204 204 spawn-at-startup "swayidle" "-w" \ 205 205 "timeout" "300" "swaylock -f" \ 206 206 "timeout" "600" "niri msg action power-off-mointors" \ 207 + "timeout" "1800" "systemctl suspend" \ 207 208 "before-sleep" "swaylock -f" 208 209 209 210 hotkey-overlay { ··· 309 310 // Suggested binds for running programs: terminal, app launcher, screen locker. 310 311 Alt+T hotkey-overlay-title="Open a Terminal: foot" { spawn "foot"; } 311 312 Alt+D hotkey-overlay-title="Run an Application: fuzzel" { spawn-sh "fuzzel-steam-sync && fuzzel"; } 313 + Alt+S { spawn "fuzzel-niri-switch"; } 312 314 313 315 XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03+ -l 1.0"; } 314 316 XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03-"; }
+19
.local/bin/fuzzel-niri-switch
··· 1 + #!/bin/python 2 + 3 + import subprocess 4 + from subprocess import Popen, PIPE 5 + import json 6 + 7 + with Popen(["niri", "msg", "-j", "windows"], stdout=PIPE) as proc: 8 + data = json.loads(proc.stdout.read()) 9 + windows = [window['title'] for window in data] 10 + 11 + windows.sort() 12 + with Popen(["fuzzel", "--dmenu", "--prompt=Window > ", "--width=80"], stdin=PIPE, stdout=PIPE) as proc: 13 + choice, _ = proc.communicate(input=bytes('\n'.join(windows), 'utf-8')) 14 + choice = choice.decode('utf-8') 15 + 16 + for window in data: 17 + if choice == window["title"] + '\n': 18 + Popen(["niri", "msg", "action", "focus-window", "--id", str(window["id"])]) 19 + break