6

The heading says it all. In short I want to have the behavior as in gnome-shell : when I release the super key, the overview is triggered. With xfce, I want it to trigger the main menu.

I have the whisker plugin installed, so its just the matter to selecting xfce4-popup-whiskermenu as the command for the shortcut, but the problem I am facing is that simply selecting Super key binds it to "press" event rather than release, which is not what I want.

There doesnt seem to be a way to do it via the settings manager GUI. Is there a way to edit xfce configuration files to achieve this ?

Artur Meinild
  • 31,385

1 Answers1

1

Edit: A simpler solution is to use the xcape package, as described in this answer.

Wow. 10 years ago?! Better late than never, I guess? ;-)

You can certainly do this with xbindkeys.

sudo apt-get install xbindkeys

Run xbindkeys -k and press the "Super (Win) key" to find the key name.

For example:

system@/dev/pts/5:$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x50 + c:133
    Mod2+Mod4 + Super_L

Now you can add the following to ~/.xbindkeysrc

# Run command on Super_L release event
"bash -c xfce4-popup-whiskermenu"
  release+Super_L

Now, run xbindkeys -p to poll for the changes.
If all went well, it works!


I have a hail mary workaround idea.

# Run command on Super_L release event
"bash -c 'sleep 0.1; xfce4-popup-whiskermenu'"
  release + m:0x50 + c:133

Introduce a slight delay to give the menu time, and hopefully trigger correctly upon release. If 0.1 doesn't work try up to .5, but if by half a second it doesn't work, it's not going to.

Make sure that, after changes, you run xbindkeys -p. To really make sure, pkill xbindkeys && xbindkeys Completely stopping and restarting the program is a guarantee.


If the "hail mary" fails, you could try a possible interception.

sudo apt-get install xdotool

Then run:

nano ~/super_key_menu.sh

Add the following:

#!/bin/bash

Wait for the Super key to be released

while true; do # Check if the Super key is pressed if xdotool getkeystate 133; then sleep 0.1 # Delay to ensure key release is detected else # Trigger the Whisker menu xfce4-popup-whiskermenu break fi sleep 0.05 # Check every 50ms done

Save & exit, then chmod +x ~/super_key_menu.sh

Now, change the bash -c line in ~/.xbindkeysrc to:

"bash ~/super_key_menu.sh"

Restart xbindkeys or use the xbindkeys -p
(I've run into a case before where a version of xbindkeys didn't have -p.)

  • Thank you for the answer! Unfortunately release + Super_L does not get triggered. Without the release+ it works. Something like release + Super_L + Q works correctly aswell. Any Ideas why that could be? – ChrisB Aug 10 '24 at 08:19
  • Because it's not really a "normal" action key it's a modifier like alt & ctrl. Try using the whole line. release+Mod2+Mod4 + Super_L It's worth a shot. I usually have to omit them, but this is a unique key situation. – JayCravens Aug 10 '24 at 12:54
  • 1
    @ChrisB I had answered a similar question a while ago. Please have a look: https://askubuntu.com/a/1356907/618353 – BeastOfCaerbannog Aug 10 '24 at 13:23
  • @BeastOfCaerbannog: Damn. Thank you so much! Xcape works flawlessly. If your comment was an answer I would accept it. Don't really know correct procedure here, maybe we should mark this as duplicate to redirect people to your answer? – ChrisB Aug 10 '24 at 14:12
  • @ChrisB You're welcome! Marking as duplicate should be fine. If you look at your question you should be able to accept it. :) – BeastOfCaerbannog Aug 10 '24 at 14:19
  • 1
    I forgot you're not the OP and you cannot accept it as a dupe. :P – BeastOfCaerbannog Aug 10 '24 at 14:20
  • Xcape works for launching however I made an app in C that runs in a background and waits for super key release then checks if whisker and applications menu are present in the panel. If so whisker is launched and closed on super key. If there is no whisker and applications menu present it will be launched and hidden. If both are not present application finder is launched and closed on super key releases. https://forum.xfce.org/viewtopic.php?pid=76121#p76121 – Милош Павловић Aug 13 '24 at 18:00
  • @МилошПавловић Seems good! Why don't you post an answer? – BeastOfCaerbannog Aug 14 '24 at 16:09
  • @BeastOfCaerbannog I'm too lazy at 40°C. – Милош Павловић Aug 15 '24 at 10:18