Xfce Forum

Sub domains
 

You are not logged in.

#1 2007-10-01 02:12:35

lavacube
Member
Registered: 2006-11-23
Posts: 4

Change Workspace via CLI?

Hi there,

I'm working on a project that requires me to switch between two fullscreen programs fairly quickly. I've thought it out and having them in their own separate workspaces would be ideal for me. The question is, how would I go about switching between the two (perhaps even more) workspaces when something happens. This something would most likely be driven via a bash/cli program or something to that effect.

I've come across a couple of solutions that would most likely work, however they would be a lot of overkill and would most likely slow things down. My first (and more optimized) option would be to build a small C program with Xlib, using XTestFakeKeyEvent() to simulate the keypress events... the problem there is that my C sucks the big one.
My second option is Expect which would also simulate the keypress. Seems easier to use, bit looks like there will be a lot more overhead since it is a tk program (and we all know tk is interpreted).

So... is there a hidden switch or something somewhere in xfdesktop or...? Are the above to options my only options?

Help? :-)

Offline

#2 2007-10-01 02:47:13

lavacube
Member
Registered: 2006-11-23
Posts: 4

Re: Change Workspace via CLI?

Well it's been about 30 mins and I already found a great tool to do the job.

After doing a bit of research on XTestFakeKeyEvent() I found a little tool called xdotool. It works perfectly for my needs and does a lot more than I need... at only 25kb after compile I think this is my best bet..

I would still prefer a native solution to XFCE if it exists... if not, I will stick to xdotool! :-)

Offline

Board footer

Powered by FluxBB