Some of my scripts for daily use on a linux desktop

Wednesday, March 10, 2010

How to display Openbox's Shortcuts

I am an Openbox + Ubuntu user but sometimes, I can't remember some shortcuts. So I wrote a script to display the shorcuts (keyboard+mouse) from rc.xml in a conky window, and this window is called with a shortcut (!) only when I need it, it's a kind of help window :-)

Maybe this kind of script already exist but I didn't find it .

All the scripts can be downloaded from ubuntu forums.
In french, it's here on ubuntu-fr forum.

First I need a conkyrc template.
The python script will read this file and write shortcuts at the end of this file but in a new file.
The only thing to do in this file is to choose your colors for display.
The name of the file is conky_template.

Second, the python script read the openbox's rc.xml file.
There are some parameters to set at the beginning of the script :

#full path and name of the rc.xml file
#template of conkyrc to use
conkytemplate_path_file ="/home/wlourf/scripts/raccourcis/conky_template"

#column width (Ms = souris, Kb= clavier)

#Number of lines per Column (Ms = souris, Kb= clavier)

#in "Keyboard" array, "appliFirst" will display application name before shorcut


Third, a little bash script needed to run the python script and to call conky. Don't forget to make it executable.

And, for finish, in rc.xml, two shortcuts to run with parameters :

<command>/home/wlourf/scripts/raccourcis/ /tmp/conky_kb k</command>

<command>/home/wlourf/scripts/raccourcis/ /tmp/conky_ms m</command>

Voilà, when I call the script, the conky display the above image for the keyboard or this one for the mouse :

Today I also updated the audio_spectrum script : it can display the bargraph widget in a circular way, like this :

And a short video :

1 comment:

  1. Very useful, thanks for sharing and credits to all cool scripts you make :)