Global keybinds don't work for electron apps running under native wayland. #10351
Replies: 9 comments 16 replies
-
I can +1 this. Brave and Ghostty work as I have tried |
Beta Was this translation helpful? Give feedback.
-
I'm currently using this janky workaround to get global shortcuts for vesktop:
|
Beta Was this translation helpful? Give feedback.
-
For anyone coming here for the same issue: |
Beta Was this translation helpful? Give feedback.
-
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
fi Then just put this is your config bind = $mainMod, V, exec, $scripts/global-electron-sc.sh "Ctrl_Shift, M" class discord |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Update: Regarding Discord: |
Beta Was this translation helpful? Give feedback.
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_HINT
toauto
in my config, the app runs under native wayland and the global keybinds stop working.Reproduction steps
hyprctl clients
to 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,auto
and restart hyprlandhyprctl clients
. You should now seexwayland: 0
under discordSystem info and config
sysInfo.txt
Beta Was this translation helpful? Give feedback.
All reactions