tabby icon indicating copy to clipboard operation
tabby copied to clipboard

toggle-window hotkey doesn't work under wayland

Open louisrubet opened this issue 3 years ago • 9 comments

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]

  • close or hide all the visible windows on your desktop
  • run tabby
  • configure a hotkey for 'toggle-window'
  • first press makes tabby invisible (while still running)
  • second press does nothing

Funding this issue

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We only receive your pledge once the issue is resolved & you've verified it.
Fund with Polar

louisrubet avatar Dec 17 '21 18:12 louisrubet

any solution?

harpreetsb avatar Apr 29 '22 12:04 harpreetsb

Is there a fix for this yet?

czadikem avatar Jul 29 '22 01:07 czadikem

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 avatar Aug 23 '22 13:08 l10r

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

l10r avatar Aug 23 '22 14:08 l10r

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 :(

bernardolm avatar Nov 10 '22 05:11 bernardolm

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:

  • Does tabby toggle sound good to you?
    FYI, dBus is kinda like a message system for Linux desktops. The idea is to handle the toggle argument by sending a command via dBus to the main window of tabby. The user on Wayland can config global hotkeys as mentioned by l10r.
  • Where (and how) should we put the command line arguments handler?
    The code should import { app } from "electron"; and read the arguments.
  • Similar to above, where should we implement dBus handler (listener)?

midnight-wonderer avatar Mar 11 '23 03:03 midnight-wonderer

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.

Apxdono avatar Jul 14 '23 11:07 Apxdono

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.

louisrubet avatar Oct 02 '23 21:10 louisrubet