Aug 18
虽然安装了acpi-support,但我的笔记本依然不能启用静音切换的快捷键,很不方便,于是自己写了个切换静音小脚本。至于调节音量,类推就行了。
# /etc/acpi/events/mutebtn # Called when the user presses the mute button event=button[ /]mute action=/etc/acpi/mute.sh
#!/bin/sh # /etc/acpi/mute.sh vol=`amixer | sed -r "s/(\[|\])//g" | sed -rn "/'Master'/,+6{h;/Playback.*%/{p;q}}" | awk '{print $5}'` if test $vol != 0%; then echo $vol > /etc/acpi/volstore.dat amixer set Master front 0 else vol=`cat /etc/acpi/volstore.dat` amixer set Master front $vol fi exit 0