Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line (or gui prog with options) desktop swicher 1

Status
Not open for further replies.

sjpatrick

Programmer
Sep 4, 2001
54
US
I want my machine to switch to a specific desktop (I'm running kde) at a particular time (of the evening -- sortof a go-to-bed reminder).

I have, natch', many options for running commands at certain times, but I want to change to a specific desktop at said time.

This is part of an experiment to find ways to deal with periodic insomnia fits and the desktop in question has a dark background and its job is to wait for an apropriate screen saver to kick in. No apps will ever run on this particular desktop. The whole reason I am approaching this in this manner is that I have cats. They like to walk around on my laptop a lot, even when it's in my lap. I want to set the computer to go to a desktop where the worst harm they could cause is to interrupt the screensaver...

Any ideas?

Thanks a ton in advance,

Perpetually Sleepy Steve


<d3v310p3r/>
 
You need the magic of DCOP. DCOP is KDE's IPC (inter-process communication) protocol and is supported by most KDE applications. Using the command-line dcop program, you can call any available DCOP interface from a script. You can use the kdcop program to browse the available DCOP interfaces for each application.

For changing desktops, the specific command you want is:
Code:
dcop kwin KWinInterface setCurrentDesktop <desktop number>
 
Would someone please pin a star to this person's chest?

Hey, wait... I can do that myself!

Thanks, AdaHacker, for knowing/finding the exact solution I was looking for.



<d3v310p3r/>
 
Not a technical solution to the question, but an idea about the insomnia and cant problems...

- Set xlock to be password protected... The cats' likelyhood of pressing the keys needed unlock your PC is slim to none.
- Leave computer (and maybe cats) outside the bedroom, and you may have easier time sleeping.


[plug=shameless]
[/plug]
 
Thanks, jstreich, but the point of the exercise was to actively use the computer to help provide an environment conducive to sleep by creating soothing sounds and visual images.

I am one of those for whom total silence is the worst environment for sleeping; my own thoughts keep me awake if my mind is left alone.

As for the cats, they are very social; if I try to keep them out, they will make noise letting me know that they don't like that. Besides, the cats' purring is a very relaxing sound.

For the record, my experiment is worling rather well. ;-)

<d3v310p3r/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top