Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Laptop Power Button
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
doubled157940
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2006
Posts: 85

PostPosted: Sat Sep 15, 2007 6:05 am    Post subject: Laptop Power Button Reply with quote

When I push the power button gnome brings up the small window for shutdown, reset, or logout, then Gentoo immediately starts init0. But I don't want it too. How can I make it so that when I push the power button, gnome asks the question, then thats it, acpid doesn't do anything and gnome waiting for my reply?
Back to top
View user's profile Send private message
Dottout
l33t
l33t


Joined: 07 Mar 2006
Posts: 882

PostPosted: Sat Sep 15, 2007 10:46 am    Post subject: Reply with quote

edit /etc/acpi/default.sh
Back to top
View user's profile Send private message
doubled157940
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2006
Posts: 85

PostPosted: Sat Sep 15, 2007 10:43 pm    Post subject: Reply with quote

But what do I change inside default.sh?
I don't understand what is going on inside of it at all. This is what I have in the file:

/etc/acpi/default.sh
Code:

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

set $*

# Take care about the way events are reported
ev_type=`echo "$1" | cut -d/ -f1`
if [ "$ev_type" = "$1" ]; then
        event="$2";
else
        event=`echo "$1" | cut -d/ -f2`
fi


case "$ev_type" in
    button)
        case "$event" in
            power)
                logger "acpid: received a shutdown request"
                /sbin/init 0
                break
                ;;
             *)
                logger "acpid: action $2 is not defined"
                ;;
        esac
    ;;

    *)
        logger "ACPI group $1 / action $2 is not defined"
        ;;
esac
Back to top
View user's profile Send private message
Barnoid
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2004
Posts: 103

PostPosted: Mon Sep 17, 2007 1:19 am    Post subject: Reply with quote

doubled157940 wrote:
But what do I change inside default.sh?
I don't understand what is going on inside of it at all. This is what I have in the file:


Since Gnome is already bringing up the shutdown window, you can simply comment out /sbin/init 0 by putting a "#" in front of it, i.e.

/etc/acpi/default.sh
Code:

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

set $*

# Take care about the way events are reported
ev_type=`echo "$1" | cut -d/ -f1`
if [ "$ev_type" = "$1" ]; then
        event="$2";
else
        event=`echo "$1" | cut -d/ -f2`
fi


case "$ev_type" in
    button)
        case "$event" in
            power)
                logger "acpid: received a shutdown request"
                #/sbin/init 0
                break
                ;;
             *)
                logger "acpid: action $2 is not defined"
                ;;
        esac
    ;;

    *)
        logger "ACPI group $1 / action $2 is not defined"
        ;;
esac
Back to top
View user's profile Send private message
doubled157940
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2006
Posts: 85

PostPosted: Tue Sep 18, 2007 7:08 pm    Post subject: [solved] Reply with quote

Thanks that worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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