17

Coming back from Windows 7 I'd like two kinds of shortcuts to work at the same time:

  • Pressing Win (a.k.a. Super) alone should open the whiskermenu e.g. for quick application launch
  • Pressing Win + an arrow should provide the same behaviour as Windows does, i.e. Maximizing/Restoring, Minimizing, Tiling Left/Right

Unfortunately when I set up both the Window manager shortcuts for the latter and the keyboard application shortcut xfce4-popup-whiskermenu to Super-L, the Window manager combination are ignored and upon releasing the Win the whiskermenu opens nonetheless.

How can this be fixed?

(I'm running Arch Linux, if that is relevant)

Tobias Kienzler
  • 9,184
  • 13
  • 65
  • 106
  • Does it work if you use something like [`xbindkeys`](http://unix.stackexchange.com/a/91433/22222) to set the `Win` -> `xfce4-popup-whiskermenu` shortcut? – terdon Oct 19 '15 at 12:34
  • @terdon Unfortunately it doesn't seem to work (I hope just running `xbindkeys` from a running session is sufficient, I didn't modify `.Xsession` and relog: "*** Warning *** Please verify that there is not another program running which captures one of the keys captured by xbindkeys. It seems that there is a conflict, and xbindkeys can't grab all the keys defined in its configuration file." – Tobias Kienzler Oct 19 '15 at 12:47
  • Try again after disabling the shortcut from the window manager. That error means that both the window manager and `xbindkeys` are trying to bind the same key. If you disable the WM one, you can at least use `xbindkeys` and then you can see whether this actually helps or not. – terdon Oct 19 '15 at 12:50
  • @terdon I did, to no avail - I'd probably have to eliminate _any_ shortcut involving the Win-key, and then use `xbindkeys` to control the Window manager as well :-/ – Tobias Kienzler Oct 19 '15 at 12:54
  • I was hoping that wouldn't be necessary. I use `xbindkeys` with my CInnamon for one Ctrl+foo shortcut and other Ctrl+bar shortcuts defined by the WM work fine. On the other hand, I haven't been a Windows user for almost 20 years so I don't have any habits to unlearn. I therefore tend to use Alt combinations instead. Wouldn't that be a simpler solution? Alt is right next to Win after all. – terdon Oct 19 '15 at 13:04
  • XD Nah, it's more a matter of principle - then I'd want to use Alt alone for the menu and alt+arrows for the resizing, which would probably fail the same way – Tobias Kienzler Oct 19 '15 at 13:07
  • 1
    Install [xcape](https://github.com/alols/xcape) from the arch repositories and follow the instructions on this [SE question](https://unix.stackexchange.com/questions/214956/how-to-set-a-single-modifier-key-as-a-shortcut-in-openbox/215259#215259). While this question was meant for openbox, it works completely fine in xfce, too. – Devon Jun 02 '18 at 20:13
  • @Devon Looks good to me, why don't post this as answer so the question doesn't remain unanswered? – Tobias Kienzler Jun 03 '18 at 18:21
  • One thing I observed in my case while playing with this issue is that shortcuts that stop working after binding whisker menu to Super key are those defined for the 'Window Manager Actions' (defined in Window Manager's Keyboard tab). – RogUE Oct 20 '18 at 06:30

1 Answers1

7

Use xcape to fix this (KDE users might be interested in ksuperkey). While this small background daemon is useful to bind keys to another (combination of) keys, it also comes along with the feature of running actions only when keys are released, not when they are pressed.

  1. Install xcape.

  2. Assign Linux key Super to a placeholder shortcut like ⎈ Shift⎇ Ctrl⇧ AltLinux key SuperD or any other shortcut that is not taken by another application:

    xcape -e 'Super_L=Shift_L|Control_L|Alt_L|Super_L|D'
    
  3. Make sure to start whiskermenu with the same shortcut. Do this by adding a shortcut in Settings > Keyboard > Shortcuts.

  4. Add your xcape command in Settings > Session and Startup > Application Autostart to automatically start xcape when xfce boots up.
Devon
  • 808
  • 8
  • 12
  • 2
    Interesting Xfce bug: https://bugzilla.xfce.org/show_bug.cgi?id=7845 – Devon Jun 04 '18 at 15:17
  • 1
    For The newcomers here, you need to add the whole `xcape` command to the startup settings, like the example he provided: `xcape -e 'Super_L=Control_L|Shift_L|Alt_L|Super_L|Escape'` Thanks for putting this together for us, @Devon – David Culbreth Apr 10 '19 at 18:47
  • 1
    Here's the new home of that "interesting Xfce bug" on GitLab: https://gitlab.xfce.org/xfce/libxfce4ui/-/issues/1 – theDrake Feb 16 '21 at 18:55