4 source /etc
/acpi
/eeepc
/acpi-eeepc-generic-functions.sh
5 source /etc
/conf.d
/acpi-eeepc-generic.conf
7 source /etc
/acpi
/eeepc
/models
/acpi-eeepc-
$EEEPC_MODEL-events.conf
9 # Needed, else libnotify can't display its magic
10 su
$XUSER --login -c "xhost +"
13 if [ "$KEY_SHOW" = "1" ]; then
14 eeepc_notify
"You pressed: \"$SELECTION\"" keyboard
19 cmds
=(test1 test2
"test3 test4")
20 eeepc_notify
"Test event: ${cmds[@]}" keyboard
21 execute_commands
"${cmds[@]}"
26 eeepc_notify
"Power button pressed"
27 execute_commands
"${COMMANDS_POWER_BUTTON[@]}"
30 eeepc_notify
"Button undefined: $2 $3 $4"
31 logger
"ACPI power undefined: $2 $3 $4"
39 eeepc_notify
"Sleep button pressed"
40 execute_commands
"${COMMANDS_SLEEP[@]}"
43 eeepc_notify
"Button undefined: $2 $3 $4"
44 logger
"ACPI sleep undefined: $2 $3 $4"
54 #echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
55 execute_commands
"${COMMANDS_AC_UNPLUGGED[@]}"
56 #echo $BRIGHTNESS_BATTERY > /proc/acpi/asus/brn
57 #xbacklight -set $BRIGHTNESS_BATTERY
58 #if [ $WIRELESS_MODULE = "iwl3945" ]; then
59 #echo $WIRELESS_POWERSAVE > /sys/bus/pci/drivers/iwl3945/0000:01:00.0/power_level;
63 #echo 500 > /proc/sys/vm/dirty_writeback_centisecs
64 execute_commands
"${COMMANDS_AC_PLUGGED[@]}"
65 #echo $BRIGHTNESS_AC > /proc/acpi/asus/brn
66 #xbacklight -set $BRIGHTNESS_AC
67 #if [ $WIRELESS_MODULE = "iwl3945" ]; then
68 # echo 6 > /sys/bus/pci/drivers/iwl3945/0000:01:00.0/power_level;
73 *) logger
"ACPI AC undefined: $2 $3 $4"
82 00000000) # Battery removed
84 00000001) # Battery present
88 *) logger
"ACPI battery undefined: $2 $3 $4"
94 lidstate
=$
(cat /proc
/acpi
/button
/lid
/LID
/state |
awk '{print $2}')
101 if [ "$COMMANDS_ON_LID_CLOSE" == "yes" ]; then
102 ac_state
=$
(cat /proc
/acpi
/ac_adapter
/AC
0/state |
awk '{print $2}' )
105 # AC adapter plugged in
106 execute_commands
"${COMMANDS_LID_CLOSE_ON_AC[@]}"
110 execute_commands
"${COMMANDS_LID_CLOSE_ON_BATTERY[@]}"
116 logger
"Lid state undefined: $2 $3 $4"
122 $EEEPC_BLANK) # Silver function button 1 (Blank)
123 logger
"acpi-eeepc-generic-handler.sh (hotkey): Silver function button (Blank)"
124 execute_commands
"${COMMANDS_BUTTON_BLANK[@]}"
126 $EEEPC_RESOLUTION) # Silver function button 2 (Resolution)
127 logger
"acpi-eeepc-generic-handler.sh (hotkey): Silver function button (Resolution)"
128 execute_commands
"${COMMANDS_BUTTON_RESOLUTION[@]}"
130 $EEEPC_USER1) # Silver function button 3 (User1)
131 logger
"acpi-eeepc-generic-handler.sh (hotkey): Silver function button (User1)"
132 execute_commands_as_user
"${COMMANDS_BUTTON_USER1[@]}"
134 $EEEPC_USER2) # Silver function button 4 (User2)
135 logger
"acpi-eeepc-generic-handler.sh (hotkey): Silver function button (User2)"
136 execute_commands_as_user
"${COMMANDS_BUTTON_USER2[@]}"
140 logger
"acpi-eeepc-generic-handler.sh (hotkey): Sleep"
141 eeepc_notify
"Going to sleep..."
142 execute_commands
"${COMMANDS_SLEEP[@]}"
144 $EEEPC_WIFI_TOGGLE) # WiFi Toggle
145 logger
"acpi-eeepc-generic-handler.sh (hotkey): WiFi toggle"
146 execute_commands
"${COMMANDS_WIFI_TOGGLE[@]}"
147 #eeepc_notify "Wireless" network-wireless
149 $EEEPC_WIFI_UP) # WiFi Up
150 logger
"acpi-eeepc-generic-handler.sh (hotkey): WiFi Up"
151 execute_commands
"${COMMANDS_WIFI_UP[@]}"
152 #eeepc_notify "Wireless Up" network-wireless
154 $EEEPC_WIFI_DOWN) # WiFi Down
155 logger
"acpi-eeepc-generic-handler.sh (hotkey): WiFi Down"
156 execute_commands
"${COMMANDS_WIFI_DOWN[@]}"
157 eeepc_notify
"Wireless Down" network-wireless
159 $EEEPC_BRIGHTNESS_UP|
$EEEPC_BRIGHTNESS_DOWN) # Brightness
160 brightness_direction
=`brightness_find_direction`
161 if [ "$brightness_direction" == "up" ]; then
162 execute_commands
"${COMMANDS_BRIGHTNESS_UP[@]}"
163 brightness_percentage
=`brightness_get_percentage`
164 logger
"acpi-eeepc-generic-handler.sh (hotkey): Brightness Up ($brightness_percentage%)"
165 eeepc_notify
"Brightness Up ($brightness_percentage%)" dialog-information
167 execute_commands
"${COMMANDS_BRIGHTNESS_DOWN[@]}"
168 brightness_percentage
=`brightness_get_percentage`
169 logger
"acpi-eeepc-generic-handler.sh (hotkey): Brightness Down ($brightness_percentage%)"
170 eeepc_notify
"Brightness Down ($brightness_percentage%)" dialog-information
173 $EEEPC_SCREEN_OFF) # Turn off screen
174 logger
"acpi-eeepc-generic-handler.sh (hotkey): Turn off screen"
175 execute_commands
"${COMMANDS_SCREEN_OFF[@]}"
176 eeepc_notify
"Turning screen off..." dialog-information
178 $EEEPC_XRANDR_TOGGLE) # RandR
179 logger
"acpi-eeepc-generic-handler.sh (hotkey): RandR"
180 execute_commands
"${COMMANDS_XRANDR_CLONE[@]}"
181 eeepc_notify
"Clone" video-display
183 $EEEPC_XRANDR_CLONE) # RandR (clone)
184 logger
"acpi-eeepc-generic-handler.sh (hotkey): RandR (clone)"
185 execute_commands
"${COMMANDS_XRANDR_CLONE[@]}"
186 eeepc_notify
"Clone" video-display
188 $EEEPC_XRANDR_VGA) # RandR (vga only)
189 logger
"acpi-eeepc-generic-handler.sh (hotkey): RandR (vga only)"
190 eeepc_notify
"VGA" video-display
191 execute_commands
"${COMMANDS_XRANDR_VGA[@]}"
193 $EEEPC_XRANDR_LCD) # RandR (lcd only)
194 logger
"acpi-eeepc-generic-handler.sh (hotkey): RandR (lcd only)"
195 eeepc_notify
"LCD" video-display
196 execute_commands
"${COMMANDS_XRANDR_LCD[@]}"
198 $EEEPC_TASKMAN) # Task Manager
199 logger
"acpi-eeepc-generic-handler.sh (hotkey): Task Manager"
200 execute_commands_as_user
"${COMMANDS_TASKM[@]}"
202 $EEEPC_VOL_MUTE) # Mute
203 logger
"acpi-eeepc-generic-handler.sh (hotkey): Mute"
204 volume_level
=`get_volume`
207 eeepc_notify
"Mute ($volume_level%)" audio-volume-muted
209 eeepc_notify
"UnMute ($volume_level%)" audio-volume-medium
211 execute_commands
"${COMMANDS_MUTE[@]}"
213 $EEEPC_VOL_DOWN) # Volume Down
214 execute_commands
"${COMMANDS_VOLUME_DOWN[@]}"
216 volume_level
=`get_volume`
217 logger
"acpi-eeepc-generic-handler.sh (hotkey): Volume Down"
218 eeepc_notify
"Volume Down ($volume_level%)" audio-volume-low
220 $EEEPC_VOL_UP) # Volume Up
221 execute_commands
"${COMMANDS_VOLUME_UP[@]}"
223 volume_level
=`get_volume`
224 logger
"acpi-eeepc-generic-handler.sh (hotkey): Volume Up"
225 eeepc_notify
"Volume Up ($volume_level%)" audio-volume-high
227 # 00000052) # battery level critical
228 # logger "Battery is critical, suspending"
229 # $BATTERY_CRITICAL &
231 *) logger
"ACPI hotkey undefined: $2 $3 $4"
237 eeepc_notify
"ACPI group/action undefined: $1 $2 $3 $4"
238 logger
"ACPI group/action undefined: $1 $2 $3 $4"
242 #su $XUSER --login -c "xhost -"