PDA

View Full Version : [gnome] Controlling gnome from the command line



mofrikaantje
June 2nd, 2009, 05:30 PM
Hi,
I'm looking for a way to control gnome from the command line (terminal): things like going to the next windows, desktop 2, maximize window, etc. I already looked on the interwebs and searched the forums, but no result. Is there a way to do this?

zhocchao
June 2nd, 2009, 09:55 PM
wmctrl can be helpful

uupreti
June 2nd, 2009, 10:06 PM
Yeah wmctrl is something that can interact with X-manager from command line.

mofrikaantje
June 3rd, 2009, 09:51 AM
True, wmctrl has some options, but not just switching to the next window, or maximising it, etc. Aren't there any other extensions available that could do the trick, or - simply - are there command line options available to control gnome directly?
Sorry for bugging you guys with it, I'm just trying to get some voice control program to do the things I want, like switching to another window :)

Cheers

zhocchao
June 3rd, 2009, 07:52 PM
Don't know about command line options. But you could simulate the key for the action
e.g.
xte 'keydown Alt_L' ;xte 'key F2' ;xte 'keyup Alt_L'
or
xte 'keydown Alt_L' ;xte 'key Tab' ;xte 'keyup Alt_L'

mofrikaantje
June 3rd, 2009, 08:51 PM
Don't know about command line options. But you could simulate the key for the action
e.g.
xte 'keydown Alt_L' ;xte 'key F2' ;xte 'keyup Alt_L'
or
xte 'keydown Alt_L' ;xte 'key Tab' ;xte 'keyup Alt_L'

This pretty much looks like what I was looking for. I've tested some commands, including Page Down, and it works! Thanks :D Yelling "next window" at my computer works now!

zhocchao
June 4th, 2009, 04:31 PM
does it really work? (alt+tab). I tried it with strokes, but when i have 4 windows open, 1 is never activated.