Gentoo Archives: gentoo-laptop

From: Pierre Guinoiseau <songoku38@×××××.com>
To: gentoo-laptop@l.g.o
Subject: Re: [gentoo-laptop] turn off laptop monitor when closing lid
Date: Mon, 14 Aug 2006 18:39:15
Message-Id: 44E0C2FF.9000803@gmail.com
In Reply to: [gentoo-laptop] turn off laptop monitor when closing lid by Neil Isaac
1 Hi
2
3 Try with sys-apps/vbetool, it work for me :)
4
5
6 - /etc/acpi/default.sh :
7
8 #!/bin/bash
9
10 group=${1/\/*/}
11 action=${1/*\//}
12
13 case "$group" in
14 button)
15 case "$action" in
16 power) /sbin/init 0
17 ;;
18 lid) /etc/acpi/actions/toggle-display.sh
19 ;;
20 sleep) /usr/sbin/hibernate-ram
21 ;;
22 *) logger "ACPI action $action is not defined"
23 ;;
24 esac
25 ;;
26
27 *) logger "ACPI group $group / action $action is not defined"
28 ;;
29 esac
30
31
32 - /etc/acpi/actions/toggle-display.sh :
33
34 #!/bin/bash
35
36 LID_STATE="/proc/acpi/button/lid/LID/state"
37 LID_OPEN="open"
38 LID_CLOSED="closed"
39
40 if [[ "$(grep ${LID_OPEN} ${LID_STATE})" != "" ]]; then
41 logger "Switching on Display"
42 /usr/sbin/vbetool dpms on
43 elif [[ "$(grep ${LID_CLOSED} ${LID_STATE})" != "" ]]; then
44 logger "Switching off Display"
45 /usr/sbin/vbetool dpms off
46 fi
47
48
49 Pierre
50
51
52
53 Neil Isaac a écrit :
54 > I modified my /etc/acpi/default.sh to:
55 >
56 > -- snip off the top --
57 > case "$group" in
58 > button)
59 > case "$action" in
60 > power) /sbin/init 0
61 > setterm -blank 0
62 > ;;
63 >
64 > lid) /usr/bin/xset -display :0.0 dpms force
65 > off # i added this
66 > ;;
67 >
68 > *) logger "ACPI action $action is not
69 > defined"
70 > ;;
71 > esac
72 > ;;
73 > *)
74 > logger "ACPI group $group / action $action is not defined"
75 > ;;
76 > esac
77 > -- EOF --
78 >
79 > This preforms exactly as I would like it to (turn the laptop monitor
80 > right off) but it obviously only works while running X. How can I
81 > adapt it to achieve the same end even if I'm not running X. Note that
82 > my screen already blanks after a given time, but still emits some
83 > light.
84 >
85 >
86
87 --
88
89 Pierre Guinoiseau
90 Email: songoku38@×××××.com
91 M$N: songoku38@×××××.com
92 Jabber: lnx@××××××.fr
93 WWW: http://akoya.homelinux.net
94
95
96
97 --
98 gentoo-laptop@g.o mailing list

Replies

Subject Author
Re: [gentoo-laptop] turn off laptop monitor when closing lid Neil Isaac <isaac.neil@×××××.com>