Hotfix release available: 2024-02-06a "Kaos".
upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos".
upgrade now! [55] (what's this?)
headphones_insertion_handling
Differences
This shows you the differences between two versions of the page.
headphones_insertion_handling [2012/09/29 15:05] – created fly-away | headphones_insertion_handling [2012/11/17 00:44] (current) – fly-away | ||
---|---|---|---|
Line 6: | Line 6: | ||
sudo dpkg -i input-event-daemon_0.1.3-1_armhf.deb | sudo dpkg -i input-event-daemon_0.1.3-1_armhf.deb | ||
</ | </ | ||
+ | / | ||
+ | <file input-event-daemon.conf> | ||
+ | [Global] | ||
+ | listen = / | ||
+ | listen = / | ||
+ | listen = / | ||
+ | listen = / | ||
+ | |||
+ | [Keys] | ||
+ | POWER = systemctl suspend | ||
+ | #POWER = systemctl poweroff | ||
+ | #MUTE = amixer -q set Master mute | ||
+ | # | ||
+ | |||
+ | [Switches] | ||
+ | HEADPHONE_INSERT: | ||
+ | HEADPHONE_INSERT: | ||
+ | LID:1 = / | ||
+ | LID:0 = / | ||
+ | #LID:0 = DISPLAY=:0 XAUTHORITY=/ | ||
+ | #LID:1 = DISPLAY=:0 XAUTHORITY=/ | ||
+ | </ | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | [ x" | ||
+ | bfile=/ | ||
+ | curbr=$(cat $bfile) | ||
+ | brsave=/ | ||
+ | minbr=5 | ||
+ | |||
+ | case $1 in | ||
+ | on) | ||
+ | br=$(cat $brsave) | ||
+ | if (($br >= $minbr)) | ||
+ | then | ||
+ | echo -n $br > $bfile | ||
+ | else | ||
+ | echo -n $minbr > $bfile | ||
+ | fi | ||
+ | exit 0 | ||
+ | ;; | ||
+ | off) | ||
+ | echo $curbr > $brsave | ||
+ | echo 0 > $bfile | ||
+ | exit 0 | ||
+ | ;; | ||
+ | esac | ||
+ | let " | ||
+ | if (( 5 < $newbr && $newbr < 255 )) | ||
+ | then | ||
+ | echo -n $newbr > $bfile | ||
+ | fi | ||
+ | </ | ||
Done! Now you can put in you earphones and speakers will be switched off. | Done! Now you can put in you earphones and speakers will be switched off. | ||
- | See / | + | And you screen backlight should switch off when lid closed and restore when its open. |
headphones_insertion_handling.txt · Last modified: 2012/11/17 00:44 by fly-away