I want my windows key (or super_l) to toggle the lubuntu menu. I'm able to open it with the windows key after adding the key binding from the question below, but so far I haven't found a way to close it by pressing the same key again. A comment in said question here asked about the same thing in november 2011, but after googling I haven't found a solution. Does anyone know if it's possible?
Ubuntu – Toggle lxpanelctrl menu in lubuntu
lubuntulxde
Best Answer
Alternative way to toggle the menu
This answer is only "half" of the answer that was posted here . Since that question was on
Gnome
, and tagged likewise, I think it is legitimate to post a slightly edited version here to coverLubuntu
(lxde
), or any other window manager.I tested it on
Lubuntu 14.04
, and (as expected) did exactly what it should do.The solution is actually a script that you can easily set up to automatically (virtually) click on any position on your screen, including the menu. Since clicking the menu once will open it, clicking it again will close it, placing the command under your key, as you did, will do exactly what you are after.
The script
About the script; how to set up
The script needs
xdotool
:Copy the script above into an empty file, save it as
click_menu.py
Now you need to make the script remember the menu position to (virtually) click:
The script needs to be run with the option
-set
, with the mouse in position:open a terminal window, type the command:
immediatley position the mouse above the menu (do not click)
Test if all works fine with the command:
The menu should open, as shown in th image above.
If all works fine add the command:
to the key, as you did with the other command you mentioned in your question. Now pressing the key should toggle the menu.