Hyprland Alt as Mod Without Triggering Menu

· josephmr's blog


I prefer to use the Alt key as my Hyprland (or any tiling wm) mod key; however, this results in triggering the menu bar in many applications when I inadvertently just hit Alt without another key.

I searched for an option to disable this at the OS level, but could not find a suitable solution in Fedora + Hyprland. Instead I found a workaround -- swap Windows and Alt keys in XKB options and use Windows as the mod key.

This lets me continue to hit the Alt key on my keyboard, but it is interpreted as a Windows keypress which doesn't have any alternative functions that get triggered like Alt and the application menu bar.

I did this in my Hyprland config like so:

$mainMod = SUPER
input {
    # ...
    kb_options = altwin:swap_alt_win
    # ...
}
last updated: