raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
269 stars 64 forks source link

Show 'tab hints' immediately when pressing META #93

Open raboof opened 5 years ago

raboof commented 5 years ago

You can switch tabs with Mod1+K 1 through Mod1+K 9. When you press 'Mod1+K', it would be convenient if there was some visual indication of which tab corresponds to which number.

(this feature is already present on master, but only available under the Ion license)

raboof commented 5 years ago

I think it would be even better to show the numbers immediately when pressing the META key, if that's possible. That improves the experience when you have mapped e.g. META+1 or META+q (or META+a...) to switch to the first tab.

I think we can hard-code showing numbers, and don't have to look at what keys are actually configured to switch tabs - though that would be nice

raboof commented 5 years ago

Unfortunately you can't bind to an 'abstract' modifier (like Mod4), you have to bind to concrete keys (like Super_L).

Proposed approach: read the xmodmap on startup and do the conversion when binding to 'abstract' modifiers to 'concrete' keys at the Notion side. Means people will have to restart Notion when they change modifier mappings, which seems reasonable.

wilhelmy commented 5 years ago

My gut feeling says this is a bit of a hackish workaround.

There are other ways than Xmodmap to set modifier keys, e.g. I switched from using xmodmap to using setxkbmap for everything a few years ago:

setxkbmap us \
          -option caps:super \
          -option compose:102 \
          -option lv3:ralt_switch \
          -option terminate:ctrl_alt_bksp \
          -variant altgr-intl

I don't think anything but the xmodmap(1) utility should be responsible of reading/parsing ~/.Xmodmap if that's what you're suggesting.

raboof commented 5 years ago

My gut feeling says this is a bit of a hackish workaround.

Open to suggestions ;)

I don't think anything but the xmodmap(1) utility should be responsible of reading/parsing ~/.Xmodmap if that's what you're suggesting.

I was not thinking of parsing ~/.Xmodmap, but using some API - not sure yet what api would be suitable for this though ;)

raboof commented 5 years ago

The original issue (showing tab numbers you press 'META+K') has since been fixed, but there is some good discussion around the additional feature that came up in this issue (showing tab numbers when you press META) here, so let's keep this issue around to track the latter.

knixeur commented 5 years ago

I guess we should make this optional if implemented. The only context when I want to see tabhints is when I want to switch to one pressing META+K :smile:

raboof commented 5 years ago

Agreed, for the default keybinding scheme this feature will not be used.

But my (not so) secret plan is to come up with an alternative set of keybindings, where the first 4 tabs can be switched between directly without first going through META+K

wilhelmy commented 5 years ago

I have META+[ and META+] for prev/next tab, and I use those pretty much exclusively ever since the tabhints disappeared.

raboof commented 5 years ago

the tabhints should be back on the lgpl branch (though in slightly more primitive form) - nonetheless I agree having a quicker way to reach this functionality is useful ;).