Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ACPI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
chuliomartinez
n00b
n00b


Joined: 25 Dec 2004
Posts: 30
Location: Event horizont

PostPosted: Sun Jan 16, 2005 9:53 am    Post subject: ACPI Reply with quote

Using kde I wanted the session to be saved on powerbutton hit.

get acpi daemon, program monitoring acpi events.
can be used for other things to, especially if you have a laptop.

Code:

emerge acpid


second goto /etc/acpi and edit the default.sh script like this:
Code:

#!/bin/sh
# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}
action=${1/*\//}

case "$group" in
        button)
                case "$action" in
                        power)
                            app="/usr/kde/3.3/bin/dcop"
                            $app --user miro ksmserver default "logout" 0 2 0
#                       /sbin/init 0
                                ;;
                        *)      logger "ACPI action $action is not defined"
                                ;;
                esac
                ;;

        *)
                logger "ACPI group $group / action $action is not defined"
                ;;
esac


Ok the code is quite dumb, as you can see by the hardcoded username "miro", which has to be (obviously) replaced by your user name:). So feel free to make it better!
_________________
naked&dead
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum