aboutsummaryrefslogtreecommitdiff
path: root/sbin/devd/apple.conf
blob: 3084cd459fd45313fa8cda31864e4a22df90bea2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# $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 0";
};

notify 0 {
	match "system"		"PMU";
	match "subsystem"	"keys";
	match "type"		"volume";
	match "notify"		"down";
	action			"mixer vol -10";
};

notify 0 {
	match "system"		"PMU";
	match "subsystem"	"keys";
	match "type"		"volume";
	match "notify"		"up";
	action			"mixer vol +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";
};