#!/usr/bin/perl use warnings; use strict; use X11::WMCtrl; # based on the EWMH specification: # http://www.freedesktop.org/standards/wm-spec/ # wmctrl only works with window managers which implement # this specification. # The homepage of wmctrl: # http://sweb.cz/tripie/utils/wmctrl/ # wmctrl must be installed somewhere in the path my $wmctrl = X11::WMCtrl->new; my %setup= ( 0 => '/home/zentara/mozilla/run-mozilla.sh', 1 => '/usr/bin/sylpheed', 2 => '/usr/bin/tk-spamchecker', 3 => undef, 4 => undef, 5 => 'xterm -fn 10x20 -ls -geometry 97x35+0+25 -e /usr/bin/mc', 6 => undef, 7 => 'xterm -fn 10x20 -ls -geometry 97x35+0+25 -e /usr/bin/mc', 8 => '/usr/bin/agent', 9 => '/usr/bin/girc' ); foreach my $wrksp (0..9){ $wmctrl->switch($wrksp); my $cmd = $setup{$wrksp}; if(defined $cmd){ system("$cmd &"); sleep 3 } $wmctrl->maximize($wrksp); } #my $app = $windows[0]->{title}; #$wmctrl->maximize($app); #$wmctrl->unmaximize($app); #$wmctrl->shade($app); #$wmctrl->unshade($app); #$wmctrl->close($app);