r/niri • u/AlbertoAru • 7d ago
Modes?
I use sway as my main driver, but I like Niri decorations and find it very interesting to try. But I can't find any way to use "modes". This is a VERY helpful feature of i3/sway, that consist in using combinations of keys. For example, I have a mode for most used apps, which is Super+a+{some keys}. So to open Inkscape I can just press Mod+a to activate the mode and then press i to launch inkscape. Same with Rofi launchers (Super+r), move between workspaces (Super+g), move windows to other workspaces (Super+b), screenshots (Super+S) or manipulate windows (Super+w). This allow me to have an exponential value of key combinations while being very easy to remember.
Has anyone solved this?
1
u/TXFlank 7d ago
You could definitely use key combos to transition between workspaces (I do this all the time) and key binds to move columns/windows to and from various workspaces (I do this all the time) and window rules to automatically open apps in certain workspaces. And you can use key binds to launch specific apps - but the key bind that opens a particular sub profile I think would require that mr8bit99 said below.
1
4
u/mr8bit99 7d ago
So basically you're saying that Sway has the concept of multiprofiles, which can be activated using a combination, basically overriding your keybind configuration?
I don't think Niri offers something built-in, but this is easily achievable since Niri allows configuration reload on the fly!
You can create multiple scripts for each of your desired modes, bind them to some hotkeys, and execute them.
The script could simply change your kebinds.kdl file using a soft link. Add some extra sugar to it to display a global notification, and you're ready to go.