Random notes about Unix environment configuraion

Keyboard Layout Shortcut in Fluxbox

After having tired of Ubuntu overweighted window manager on my EeePC 1005HA I have decided to return to the old good Fluxbox. As a bi-lingual user I absolutely needed a handy way of switching keyboard layout, ideally similar to that of M$. Unfortunately (or fortunately) minimalistic defaults of the Fluxbox did not have anything to be used out of the box, so I had to find the solution myself. Here is what I came up wtih after having read this and this:
# ~/.fluxbox/keys
# Switch between us and ru keyboards on alt + left shift
# Mod1 is ALT, Shift_L is what printed by xev upon left shift key press
Mod1 Shift_L :Exec if [[ $(setxkbmap -query|awk '/layout:/ {print $2}') == 'us' ]]; then setxkbmap ru; else setxkbmap us; fi