You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, August 6th 2004, 9:33pm

how to create a button to switch desktops?

I usally work with several virtual desktops, and have a very simple alarm (a pop-up window in Tcl/Tk) that shows up whenever a particular job has finished, no matter what desktop I am currently working.

Now what I would like is to click in this alarm window so that I will be automatically transferred to the desktop where I initially put the job. I put the jobs via scripts through Konsoles.

Let me explain with an example:
(1) I have a Konsole in desktop 1, and from here I submit a job and set an alarm.
(2) One hour later I'm working in say, desktop three, and there pops up the alarm telling me the job
has finished. My problem is that one hour later I don't remember from which desktop I submitted
the job. I usually work with 8 desktops, which makes it a pain to navigate looking for the Konsole.
(3) The holy grial ! => I click in the alarm window and I'm back to desktop 1.

I have never developed any application for DKE, so I have no clue as to how much sweat I have to put to set up a desktop switch in the alarm window.

Any suggestions where/how to start ??? Also, are there other forums where this post may also be appropriate? (I'm assuming this is one of them :) )

jose

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Saturday, August 7th 2004, 12:47pm

You could use a script to start the job and raise the window.

Before you start the job you use

Source code

1
dcop kwin KWinInterface currentDesktop

to get the number of the current desktop

The in the action triggered by the message window you can do

Source code

1
2
#
dcop kwin KWinInterface setCurrentDesktop $DESKTOPNUMBER


Cheers,
_
Qt/KDE Developer
Debian User

3

Saturday, August 7th 2004, 5:50pm

Thank you, anda_skoa. It now works sweet !!!
jose,