Eugeny / tabby

A terminal for a more modern age
https://tabby.sh
MIT License
58.16k stars 3.35k forks source link

toggle-window hotkey doesn't work under wayland #5207

Open louisrubet opened 2 years ago

louisrubet commented 2 years ago

Describe the problem: Pressing a hotkey to toggle tabby doesn't work under linux / wayland when tabby is not focused, while it is working well under x11. [gnome 41 / wayland on fedora 35, tabby 1.0.168].

Unfortunetely this is a common issue about global hotkeys under wayland.

From Jimmy Kloss: "To control a not focussed app (aka global hotkey) [your app] would require to [...] expose a dbus interface for remote control [...]". This is for example the method chosen by guake to get its hotkeys.

Strangely the hotkey is well dispatched to tabby when Chrome (Version 96) is focused. Close or unfocus Chrome and it doesn't work anymore.

To Reproduce: [Steps to reproduce the behavior]

Funding this issue

Fund with Polar

harpreetsb commented 2 years ago

any solution?

czadikem commented 2 years ago

Is there a fix for this yet?

l10r commented 2 years ago

Yes, if you're using gnome just add custom shortcut over the settings, and make it run "tabby toggle" image image

It only works for showing, not for hiding sadly...

l10r commented 2 years ago

If the dev could make this approach actually do the other way around, it could be a good workaround.

bernardolm commented 1 year ago

Yes, if you're using gnome just add custom shortcut over the settings, and make it run "tabby toggle" image image

It only works for showing, not for hiding sadly...

Don't works for me :(

midnight-wonderer commented 1 year ago

Hey Adding tabby toggle command seems to be a good idea to me; I mean actually implementing the feature using dBus interface. (as Louis mentioned) The current approach by l10r is equivalent to running tabby without argument.

How about we settle some details first, in the case when someone wants to take a shot?
Waiting for maintainers to take on this is a distant dream; apparently, they don't run tabby on Wayland.

Question to maintainers:

Apxdono commented 1 year ago

One way I finally made it work on Arch KDE Wayland while there's no proper DBus support (should in theory work with other Window Managers and DEs):

  1. Install xvkbd (for Arch it can be found in AUR under xvkbd)
  2. Set Ctrl+Space as the "Toggle hotkey" inside Tabby
  3. Created a script toggle_tabby.sh with this content:
    #/bin/sh
    xvkbd -window tabby -text "\C " # "\C " is Ctrl+Space, change to your key combination
  4. Run chmod +x toggle_tabby.sh
  5. KDE System Settings -> Shortcuts -> + Add command and choose toggle_tabby.sh.
  6. Select new command and assign Ctrl+Space as the shortcut
  7. Profit

Other combo I use is Super/Meta or Alt+F2, which in xvkbd is "\M\{F2}" or "\A\{F2}" but this works poorly since tabby sometimes refuses to properly capture or process the shortcut that contains F<1-12> symbol.

louisrubet commented 11 months ago

Another workaround for Gnome users is the quake-mode Gnome extension, which permits to toggle any window with a user-defined shortcut and configure things like size, focus, placement etc. Convenient and well integrated, finely works on Wayland. This is the solution I use.

func0der commented 4 months ago

The workaround with the global shortcut does not work for AppImage users though.