Friday, July 13, 2012

Keyboard shortcukt to Send to back send to front a application window

1) Create this script as /opt/terminator_quake.sh
 
#!/bin/bash
TM_STATE=/tmp/tm_stat
WIN=$( wmctrl -lGx | grep -i terminator | awk '{print $1}' );
if [[ $WIN == "" ]]
then
   exit 0
   #terminator&
else
   if [[ -e $TM_STATE ]]
   then
      wmctrl -i -r $WIN -b remove,below
      wmctrl -i -r $WIN -b add,above
      rm $TM_STATE
   else
      wmctrl -i -r $WIN -b remove,above
      wmctrl -i -r $WIN -b add,below
      touch $TM_STATE
   fi
fi

2) I'm using this in unity on ubunutu (ie. compiz) so open ccsm (compiz config setting manager)
3) Click 'commands' button in 'general' section
4) In 'commands' tab add /opt/terminator_quake.sh to 'command line 0'
5) Click 'key binding' tab and add shortcut to the 'Run command 0' entry.

Thats it now you can send to front and sent to back the window (eg: terminator in this case). This can be use as alternative to yakuake, guake and tilda.

No comments:

Post a Comment