You are not logged in.

1

Saturday, April 3rd 2004, 5:04pm

DCOP calls to do two things...

Hello,
I would like to know how to perform these tasks with DCOP:
1) Shutdown KDE (like invoking it from K-menu...)
2) Refresh the background image

I need to do these tasks because:
1) In the night I put an event with "at", like "sudo halt", and I would like to do something like this: "dcop_shutdown_kde" "sleep 10" "sudo halt"... (maybe it is a softner shutdown...)

2) I've done a bash script, called changebg, that creates a ~/.background.jpeg link to a random image. I have done a keyboard shortcut (ctrl+alt+b) that invokes this script. I would like to let KDE notice the background change and refresh the desktop:)

Thank you very much!
Pietro.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Saturday, April 3rd 2004, 7:18pm

Logout is a standard question, there are numerous Google hist for dcop+logout :)

For example
[code:1]
dcop ksmserver default logout 0 -1 -1
[/code:1]
Lgout without confirmation

Background is easy as well:
[code:1]
dcop kdesktop KBackgroundIface setWallpaper file
[/code:1]

Cheers,
_
Qt/KDE Developer
Debian User

3

Saturday, April 3rd 2004, 8:18pm

Hello!,

Quoted


Background is easy as well:
[code:1]
dcop kdesktop KBackgroundIface setWallpaper file
[/code:1]


I've tried to do this, but it don't work. I've tried to _play_ with dcop,
first launching "dcop", than, reading prom stout, "dcop kdesktop", and so on...
Probably I've understood HOW dcop works... but is there any documentation for the parameters?

So, still playing with dcop, I've "discovered" that setWallpaper wants a file and an integer, I've tried with "1" and it loads the image perfectly:)

[code:1]
dcop kdesktop KBackgroundIface setWallpaper file 1
[/code:1]

Thank you very much!
Pietro

m4ktub

Intermediate

Posts: 257

Location: Lisbon, Portugal

Occupation: Software Engineer

  • Send private message

4

Saturday, April 3rd 2004, 8:47pm

Try using 'kdcop'. It's a graphical browser of dcop enabled applicatons.
If you drag a item to the konsole (for example) you will get the full dcop command.

The number in the setWallpaper is the mode in which the wallpaper is set: stretch, center, tile, etc but not by this order.
There are some dcop tutorials out there but mostly there is no documentation because it depends of the applications that provide the api.

About changing the background...the kde desktop as support to do that. You can select directories with images and it will choose images to show. Just configure it in the destop settings.

5

Saturday, April 3rd 2004, 9:03pm

Quoted

Original von m4ktub

Try using 'kdcop'. It's a graphical browser of dcop enabled applicatons.


Ok Thanks! I find it very useful!

Quoted


The number in the setWallpaper is the mode in which the wallpaper is set: stretch, center, tile, etc but not by this order.


1 is for center:)

Quoted


About changing the background...the kde desktop as support to do that. You can select directories with images and it will choose images to show. Just configure it in the destop settings.


Yeah, I know, but I come from sawfish and I had to "build" a tool that do what kdesktop does:). So, I do not want to lose an "hard" work:)

Thank you very much:),
Pietro.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

6

Sunday, April 4th 2004, 10:55am

Quoted

Original von p.alfa


Probably I've understood HOW dcop works... but is there any documentation for the parameters?


Unfortunately no direct ones.
The parameters are usually descibed in the API docs for the implementing class.
One has to search KDE's sources, for example on webcvs.kde.org, for that.

It would be nice if a script could extract this comments and make them available like the API docs of KDE's base libs.

Cheers,
_
Qt/KDE Developer
Debian User