Global keybinds don't work for electron apps running under native wayland. #10351
Replies: 12 comments 31 replies
|
I can +1 this. Brave and Ghostty work as I have tried |
|
I'm currently using this janky workaround to get global shortcuts for vesktop: |
|
For anyone coming here for the same issue: |
|
This small script should make it work without the issue mentioned in #10351 (reply in thread): #!/bin/bash
hyprctl activewindow | grep "$2: $3"
if [[ $? -eq 0 ]]; then
hyprctl dispatch sendshortcut $1, $2:$3
else
hyprctl dispatch focuswindow $2:$3
hyprctl dispatch sendshortcut $1, $2:$3
hyprctl dispatch focuscurrentorlast
fiThen just put this is your config bind = $mainMod, V, exec, $scripts/global-electron-sc.sh "Ctrl_Shift, M" class discord |
|
Hi everyone I thought I'd share this in case anyone else was bothered with the flickering caused by the workarounds @MMMaellon and @Dashyyy suggested. I created a very basic plugin in Vencord that enables global keybinds using XDG portal. I opened a pull request to have it merged to Vencord, but it got rejected because I used raw DOM manipulation, which is against their rules. Also, I think this other dude implemented the global keybinds feature in a much better way for vencord, but I couldn't get it to work. Going to wait till his work is merged in the official Vesktop repo. Till then, I'll use my plugin. This is his repo: https://github.com/tuxinal/Vesktop Hope this helps. |
|
Has anyone tried setting any keybinds when Discord is running natively under Wayland? For me when I go to Settings -> Keybinds in Discord and press "Record Keybind", Discord doesn't pick up any input. If Discord is running under xwayland, it works. |
|
After much testing and trail & error i am confident that this is an error in Hyprland, specifically the xdg-desktop-portal. I will maybe spend some time to get it working and create a pr in August. |
|
I did get my mouse5 working as global ptt shortcut with
but only when i run discord in xwayland. Using flatpak version. Tried flatpak + wayland, package from repo + wayland, but it discord doesn't seem to get any input at all when even trying to assign ptt bind. |
|
Update: Regarding Discord: |
|
I've been pretty busy the last few months but yesterday I had some time to look at this again. Screenshare and my facecam do also work so there are no drawbacks anymore to use wayland for discord :) (Make sure you are on the latest version) However using the hotkey menu in discord doesn't work, which is not a pretty big deal IMO because having everything in a (hyprland) config file is better anyways. UpdateNew Lua config: hl.bind("F14",
hl.dsp.send_shortcut({
mods = "Ctrl+Shift", key = "M",
window = "class:com.discordapp.Discord"
}),
{ desc = "Discord Mute" }
)
hl.bind("SHIFT + F14",
hl.dsp.send_shortcut({
mods = "Ctrl+Shift", key = "D",
window = "class:com.discordapp.Discord"
}),
{ desc = "Discord Silent" }
)(I use F14 but you can use any key you want ofc) |
|
[SOLVED]
Please there must be some way to get global keyboard shortcuts working for discord!? It's essential! |


Uh oh!
There was an error while loading. Please reload this page.
Hyprland version
Hyprland 0.49.0 built from branch at commit 9958d29 (version: bump to 0.49.0).
Regression
No.
Describe the bug
Following the (wiki about global keybinds)[https://wiki.hyprland.org/Configuring/Binds/#global-keybinds], they work fine for apps such as OBS and for electron apps such as Discord if it is running under XWayland. When I set the environment variable
ELECTRON_OZONE_PLATFORM_HINTtoautoin my config, the app runs under native wayland and the global keybinds stop working.Reproduction steps
hyprctl clientsto make sure discord is running under XWayland (which is the default)bind = , Scroll_Lock, pass, class:^discord$to your hyprland config to pass the keybind to discordenv = ELECTRON_OZONE_PLATFORM_HINT,autoand restart hyprlandhyprctl clients. You should now seexwayland: 0under discordSystem info and config
sysInfo.txt
All reactions