LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Blogs > LiquidSlumber
User Name
Password

Notices

Rate this Entry

A startup script that opens up several Firefox Thunderbird and Mythtv windows over several workspaces to be used later.

Posted 12-23-2005 at 07:49 PM by LiquidSlumber

#This script opens up an number of programs and moves them to different workspaces to be used later. This script is intended to be executed via the .bash_profile. NOTE: this script is made to work with 2 MONITORS. It will not work correctly with just one without being modified. This script also requires wmctrl http://sweb.cz/tripie/utils/wmctrl/

#!/bin/bash -x

#this function starts up serval FireFox windows over serval workspaces
function fire ()
{
#This for loop takes all of the firefox windows out of fullscreen mode
for i in $@
do
wmctrl -b remove,fullscreen
done

sleep 3
#this command moves the firefox windows named by the $1 varaible to the 2nd workspace (the workspaces are indexed from zero)
wmctrl -i -r $1 -t 1
sleep 3
wmctrl -i -r $1 -e 0,0,0,1024,768


wmctrl -i -r $2 -t 1
sleep 3
#this command moves one firefox window to the right hand monitor
wmctrl -r -r $2 -e 0,1024,0,1024,768


wmctrl -i -r $3 -t 2
sleep 3
wmctrl -i -r $3 -e 0,0,0,1024,768


wmctrl -i -r $4 -t 3
sleep 3
wmctrl -i -r $4 -e 0,0,0,1024,768

##################################################

# sleep 3

# wmctrl -i -r $2 -e 0,1024,0,1024,768
# sleep 3

# wmctrl -i -r $3 -e 0,1024,0,1024,768
##################################################

#wmctrl -i -r $1 -e 0,0,0,1024,76

#wmctrl -i -r $2 -e 0,0,0,1024,768
}

#the following lines startup all of the programs I want to move to various workspaces
sleep 30

firefox &
sleep 3
mythfrontend --geometry 1024x768+1024+0 &
sleep 3
firefox &
sleep 3
thunderbird &
sleep 3
firefox &
sleep 3
firefox &

sleep 9

wmctrl -r mythfrontend -t 3

#sleep 3

wmctrl -r thunderbird -t 2

wmctrl -r thunderbird -e 0,0,0,1024,768

#sleep 3

fire $(wmctrl -l | grep Firefox | cut -f1 -d" ")


#sleep 30


#kill $(ps -ef | grep firefox | cut -f7 -d' ') $(ps -ef | grep thunderbird | cut -f7 -d' ') $(ps -ef | grep mythfrontend | cut -f7 -d' ')
Posted in Uncategorized
Views 2141 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration