Posted by urukrama on Mon 5 May 21:17 (modification of post by sole_thunar view diff)
report abuse | download | new post
- #!/bin/sh
- thunar_wm_class="thunar"
- thunar_exec="thunar"
- # no thunar started, so start one
- if [ -z "`wmctrl -lx | grep thunar`" ]; then
- $thunar_exec &
- else
- # search for existing thunars on current desktop
- current_desk=`wmctrl -d | grep '*' | cut -d ' ' -f 1`
- thunar_on_this_desk=`wmctrl -lx | grep "$current_desk[ ]*$thunar_wm_class" | cut -d ' ' -f 1`
- if [ -n "$thunar_on_this_desk" ]; then
- wmctrl -i -a $thunar_on_this_desk
- else
- # no thunars on current desktop, so open a new one
- wmctrl -x -R $thunar_wm_class
- fi;
- fi;
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.