Skip to content

Instantly share code, notes, and snippets.

@p120ph37
Created July 21, 2014 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p120ph37/51b4491097b2dd5707e7 to your computer and use it in GitHub Desktop.
Save p120ph37/51b4491097b2dd5707e7 to your computer and use it in GitHub Desktop.
Date/time popup action for openbox
<openbox_menu>
<menu id="date-popup" label="Date &amp; Time"
execute="date +'&lt;openbox_pipe_menu&gt;&lt;item label=&quot;: %a %B %d, %Y %H:%M:%S&quot;/&gt;&lt;/openbox_pipe_menu&gt;'"
/>
</openbox_menu>
<?xml version="1.0" encoding="UTF-8"?>
<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
<keyboard>
<keybind key="W-D">
<action name="ShowMenu">
<menu>date-popup</menu>
</action>
</keybind>
</keyboard>
</openbox_config>
@p120ph37
Copy link
Author

Place the date-popup.xml file into your ~/.config/openbox folder, and add the keybind tag to the appropriate place in your ~/.config/openbox/rc.xml file. This particular keybind is for the Windows-D key combination. You can read more about openbox keybindings, the ShowMenu action, and pipe menus.

@p120ph37
Copy link
Author

The colon in the popup menu is for justification purposes: leading spaces are stripped and I wanted to push the date popup far enough to the right so that the mouse cursor doesn't obscure the text.

@agalazis
Copy link

for the sake of completeness :
also add to rc.xml:

<file>date-popup.xml</file> 

and to reload settings without relogin:

openbox --reconfigure 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment