warp icon indicating copy to clipboard operation
warp copied to clipboard

Global hotkey not supported on Wayland

Open FredHaa opened this issue 2 years ago • 19 comments

Discord username (optional)

No response

Describe the bug

After newest update Global hotkey no longer works with Wayland. It worked somewhat before (The hotkey only worked when some windows were in focus like Slack and VSCode, not Firefox and Nautilus).

To reproduce

Go to setting -> features -> keys Global hotkey feature greyed out.

Expected behavior

No response

Screenshots

Screenshot from 2024-04-21 18-33-40

Operating system

Linux

Operating system and version

Archlinux

Shell Version

zsh 5.9

Current Warp version

v0.2024.04.16.08.02.stable_00

Regression

Yes, this bug started recently or with an X Warp version

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

FredHaa avatar Apr 21 '24 16:04 FredHaa

Hi @FredHaa. Unfortunately, the Wayland protocol simply doesn't have the functionality to support this feature. Although xdg-desktop-portal does have global hotkeys, Wayland will not allow, for example, an application to bring its window to the front. Currently, the closest thing Wayland allows is for a window to "ask" for activation, which won't actually show the window in most desktop environments. As such, if Warp acts as a Wayland client, it cannot support this feature anymore.

When Warp acts as an X11 client (through Xwayland), this feature becomes kind of possible due to the backwards compatilibity. As you've noticed, it is finnicky, since we can only capture global hotkeys when another X11 client is focused, such as Chrome or other Chromium-based apps. If you want to get back the old behavior, we'll soon release an option you can toggle, "Use X11 for window management," in the settings.

Screenshot from 2024-04-22 15-45-03

There are 2 alternatives as well:

  1. Configure a hotkey with your window manager. This is highly dependent on your desktop environment. But, there should be a way to bind a keystroke to show Warp.
  2. Switch your desktop session to use X11 instead of Wayland. In this case, Warp's own global hotkey should work perfectly. However, it comes with the drawback that you have to go back to X11 which we don't necessarily recommend. It would come with other limitations w.r.t. scaling, frame rates, and any other baggage with X11.

acarl005 avatar Apr 22 '24 19:04 acarl005

Sounds good with the option to run with XWayland.

Even better would be to fix the problem similar to how Guake does it. I.e. implementing a command warp-toggle which would trivialize setting up the window manager hotkey as you suggest as the first alternative.

FredHaa avatar Apr 23 '24 06:04 FredHaa

For reference, Guake uses DBus to show/hide window:

def toggle_guake_by_dbus():
    import dbus  # pylint: disable=import-outside-toplevel

    try:
        bus = dbus.SessionBus()
        remote_object = bus.get_object("org.guake3.RemoteControl", "/org/guake3/RemoteControl")
        print("Sending 'toggle' message to Guake3")
        remote_object.show_hide()
    except dbus.DBusException:
        pass

FredHaa avatar Apr 23 '24 06:04 FredHaa

Ah thanks for the pointer. I'll dig into the Guake method and see what Warp can do here.

acarl005 avatar Apr 23 '24 15:04 acarl005

Just adding to this, I would love the guake method; either being able to make use of the dbus to write my own command to toggle warp, or just a 'warp-toggle' command being exposed that I can setup a Gnome shortcut for would be amazing. Currently I have to use 'warp-terminal' which works okay, but it only launches warp (rather than toggles) and will just keep launching new copies.

Sadly Gnome also doesn't have a setting for legacy x11 window management so that's what I'm currently stuck with, sadly.

HrBingR avatar Oct 12 '24 09:10 HrBingR

To update this issue, I've researched how Guake does this. Indeed, it uses Dbus to communicate with itself (it provides 2 executable entrypoints, guake and guake-toggle. guake-toggle sends a message to the "main" guake process via dbus). But, the main guake process still needs a way to programatically show itself, which is implemented here. That appears to be a wrapper around this GTK method. However, as far as I can tell this method will not work for Wayland clients (only via Xwayland). Indeed, Guake seems to fallback to Xwayland on Wayland systems. Therefore, Warp has no path forward here at the moment. We need to wait for Wayland (or something else like XDG desktop portals) to provide this functionality. For now, you'll need to either use X11 or use a window manager which allows enough configuration to just show a window belonging to Warp.

acarl005 avatar Oct 14 '24 10:10 acarl005

Alright, thanks for the update

FredHaa avatar Oct 14 '24 10:10 FredHaa

Hi! Is there any update on this issue, or is there a workaround to make it work? Thanks!

masch avatar Mar 29 '25 19:03 masch

@masch Workarounds are either to use an X11 window manager or use a Wayland window manager which lets you set up global hotkeys to show a window.

acarl005 avatar Mar 29 '25 19:03 acarl005

+1, switched to xorg to use this feature. But we'd like to see some progress on wayland.

roxi3906 avatar Jul 15 '25 06:07 roxi3906

🚨 Fix for Global Hotkey Issues on Linux with Wayland 🚨

Hey Warp team! 👋

I've been experiencing the same Global Hotkey issues that many Linux users face with Wayland, and I found how Ulauncher solved this exact problem. Here's their successful approach that Warp could implement:

The Problem

Warp's Global Hotkey feature doesn't work reliably on Wayland because:

  • Wayland has stricter security models for global shortcuts
  • The built-in hotkey registration fails when triggered from certain windows (terminals, system settings, etc.)

Ulauncher's Solution ✅

Instead of relying on internal global hotkey registration, Ulauncher provides:

  1. A dedicated toggle command: ulauncher-toggle
  2. User instructions to:
    • Use wmctrl (for window focus activation) - already installed by default on Fedora and most modern distros
    • Set Ulauncher's internal hotkey to something unused
    • Create a custom system shortcut in GNOME/KDE that runs ulauncher-toggle

This bypasses Wayland's limitations by using the system's native shortcut management.

Proposed Solution for Warp 🎯

Add a warp-terminal-toggle command that:

  • Shows the dedicated hotkey window if hidden
  • Hides the dedicated hotkey window if visible
  • Uses wmctrl for proper window focus (already available on most systems)

Then update the documentation to guide users:

  1. No installation needed - wmctrl is already installed on Fedora and most modern distros
  2. Set Warp's internal Global Hotkey to "disabled" or unused key
  3. Create system shortcut: Settings > Keyboard > Custom Shortcuts
  4. Command: warp-terminal-toggle
  5. Set their preferred hotkey

Why This Works

  • ✅ Bypasses Wayland's global hotkey limitations
  • ✅ Uses system-native shortcut handling
  • ✅ Provides consistent behavior across different Wayland compositors
  • ✅ Maintains the same UX as the current Global Hotkey feature
  • ✅ No additional dependencies - leverages existing system tools
  • ✅ Follows the proven ulauncher-toggle pattern

Current Status

Right now, there's no equivalent to ulauncher-toggle in Warp - the CLI only supports basic options without any window management commands.

This seems like a relatively straightforward addition that would solve the Wayland hotkey issues for good! 🚀

References

  • Ulauncher Wayland solution: https://github.com/Ulauncher/Ulauncher/wiki/Hotkey-In-Wayland
  • Warp Global Hotkey docs: https://docs.warp.dev/terminal/windows/global-hotkey

What do you think? Would this approach work for Warp's architecture? Happy to help test or provide more details!

Environment: Fedora 42, Wayland, GNOME

iamchriswick avatar Sep 16 '25 01:09 iamchriswick

Hi @iamchriswick thanks for engaging. I appreciate your suggestions. My feedback is that I'm hesitant to depend on wmctrl for window focus. Although it may be included in current versions of some distros, we cannot assume this will always be the case. wmctrl is based on X11 and given the effort to remove X11 support from DE's like GNOME, it might get dropped as an included component. As for global hotkey registration, I'm also hesitant to use any DE-specific methods. There are a lot of users outside of GNOME/KDE and it's impractical to try to target every popular DE/WM. In generally we prefer to stick to standards that apply to all Linux desktop, e.g. Wayland/X11, XDG, portals, d-bus etc. If Tauri ends up implementing something here we'll likely pull in their approach. tauri-apps/global-hotkey#28

acarl005 avatar Sep 16 '25 14:09 acarl005

I've left some comments on how CopyQ seems to have solved the shortcut issue (2025-09-14) in these comments (with screenshots and a link to the PR with open source code changes). 🤞

  • https://github.com/warpdotdev/Warp/issues/4274#issuecomment-3904794659
  • https://github.com/warpdotdev/Warp/issues/4274#issuecomment-3904822919

ElijahLynn avatar Feb 15 '26 17:02 ElijahLynn

I got this working on Wayland + Gnome by vibe coding a custom Gnome Extension - https://github.com/ElijahLynn/warp-visor, it hardcodes the shortcuts (top and bottom visor) and has some bugs but I use it as my daily driver and it has made my Warp experience enjoyable again. If Warp finds it useful, you are welcome to adopt it (I can transfer to you), or rewrite it etc.

It could do with being published as a real Gnome Extension and make it easy to install.

ElijahLynn avatar May 06 '26 23:05 ElijahLynn

This issue has been labeled ready-to-spec and is open for contributions in the form of a product or technical spec. If you'd like to draft one, feel free to open a pull request with the spec under specs/. You can also comment @oz-agent on this issue to have the bot draft the spec automatically.

warp-for-oss[bot] avatar May 07 '26 03:05 warp-for-oss[bot]

@ElijahLynn Thanks for the offer. We would prefer not to maintain a bunch of DE-specific methods.

acarl005 avatar May 07 '26 03:05 acarl005

@ElijahLynn Thanks for the offer. We would prefer not to maintain a bunch of DE-specific methods.

Makes sense, and now that Warp is open sourced, community can carry some of the workload. Thanks.

ElijahLynn avatar May 07 '26 18:05 ElijahLynn

@oz-agent please draft the spec.

L0GYKAL avatar May 08 '26 16:05 L0GYKAL

@L0GYKAL

I'm starting work on product and tech specs for this issue.

You can view the conversation on Warp.

I created a new spec PR for this issue.

Preview generated specs:

Next steps:

  • Review the spec PR and confirm that the proposed approach looks right.
  • Request or make any needed spec updates before moving on to implementation.

Powered by Oz

warp-for-oss[bot] avatar May 08 '26 16:05 warp-for-oss[bot]