Openbox-based desktop

Table of Contents

Configuration
Config files

Config files

by ross at 04:51:12 on October 11, 2012

Install software to create your own Desktop Environment.

Edit ~/.config/openbox/rc.xml, add to <keyboard> after <!-- Keybindings for running applications -->:

  <keybind key="W-e">
    <action name="Execute">
      <command>rox</command>
    </action>
  </keybind>
  <keybind key="W-r">
    <action name="Execute">
      <command>lxpanelctl run</command>
    </action>
  </keybind>
  <keybind key="W-l">
    <action name="Execute">
      <command>xlock -mode matrix</command>
    </action>
  </keybind>
  <keybind key="Print">
    <action name="Execute">
      <command>sh -c "mkdir -p ~/Screenshots &amp;&amp; scrot ~/Screenshots/%Y-%m-%d_%T.png"</command>
    </action>
  </keybind>
  <keybind key="A-Print">
    <action name="Execute">
      <command>sh -c "mkdir -p ~/Screenshots &amp;&amp; scrot -s ~/Screenshots/%Y-%m-%d_%T.png"</command>
    </action>
  </keybind>

This is an example of how to bind an action to a hotkey.

Windows-e will run file manager (install x11-fm/rox-filer), Windows-rrun program dialog (using lxpanel), Windows-l will lock the session (install x11/xlockmore). PrintScreen (install graphics/scrot) key will create screenshot in your home dir. Alt-PrintScreen will make screenshot of current window.

Edit ~/.config/openbox/menu.xml:

<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">

<menu id="root-menu" label="Openbox 3">
  <separator label="FreeBSD" />
  <item label="Reboot">
    <action name="Execute">
      <command>close-session.sh -r</command>
    </action>
  </item>
  <item label="Halt">
    <action name="Execute">
      <command>close-session.sh -h</command>
    </action>
  </item>
  <separator label="Session" />
  <item label="Reconfigure">
    <action name="Reconfigure" />
  </item>
  <item label="Log Out">
    <action name="Execute">
      <command>close-session.sh</command>
    </action>
  </item>
</menu>

</openbox_menu>

Openbox won't bother to politely close your windows when you close the session (openbox --exit). This script will: close-session.sh. Place it in /usr/local/bin and chmod it to be executable for everyone. In order to use it you will need x11/xvinfo, x11/xprop, x11/xdotool, x11/wmctrl and security/sudo set up to execute reboot and halt -p without password. The menu above show how to use it.

Here is another my script: video-menu.sh. It will parse a directory and build Openbox menu of video files. You will need shells/bash to use it.

# video-menu.sh /share/video > /share/video/.menu.xml

This will generate the menu file. Rerun it after you add something to /share/video. Add to your menu.xml to <menu id="root-menu"> this tag:

<menu id="video" label="Video" execute="cat /share/video/.menu.xml" />

Refer to the documentation to learn Openbox.

 

Comments