I have recently shifted from KDE4 to Gnome3. In KDE you can create application specific keyboard shortcuts to raise windows. I typically create one each for firefox, thunderbird, my terminal etc. That way switching between windows is lightning quick. Gnome doesn't seem to have that kind of functionality. Also I do not like Gnome3's window switching scheme (alt-tab).Hence I was wondering if its possible to raise windows through DBUS? If it is, then it will be possible to write a script and assign a keyboard shortcut to that.
Is it possible to raise a window using a keyboard shortcut in Gnome3?
gnome;d bus
I figured out the solution and have posted it on my blog. wmictrl did the trick. I found a script on fluxbox wiki which finds an application if its already running and raises its window or launches it if no instances is running. I'm using that script with certain tweaks to launch applications.I have documented it here:http://www.humbug.in/2011/single-keyboard-shortcut-to-launchraise-an-application/I updated the script to support arguments, the result is:#!/bin/bash# Find_app# Author: Lucas van Staden (lvs at dedmeet.com / http://www.dedmeet.com)# This little script will try and find the application attempting to start# in the running processes, and if found, focus the application# if not found, a new instance will start# usage:# find_app.sh <application with full path># params# 1 - application to start (full path)# helper applications#!/bin/bash# Find_app# Author: Lucas van Staden (lvs at dedmeet.com / http://www.dedmeet.com)# This little script will try and find the application attempting to start# in the running processes, and if found, focus the application# if not found, a new instance will start# usage:# find_app.sh <application with full path># params# 1 - application to start (full path)# helper applicationsDOLLARONE=$(echo $1 | sed -e 's/[\t ]*$//') #Delete trailing spacesWMCTRL=`which wmctrl`;GREP=`which grep`;APPLICATION=$(echo $DOLLARONE | cut -d ' ' -f 1)if [ x$APPLICATION != x$DOLLARONE ]; then  APPARGS=$(echo $DOLLARONE | cut -d ' ' -f 2)fiBASENAME=`basename $APPLICATION`;BASENAME=`echo $BASENAME | tr [:upper:] [:lower:]`FOUND=0;function findwindow {# 1 = BASENAME# 2 = WMCTRL# 3 = GREP        IFS=$'\n';        for RUNNING in `$2 -l -x`        do                if [ `echo $RUNNING | tr [:upper:] [:lower:] | $3 -c $DOLLARONE` -gt 0 ]                then                        HOSTNAME=`hostname`                        WINDOW=${RUNNING#*${HOSTNAME} }                        $2 -a $WINDOW                        FOUND=1;                fi;        done}if [ x$APPARGS = x ]; then  findwindow $BASENAME $WMCTRL $GREP;  if [ $FOUND -eq 0 ]  then          $APPLICATION &          sleep 2;          # Try and find the application, after opened          findwindow $BASENAME $WMCTRL $GREP;          if [ $FOUND -eq 0 ]          then                  # Still not found, wait a bit more, and try again                  sleep 3;                  findwindow $BASENAME $WMCTRL $GREP;          fi  fielse  $APPLICATION $APPARGS &fiAdd the above script to your path, possibly in $HOME/bin/find_app.sh and make it executable and make sure its in your path.make sure wmctrl is installsudo apt-get install wmctrlNow update the desktop entry files of the applications you want to have a singular shortcut for launching as well as raising, so that the applications are invoked through the above script.For eg.cp /usr/share/applications/firefox.desktop ~/.local/share/applications/Edit firefox.desktop in ~/.local/share/applications/ and change Exec to Exec=find_app.sh firefox %uNow add keyboard shortcut for your default broswer System Settings => Keyboard => Shortcuts => Launchers => Launch Web BrowserNow restart gnome shell => Press Alt r to bring up the run dialog. Input r and press Enter.Now you should be able to launch/raise your browser using a singular keyboard shortcut.