freebsd-dev/sbin/devd/apple.conf
Kyle Evans 4014365e42 mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted
as a percent until you slap a decimal on it and magically it becomes an
absolute value.

Let's have a flag day in 14.0 and remove this shim entirely.  Setting with
percent can still be useful, so allow a trailing '%' to indicate as such.
As a side effect, we tighten down the format allowed in the volume a little
bit by ensuring there's no trailing garbage after the value once it's
separated into left and right components.

Reviewed by:	christos, hselasky, pauamma_gundo.com (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35101
2022-06-17 22:50:58 -05:00

81 lines
1.6 KiB
Plaintext

# $FreeBSD$
#
# PowerPC Apple specific devd events
# Keyboard power key
notify 0 {
match "system" "PMU";
match "subsystem" "Button";
action "shutdown -p now";
};
# PowerBook and iBook lid close.
notify 0 {
match "system" "PMU";
match "subsystem" "lid";
match "type" "close";
action "shutdown -p now";
};
# The next blocks enable brightness hotkeys that can be found on Apple laptops
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "brightness";
match "notify" "down";
action "sysctl dev.backlight.0.level=\
$(expr `sysctl -n dev.backlight.0.level` - 10)";
};
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "brightness";
match "notify" "up";
action "sysctl dev.backlight.0.level=\
$(expr `sysctl -n dev.backlight.0.level` + 10)";
};
# The next blocks enable volume hotkeys that can be found on Apple laptops
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "mute";
action "mixer vol.mute=^";
};
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "volume";
match "notify" "down";
action "mixer vol.volume=-10%";
};
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "volume";
match "notify" "up";
action "mixer vol.volume=+10%";
};
# Eject key
notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "eject";
action "camcontrol eject cd0";
};
# Equivalent to the ACPI/ACAD notify
notify 10 {
match "system" "PMU";
match "subsystem" "POWER";
match "type" "ACLINE";
action "service power_profile $notify";
};