niri window switcher

This commit is contained in:
Matt Nish-Lapidus 2025-04-07 12:31:09 -04:00
parent e613e8c8b3
commit 2c84007997
6 changed files with 53 additions and 23 deletions

View file

@ -294,10 +294,6 @@ in
hotkey-overlay.title = "Clipboard History";
action = wezlaunch "clipse";
};
"Mod+Ctrl+P" = {
hotkey-overlay.title = "Bitwarden Search";
action = wezlaunch "/home/emenel/.local/bin/sway-launcher-rbw";
};
"Mod+Ctrl+F" = {
hotkey-overlay.title = "Yazi";
action = wez "yazi";
@ -328,6 +324,16 @@ in
};
"Mod+P" = {
hotkey-overlay.title = "Bitwarden Search";
action = wezlaunch "/home/emenel/.local/bin/sway-launcher-rbw";
};
"Mod+W" = {
hotkey-overlay.title = "window switcher";
action = wezlaunch "/home/emenel/.local/bin/sway-launcher-niri-windows";
};
"Mod+Shift+A" = {
hotkey-overlay.title = "Lock Session";
action = spawn "hyprlock";

View file

@ -6,6 +6,25 @@
wl-clipboard
];
xdg.configFile."sway-launcher-desktop/providers".source = ./sway-launcher-providers;
home.file.".local/bin/sway-launcher-rbw".source = ./sway-launcher-providers/sway-launcher-rbw.fish;
home.file.".local/bin/sway-launcher-rbw" = {
executable = true;
text = ''
#!/usr/bin/env fish
PROVIDERS_FILE=providers/rbw.conf sway-launcher-desktop
'';
};
home.file.".local/bin/sway-launcher-niri-windows" = {
executable = true;
text = ''
#!/usr/bin/env fish
HIST_FILE="" PROVIDERS_FILE=providers/niri-windows.conf sway-launcher-desktop
'';
};
xdg.configFile."sway-launcher-desktop/providers" = {
source = ./sway-launcher-providers;
recursive = true;
};
}

View file

@ -0,0 +1,2 @@
#!/usr/bin/env fish
niri msg -j windows | jq -r '.[] | "\(.id)'\034'niri-windows'\034'\(.title) - (\(.app_id))"'

View file

@ -0,0 +1,5 @@
[niri-windows]
list_cmd=fish /home/emenel/.config/sway-launcher-desktop/providers/niri-windows-list.fish
preview_cmd=echo -e ' Switch to application:'
launch_cmd=fish -c "niri msg action focus-window --id {1}"
purge_cmd=command -v '{1}' || exit 43

View file

@ -1,2 +0,0 @@
#!/usr/bin/env fish
PROVIDERS_FILE=providers/rbw.conf sway-launcher-desktop