Tip: XDoTool can simulate any keybind for any action, and as such, it may therefore be used for many other purposes...
xdotool is a package that can issue commands to simulate key presses / keybinds, meaning that it is possible to use it to invoke keybind-related actions without having to actually press their assigned keys. As this includes the ability to invoke an assigned keybind for the Openbox desktop menu, it is therefore possible to use XDoTool to turn the Openbox desktop menu into a panel menu. Especially where the desktop menu is heavily customised and feature-rich, this may prove very useful to:
Replace an existing panel menu
Implement a panel menu where otherwise not provided or possible (e.g. for Tint2)
Compensate where losing access to the desktop menu due to the use of an application like xfdesktop to manage the desktop.
Once XDoTool has been installed - if not already present - it will be necessary to
create a keybind to access the root menu in ~/.
config
/
openbox
/
rc
.
xml
, and again below the <!--
Keybindings for running aplications
-->
heading. For example, the following code will bring up the menu by pressing Ctrl
+
m
:
<keybind key="C-m">
<action name="ShowMenu">
<menu>root-menu</menu>
</action>
</keybind>
Openbox must then be reconfigured. In this instance, XDoTool will be used to
simulate the Ctrl
+
m
keypress to access the desktop menu with the following
command (note the use of +
in place of -
):
xdotool key control+m
How this command may be used as a panel
launcher / icon is
largely dependent on the features of panel used. While some panels will allow the above command to be executed
directly in the process of creating a new launcher, others may require the use
of an executable script. As an example, a custom executable script called obpanelmenu
.
sh
will be created in the ~/.
config
directory and the appropriate XDoTool command is added to
the file (to simulate
the Ctrl
+
m
keypress in this example):
~/.config/obpanelmenu.sh
xdotool key control+m
After the file has been saved and closed, it may then be made into an executable script.
Executing it will bring up the Openbox desktop menu. Consequently, where using a panel that supports drag-and-drop functionality to add new launchers, simply drag the executable script onto it before changing the icon to suit personal taste.