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, June 17th 2005, 3:12pm

The function of kmenu

Hi,
I'musing KDE 3.4.1 and with xbindkeys I want to map the winzozz key with the opening of kmenu (like in win the menu start with the key windows). What is the kde command for the kmenu opening???
Another thing:
I'd want to map the power button of my laptop with the window where is possible to choose to halt or reboot or terminate the session. I've to use an event in acpi or can i make it with xbindkeys??? In both cases what is the function that i've to call, that is the function called by CTRL+ALT+CANC???
By
N@poleone

2

Saturday, June 18th 2005, 10:11pm

RE: The function of kmenu

Quoted

Originally posted by napoleone1981
Hi,
I'musing KDE 3.4.1 and with xbindkeys I want to map the winzozz key with the opening of kmenu (like in win the menu start with the key windows). What is the kde command for the kmenu opening???

Source code

1
dcop kicker kicker showKMenu

Quoted

Originally posted by napoleone1981Another thing:
I'd want to map the power button of my laptop with the window where is possible to choose to halt or reboot or terminate the session. I've to use an event in acpi or can i make it with xbindkeys??? In both cases what is the function that i've to call, that is the function called by CTRL+ALT+CANC???
The normal logout function can also be reached through dcop:

Source code

1
dcop ksmserver ksmserver logout confirm sdtype sdmode
, where confirm, sdtype and sdmode are numbers.

This parameters means the following:
confirm:
  • -1: ShutdownConfirmDefault
  • 0: ShutdownConfirmNo
  • 1: ShutdownConfirmYes

sdtype:
  • -1: ShutdownTypeDefault
  • 0: ShutdownTypeNone
  • 1: ShutdownTypeReboot
  • 2: ShutdownTypeHalt

sdmode:
  • -1: ShutdownModeDefault
  • 0: ShutdownModeSchedule
  • 1: ShutdownModeTryNow
  • 2: ShutdownModeForceNow
  • 3: ShutdownModeInteractive

3

Sunday, June 19th 2005, 5:32pm

Quoted

The normal logout function can also be reached through dcop:
code:

1:



dcop ksmserver ksmserver logout confirm sdtype sdmode

, where confirm, sdtype and sdmode are numbers.

This parameters means the following:
confirm:

* -1: ShutdownConfirmDefault
* 0: ShutdownConfirmNo
* 1: ShutdownConfirmYes


sdtype:

* -1: ShutdownTypeDefault
* 0: ShutdownTypeNone
* 1: ShutdownTypeReboot
* 2: ShutdownTypeHalt


sdmode:

* -1: ShutdownModeDefault
* 0: ShutdownModeSchedule
* 1: ShutdownModeTryNow
* 2: ShutdownModeForceNow
* 3: ShutdownModeInteractive


I putted this command in the file /etc/acpi/acpi_handler.sh when the power button event occurs:

dcop ksmserver ksmserver -1 -1 -1

But it don't work with this error:

ERROR: Couldn't attach to DCOP server!

this is the file:
#!/bin/sh
# Default acpi script that takes an entry for all actions
# /sbin/init 0
IFS=${IFS}/
set $@

case "$1" in
button)
case "$2" in
power) /opt/kde/bin/dcop ksmserver ksmserver -1 -1 -1
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac

Why???
By
N@poleone

4

Sunday, June 19th 2005, 7:22pm

If you run the script as root, you have to set the DISPLAY environement variable. Also, root must have the neccesairy rights to access dcop (this is not implicit through the structure of X-client <-> X-server). You can grant this right with the xhost command (as user).

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

5

Monday, June 20th 2005, 9:31am

dcop --all-users --all-sessions

Cheers,
_
Qt/KDE Developer
Debian User