summaryrefslogtreecommitdiff
blob: 3819b23b5c66e67d8c1047033ab687fae82cfeaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh-orig	2007-12-23 22:48:55.873089378 -0600
+++ common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh	2007-12-23 22:49:59.246421379 -0600
@@ -4,6 +4,8 @@
 # Control script for ACPI lid state and AC adapter state
 #
 
+aticonfig='/opt/bin/aticonfig'
+
 getXuser() {
         user=`who| grep -m1 ":$displaynum " | awk '{print $1}'`
         if [ x"$user" = x"" ]; then
@@ -47,7 +49,7 @@
 done
 
 #If PPLIB is enabled
-su $user -c '/usr/bin/aticonfig --pplib-cmd="get version"' | grep PPLIB
+su $user -c '$aticonfig --pplib-cmd="get version"' | grep PPLIB
 if [ $? = 0 ]; then
    echo "Has PPLIB"
    has_pplib=1
@@ -61,15 +63,15 @@
 if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
     echo "Low power"
     if [ ${has_pplib} -eq 1 ]; then
-        su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
+        su $user -c '$aticonfig --pplib-cmd="notify psrc dc"'
     else
-        su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
+	    su $user -c "$aticonfig --set-powerstate=1"
     fi
 else
     echo "high power"
     if [ ${has_pplib} -eq 1 ]; then
-        su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
+        su $user -c '$aticonfig --pplib-cmd="notify psrc ac"'
     else
-        su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
+	    su $user -c "$aticonfig --set-powerstate=$($aticonfig --lsp | grep 'default state' | cut -c 3)"
     fi
 fi