Files
pmaports-rtwo/device/community/device-nokia-n900/acpi_handler.sh
T
Sicelo A. Mhlongo 3044830032 device-nokia-n900: minor packaging improvements (for i3) (MR 6258)
1. dependencies useful for all X11 DEs/WMs moved to x11 subpackage
2. add dmenu-based power key menu with options for shutdown, reboot, and
    screenshot
3. handle power and screenlock keys using i3 directly, instead of acpi/evtest
4. add mouse key emulation via Shift+keyboard-keys

[ci:skip-build]: already built successfully in CI
2025-03-03 17:05:39 +01:00

68 lines
1.2 KiB
Bash

#!/bin/ash
user=$( getent passwd 10000 | cut -d: -f1 )
cmd=$( echo $0 | awk '{i=split($0,a,"/"); print a[i]}' )
function adjust_keypad_bl {
for i in $(seq 1 6); do
echo $1 > /sys/class/leds/lp5523\:kb$i/brightness
done
}
case $cmd in
KP_SLIDE_OPEN)
adjust_keypad_bl 63
su $user -c 'DISPLAY=:0.0 /usr/bin/xset dpms force on'
su $user -c 'DISPLAY=:0.0 /usr/bin/xinput enable "TSC2005 touchscreen"'
;;
KP_SLIDE_CLOSE)
adjust_keypad_bl 0
;;
CAM_BTN_DWN)
echo "Not implemented yet"
;;
CAM_BTN_UP)
echo "Not implemented yet"
;;
CAM_FOCUS_DWN)
echo "Not implemented yet"
;;
CAM_FOCUS_UP)
echo "Not implemented yet"
;;
CAM_LID_CLOSE)
echo "Not implemented yet"
;;
CAM_LID_OPEN)
echo "Not implemented yet"
;;
SCRNLCK_DWN)
echo "Not implemented yet"
;;
SCRNLCK_UP)
echo "Not implemented yet"
;;
HEADPHONE_INSERT)
alsactl restore -f /var/lib/alsa/asound.state.headset
;;
HEADPHONE_REMOVE)
alsactl restore -f /var/lib/alsa/asound.state.speakers
;;
MICROPHONE_INSERT)
echo "Not implemented yet"
;;
MICROPHONE_REMOVE)
echo "Not implemented yet"
;;
VIDEOOUT_INSERT)
echo "Not implemented yet"
;;
VIDEOOUT_REMOVE)
echo "Not implemented yet"
;;
*)
echo "Unknown event"
exit 1
;;
esac