Hacker News new | ask | show | jobs
by nickjj 52 days ago
=== SCRATCHPADS ===

I've avoided needing them because of 2 niri features:

- You can quickly tap alt+tab to focus the last previously focused window (assignable to a custom bind if you want)

- niri's CLI is very easy to work with so you can build a general purpose "launch or focus" shell script in a few lines of code

If you have something like Discord or any app you want to only be opened once, you can "launch or focus" it and now it's running somewhere. Somewhere as in, you can control which workspace it's on at your discretion.

Then if you launch it again from anywhere, you'll jump right to it instead of launching a 2nd instance and you can tap alt+tab to go back to exactly where you were before.

A nice effect is after it's been launched once it never interferes with your existing windows since nothing is getting opened again.

I'm after the end result of "let me access this program quickly no matter where I am", it doesn't need to literally follow me around every workspace to do that.

The launch or focus model can be applied to GUI apps and also TUIs.

=== SPATIAL MEMORY ===

niri's overview gives you a holistic view of everything. Status bars can also show you which workspaces are in use (and even open apps if you want that).

In addition to that, certain launchers like Walker have shortcuts to let you switch windows. This means you're only ever 1 global hotkey away from seeing a list of every window that's open and being able to fuzzy find switch to it in a second. I use this all the time. If you're not using Walker you can build this in a few lines of code since niri's CLI gives you a list of open windows.

My dotfiles have both things set up https://github.com/nickjj/dotfiles.

1 comments

Thank you for your suggestions!

I will try the Alt+Tab alternative to scratchpads.

However the spatial memory concern I talked about isn't exactly of losing windows and trying to find them.

The script you mentioned seems useful to jump faster between windows you are not sure where they are. But what I tried to express is that when I'm in a workspace in i3, I have "perfect vision" of whats inside the workspace, niri I sometimes I have "tiny lapses" of having myself asking "where's the terminal, is it on the left or right of my browser?" this is not "losing the window" is just tiny frictions of having to think where a window is.

I don't know if that was a first impression that could just be solved with better attention and organization(I confess that my first try with niri was not on my work PC, but my media one that is attached to television, so I was not using niri exactly on the same mood I use i3wm).

Soon I might give niri another test drive, thanks again!

No problem.

niri's alt+tab also has a filter where if you hold alt and then press "w", it will only show you things on your active workspace. There's a little label that pops up showing this. You can also press "o" to filter it for only 1 monitor (output) too.

The above might help with those lapses.

In my case I haven't experienced this because I'm usually after the end game destination which is focusing the app so fuzzy finding it is the quickest path to that. If it's 8 windows to the right or 3 to the left is all the same to me.

With that said, I do sometimes have sessions where I have 3-4 things open side by side and I quickly cycle between them by going left and right. In those cases I don't have memory lapses because there's only a few windows open and I'm doing something specific. When this task is done I usually close those windows or no longer need to remember their relative position to windows in view.

I bet you could create a cool looking horizontal mini map to show a strip of things open on a workspace, this way you don't need to open up other things (overview, alt-tab, window finder, etc.) to see where things are.