Is wmctrl a good idea?

ozrocpablogc
Cat in the hat
Cat in the hat
Posts: 30
Joined: Sun Jun 03, 2007 4:48 pm
Contact:

Is wmctrl a good idea?

Postby ozrocpablogc » Sun Jun 17, 2007 10:21 am

I came to fvwm from xfce where I missed a way for really using virtual desktops.
For that environment, I wrote a script called ozganizator (http://ozganizator.berlios.de) that used wmctrl and a bit of bash for ordering windows in desktops on a command. I mean, it sent, for example, terminals to desktop 1, web browsers to desktop 2... in a similar way as Afterstep does.

Of course, this can be much better done in fvwm, but I wanted to keep this functionality and also the configuration beetween several window managers 'cause I usually change for trying new ones.

Basically, I kept the configuration in files (d1, d2, d3, d4...) corresponding to each desktop configuration with just window names in each one. Then a little script like this:

Code: Select all

# just a counter
DESKTOP_C=0
# for all desktops configured
until [ $DESKTOP_C -eq $N_DESKTOP ] ; do
        DESKTOP_C=$(($DESKTOP_C+1))
# for all windows configured in each desktop
        for i in $(cat d$DESKTOP_C) ; do
# for all opened windows
                for j in $(wmctrl -x -l | grep $i | cut -d " " -f 1 ); do
# Send each window to each configured desktop
                        wmctrl -i -r $j -t $(($DESKTOP_C-1)) 
                done
        done
done


wmctrl (http://www.sweb.cz/tripie/utils/wmctrl/) has many good features. Althought it's really limited in comparison with fvwm, it's quite portable beetween different window managers (EWMH specifications).

I wanted to know if you think it's a good idea to keep using wmctrl for tasks it can do (like this one) so those tasks will be avaiable for other window managers, or should I code exclusively for fvwm and forget all my functions when trying other wm's.
# whoami | tr 'otr' 'ekg'

thomasadam
Administrator
Administrator
Posts: 3043
Joined: Mon Nov 08, 2004 1:12 am
Location: England
Contact:

Re: Is wmctrl a good idea?

Postby thomasadam » Sun Jun 17, 2007 11:58 am

ozrocpablogc wrote:... that used wmctrl and a bit of bash for ordering windows in desktops on a command. I mean, it sent, for example, terminals to desktop 1, web browsers to desktop 2... in a similar way as Afterstep does.


You don't need this at all in FVWM.

If you wanted to send *all* xterms to desktop 1 then:

Code: Select all

All (XTerm) MoveToDesk 1


If you wanted to do that for the current page, use:

Code: Select all

All (XTerm, CurrentPage) MoveToDesk 1


etc.

-- Thomas Adam

ozrocpablogc
Cat in the hat
Cat in the hat
Posts: 30
Joined: Sun Jun 03, 2007 4:48 pm
Contact:

Re: Is wmctrl a good idea?

Postby ozrocpablogc » Sun Jun 17, 2007 5:05 pm

thomasadam wrote:You don't need this at all in FVWM.

If you wanted to send *all* xterms to desktop 1 then:

Code:
All (XTerm) MoveToDesk 1


ozrocpablogc wrote:Of course, this can be much better done in fvwm, but I wanted to keep this functionality and also the configuration beetween several window managers
# whoami | tr 'otr' 'ekg'

thomasadam
Administrator
Administrator
Posts: 3043
Joined: Mon Nov 08, 2004 1:12 am
Location: England
Contact:

Re: Is wmctrl a good idea?

Postby thomasadam » Sun Jun 17, 2007 5:07 pm

ozrocpablogc wrote:Of course, this can be much better done in fvwm, but I wanted to keep this functionality and also the configuration beetween several window managers


*Shrugs* -- I wouldn't bother. Keep the script as it is for other window managers, and use FVWM as it is meant to be without the superfluous stuff.

-- Thomas Adam

ozrocpablogc
Cat in the hat
Cat in the hat
Posts: 30
Joined: Sun Jun 03, 2007 4:48 pm
Contact:

Re: Is wmctrl a good idea?

Postby ozrocpablogc » Sun Jun 17, 2007 9:16 pm

thomasadam wrote:
ozrocpablogc wrote:Of course, this can be much better done in fvwm, but I wanted to keep this functionality and also the configuration beetween several window managers


*Shrugs* -- I wouldn't bother. Keep the script as it is for other window managers, and use FVWM as it is meant to be without the superfluous stuff.

-- Thomas Adam


Yes, I think that'll be the best solution... Thanks.
# whoami | tr 'otr' 'ekg'

User avatar
eexpress
Cat in the hat
Cat in the hat
Posts: 38
Joined: Mon Nov 28, 2005 5:25 am

Re: Is wmctrl a good idea?

Postby eexpress » Tue Jul 22, 2008 8:37 am

wmctrl is ready for other wm user.


Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 1 guest