Dotfiles: Openbox

I love Openbox window manager. Is super-fast, light-weight, reliable and very customizable.

It takes only 12Mb of memory, you can configure most of you enviroment defining keybindings, the behave of the windows, the way you resize them, the buttons available, the skin/theme... pretty much everything is customisable. The only downside is that you need a few days/weeks for customize it. Really. The defaults are pretty good but the true power of Openbox is when you have it full customized.

Autostart file

~/.config/openbox/autostart file, executed when you log in. Useful for setting up you enviroment.

Menu bar

I'm using tint2. Awesome taskbar that has been made intentionally for openbox. Just 7K of RAM memory, very customisable thru a RC file.

tint2 &

Wallpaper

feh --bg-fill ~/images/wallpapers/debian.png

Auxiliar console

From the description of the package: Terminal taking after the likeness of many classic terminals from first person shooter games, Quake, Doom and Half-Life (to name a few), where the terminal has no border and is hidden from the desktop until a key is pressed.

I use it like the "helper console". There I can type quick commands, update the system and not much more. If I want to do something more "complicated" I spawn a new console.

tilda &

Conky

For the ones who don't know, conky is a system monitor. I really recommend you to search it on google. You'll Woow. I promise.

conky &

Mouse hidder

After some time of mouse inactivity, or if you are typing, this programs hidde the mouse pointer. Really useful because the mouse never is in the middle when you are writting. The lack of pointer in the screen in not an issue because you instinctively remember where was the last time you saw it. It's program that you will notice it only in the machines that is not installed.

unclutter &

Clipboard manager

Remember the last 20 things you have had selected, and you can swap them in the current "copied" buffer. Reeeeeeally useful. I have the keybinding in Control+Alt+H that shows a list of the last things you have had selected. You can edit selected items, too.

parcellite &

Remapping some keys

I'm used to writte a lot of HTML and the > and < keys are pretty "far" in the keyboard. I've remapped the "Menu" key (not "Windows" key) for being able to use it more easily. If you want to remap other key, you will need the KEYCODE, you can know it with the xev program.

Oh, and yes. I've remapped F1 to Esc. F1 nomally means "help" and, you know... my ego is a little bit high sometimes and....well, when I just press F1 by mistake and a Help message appears... and everybode look at me like if I were crazy when I suddenly wake up from my chair and I shout to my screen "DO I LOOK LIKE I NEED HELP?!!"..... Probably the answer is pretty ovious at that moment but... well, I prefer have it deactivated... (and when because I'm using Vim, and Esc and F1 keys are really nearly and I don't want to care if I miss the key ;)

xmodmap -e 'keycode 135  = less greater' # Change the Menu button for less and greater
xmodmap -e 'keycode 67 = Escape' # Remap F1 to Escape

Beep off

xset b off & # This sets the beep off

RC.XML file

I just have the keybinding custom. I don't use the mouse too much so I don't really care about it.

Important note: Sometimes you will see a mention to tpad. This is a custom script that I will explain when I will have more time. Every time the script is mentionet I will put here what the screep does internally. The tpad command is in my PATH.

All the other configurations done in this file has been made with Obconf, a better way for adjusting the the openbox settings

Poweroff/reboot

<keybind key="W-S-k">
  <action name="Execute">
	<execute>tpad halt</execute>
  </action>
</keybind>
<keybind key="C-S-k">
  <action name="Execute">
	<execute>tpad reboot</execute>
  </action>
</keybind>

"tpad halt" internals:

echo "shutting down the computer...";
sudo halt && openbox --exit

"tpad reboot" internals

echo "restarting the computer...";
sudo reboot && openbox --exit

Syslog console

Shows a console in the middle of the screen showing the last activity of the syslog.

<keybind key="W-S">
  <action name="Execute">
	<execute>xterm -name syslog  -geometry 140x40 -e "tailf /var/log/syslog" </execute>
  </action>
</keybind>

You must add the application section at the botton of the rc.xml in order to see the console centered.

<application name="syslog">
  <position force="yes">
	<x>center</x>
	<y>90</y>
  </position>
  <decor>no</decor>
  <desktop>all</desktop>
</application>

Launching apps

I'm using gmrun, another awesome program. It lets you execute other programs. It has completion and history of the last commmands executed.

<keybind key="A-E">
  <action name="Execute">
	<execute>gmrun</execute>
  </action>
</keybind>

Main terminal

My last adquisition, a new console: Sakura. It has support for tabs, adjusting the fonts, background colors and everything.

<keybind key="A-T">
  <action name="Execute">
	<startupnotify>
	  <enabled>yes</enabled>
	  <name>Terminal</name>
	  <icon>konsole</icon>
	</startupnotify>
	<command>sakura</command>
  </action>
</keybind>

Secondary terminal

I'm using evilvte. I really like it but it has some problems when using tabs in a maximized window on Openbox, it's a pitty.

<keybind key="W-Return">
  <action name="Execute">
	<startupnotify>
	  <enabled>yes</enabled>
	  <name>Terminal</name>
	  <icon>konsole</icon>
	</startupnotify>
	<command>evilvte</command>
  </action>
</keybind>

Browsers and mail

The Lenovos laptop have a big blue button that I'm using for launching the web browers. It is a really nice idea to have a button dedicated for launching webbrowers, you will use it a lot, I promise.

<keybind key="A-XF86Launch1">
  <action name="Execute">
	<execute>chromium</execute>
  </action>
</keybind>
<keybind key="XF86Launch1">
  <action name="Execute">
	<execute>/opt/firefox/firefox</execute>
  </action>
</keybind>
<keybind key="W-F12">
  <action name="Execute">
	<execute>/opt/firefox/firefox</execute>
  </action>
</keybind>
<keybind key="W-M">
  <action name="Execute">
	<execute>/opt/thunderbird/thunderbird</execute>
  </action>
</keybind>

Audio settings

I love to control the music with keybindings. Pause, stop, next song, up volume.... everything is there. Really useful. I cannot live without it.

You will not understand what most of the commands do, but you can check the documentation of mocp or cmus is you want further information. For the ones who don't know, cmus and mocp are two console audio players.

<keybind key="W-ntilde">
  <action name="Execute">
	<execute>mocp -G</execute>
  </action>
</keybind>
<keybind key="W-period">
  <action name="Execute">
	<execute>cmus-remote -u</execute>
  </action>
</keybind>
<keybind key="W-n">
  <action name="Execute">
	<execute>mocp -f</execute>
  </action>
</keybind>
<keybind key="W-S-N">
  <action name="Execute">
	<execute>mocp -r</execute>
  </action>
</keybind>
<keybind key="XF86AudioMute">
  <action name="Execute">
	<execute>aumix -v1</execute>
  </action>
</keybind>
<keybind key="W-A-Down">
  <action name="Execute">
	<execute>aumix -v1</execute>
  </action>
</keybind>
<keybind key="W-XF86AudioMute">
  <action name="Execute">
	<execute>aumix -v70</execute>
  </action>
</keybind>
<keybind key="W-A-Up">
  <action name="Execute">
	<execute>aumix -v70</execute>
  </action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
  <action name="Execute">
	<execute>aumix -v+2</execute>
  </action>
</keybind>
<keybind key="W-Up">
  <action name="Execute">
	<execute>aumix -v+2</execute>
  </action>
</keybind>
<keybind key="XF86AudioLowerVolume">
  <action name="Execute">
	<execute>aumix -v-2</execute>
  </action>
</keybind>
<keybind key="W-Down">
  <action name="Execute">
	<execute>aumix -v-2</execute>
  </action>
</keybind>
<keybind key="W-XF86AudioRaiseVolume">
  <action name="Execute">
	<execute>aumix -v+8</execute>
  </action>
</keybind>
<keybind key="W-XF86AudioLowerVolume">
  <action name="Execute">
	<execute>aumix -v-8</execute>
  </action>
</keybind>