satelliteuser083 Posted July 26, 2008 Report Share Posted July 26, 2008 No luck with searches on this one :huh: . Is it possible to switch desktop with a script (i.e from current to e.g. desktop Nr 4); if so, how? Thanks. [moved from Software by spinynorman] Link to comment Share on other sites More sharing options...
{BBI}Nexus{BBI} Posted July 28, 2008 Report Share Posted July 28, 2008 You should be able to do it with DCOP calls. A quick explaination/demo of how DCOP works is here: http://www.ibm.com/developerworks/linux/library/l-dcop/ Link to comment Share on other sites More sharing options...
iphitus Posted July 28, 2008 Report Share Posted July 28, 2008 There's an app called wmctrl that might do this. Link to comment Share on other sites More sharing options...
satelliteuser083 Posted July 28, 2008 Author Report Share Posted July 28, 2008 (edited) Have tried both of your suggestions and each does the trick. Many thanks. Now, with that problem solved, I have just a niggle; when I start an app from a script - e.g. gnumeric - a series of messages appears (errors?) in the konsole running the script, which I would like to suppress. I've tried using '>' but bash ignores that. Any ideas? Thanks. Edited July 28, 2008 by satelliteuser083 Link to comment Share on other sites More sharing options...
{BBI}Nexus{BBI} Posted July 28, 2008 Report Share Posted July 28, 2008 Have tried both of your suggestions and each does the trick. Many thanks. Now, with that problem solved, I have just a niggle; when I start an app from a script - e.g. gnumeric - a series of messages appears (errors?) in the konsole running the script, which I would like to suppress. I've tried using '>' but bash ignores that. Any ideas? Thanks. Try using the &. Link to comment Share on other sites More sharing options...
satelliteuser083 Posted July 28, 2008 Author Report Share Posted July 28, 2008 (edited) Was a bit confused, nexus, 'cos substituting '>' with '&' didn't work. However, I found the following site, where all became clear (at least, the bit about stderr did B) ) http://www.cpqlinux.com/redirect.html Now, using 'gnumeric filename 2>err.txt', there's no error-output. Thanks. Edited July 28, 2008 by satelliteuser083 Link to comment Share on other sites More sharing options...
{BBI}Nexus{BBI} Posted July 28, 2008 Report Share Posted July 28, 2008 (edited) Was a bit confused, nexus, 'cos substituting '>' with '&' didn't work. However, I found the following site, where all became clear (at least, the bit about stderr did B) )http://www.cpqlinux.com/redirect.html Now, using 'gnumeric filename 2>err.txt', there's no error-output. Thanks. I just thought backgrounding it would surpress any console output. Glad you've got it sorted. :) If you don't need the err.txt file would it not be better to pipe the output to /dev/null? Edited July 28, 2008 by {BBI}Nexus{BBI} Link to comment Share on other sites More sharing options...
satelliteuser083 Posted July 29, 2008 Author Report Share Posted July 29, 2008 (edited) Yes, you're correct, of course; '2>/dev/null' works well. Thanks. :D And, following on with this topic, I've come up against another problem. I want to start two apps in different workspaces but the workspace-selection is completed much faster than the app start-up, the result being that they both end up in the same (second) workspace. My script looks like this: wmctrl -s2 gnumeric filename1 & wmctrl -s3 kpdf filename2 & Does anyone know of a way of delaying the execution of 'wmctrl -s3' until gnumeric has completed start-up (or any other way of ensuring that the script acts as desired)? Thanks. Edited July 29, 2008 by satelliteuser083 Link to comment Share on other sites More sharing options...
satelliteuser083 Posted July 30, 2008 Author Report Share Posted July 30, 2008 When I perform the following command in a konsole, it works: [lawrence@localhost ~]$ dcop kwin KWinInterface currentDesktop 4 The same thing in a script, in an attempt to assign this value to a variable curws=dcop kwin KWinInterface currentDesktop fails, with the message kwin: Unexpected argument 'KWinInterface' . I assume that this is a basic script-syntax problem, but I can't see it. Can anyone help me out? Thanks. Link to comment Share on other sites More sharing options...
pmpatrick Posted July 30, 2008 Report Share Posted July 30, 2008 Does anyone know of a way of delaying the execution of 'wmctrl -s3' until gnumeric has completed start-up (or any other way of ensuring that the script acts as desired)? Thanks. You can use wait or sleep in your script: http://www.linux.com/articles/113976 Link to comment Share on other sites More sharing options...
spinynorman Posted July 30, 2008 Report Share Posted July 30, 2008 I assume that this is a basic script-syntax problem, but I can't see it. Can anyone help me out? Thanks. Found this on Google, which would suggest that this might work: curws=$(dcop kwin KWinInterface currentDesktop) Link to comment Share on other sites More sharing options...
satelliteuser083 Posted August 9, 2008 Author Report Share Posted August 9, 2008 Thanks, spinynorman, that worked well; just knew it was syntax. ;) And, pmpatrick, 'wait' doesn't do quite what I want; I think that it does wait, but right up until gnumeric is terminated and not (as I want) until the latter is up and running, i.e ready to accept input. I'm now playing with 'sleep'; doesn't work just yet but will report when/if it does. Many thanks to you both. :thumbs: Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted August 11, 2008 Report Share Posted August 11, 2008 (edited) I'm not at my linux box at the moment, but you might try something similar to this: wmctrl -s2 gnumeric filename1 & while [ $(wmctrl -l | grep gnumeric) -eq '' ] do sleep done wmctrl -s3 kpdf filename2 & Edited August 11, 2008 by Steve Scrimpshire Link to comment Share on other sites More sharing options...
javaguy Posted August 12, 2008 Report Share Posted August 12, 2008 I can't find wmctrl. I also can't find it with urpmi, and I can't find it with the package installer in MCC. Link to comment Share on other sites More sharing options...
theYinYeti Posted August 12, 2008 Report Share Posted August 12, 2008 It is indeed not available in urpmi, but it is really easy and fast to compile. I suggest you install "checkinstall" first, then install wmctl by replacing the "make install" command with the "checkinstall" command: this will auto-create a RPM for you :) Yves. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now