[openbox] Launching applications

Brian Mattern rephorm at rephorm.com
Wed Oct 5 18:25:51 EDT 2011


On Mon, 03 Oct 2011, Anthony Thyssen wrote:

> Now to see if a "mutt terminal window" is present do any of these...
> 
>    xwininfo -root -all | grep '"mutt"'
>    xwininfo -root -tree | awk '/"mutt"/ {print; exit}'
>    xwit -names mutt -print
>    xdotool search -limit 1 --classname mutt  getwindowgeometry -shell
>    wmctrl -l | awk '$4 == "mutt"'
>    xlsclients -l | grep " -name mutt "
> 

If anyone is interested, I've added a "--iconname" option to xdotool.
The patch[1] applies to xdotool-2.20110530.1 (latest version).
The motivation for adding this is below.

[1] http://rephorm.com/files/patches/xdotool_add-option-to-search-iconname.patch

I have zsh set my terminal window title to the last run command. This increases the likelihood of having windows that aren't mutt, but have the term 'mutt' in the title. So, I decided to use `urxvt -n muttTerminal -e mutt`. In this case, I get window with the title 'mutt', but with the WM_ICON_NAME set to 'muttTerminal'. I can then match on that in my 'launch_mail' script:

xdotool search --iconname muttTerminal set_desktop_for_window `xdotool \
  get_desktop` windowraise windowactivate || urxvt -n muttTerminal -e mutt 

Note that this pulls the open mutt instance to the current desktop,
raises it and then activates it. Thanks to everyone for the ideas on how
to implement this (which I had been meaning to do for some time to avoid
having an open mutt on every virtual desktop...).

Brian


More information about the openbox mailing list