blob: ecd1aa7455bde28ef101202d7aec967f2e441ba5 (
plain)
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
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: aird
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
# enable aird:
# aird_enable (bool): Set to "NO" by default.
# aird_key: Unset by default; see man page on pairing.
#
# The following options have defaults sane for musicpd, they can be reassigned
# in /etc/rc.conf
#
# aird_play, aird_forward, aird_up, aird_down, aird_back, aird_menu
. /etc/rc.subr
name="aird"
rcvar=aird_enable
load_rc_config $name
: ${aird_enable="NO"}
: ${aird_play="%%PREFIX%%/bin/mpc toggle"}
: ${aird_forward="%%PREFIX%%/bin/mpc next"}
: ${aird_up="/usr/sbin/mixer vol +2"}
: ${aird_down="/usr/sbin/mixer vol -2"}
: ${aird_back="%%PREFIX%%/bin/mpc prev"}
: ${aird_menu="%%PREFIX%%/bin/xterm -e ncmpc"}
aird_key="${aird_key:+-k ${aird_key}}"
command="%%PREFIX%%/bin/aird"
pidfile="/var/run/aird.pid"
command_args="-p ${pidfile} -f /dev/uhid1 ${aird_key}\
-P \"${aird_play}\" \
-F \"${aird_forward}\" \
-U \"${aird_up}\" \
-D \"${aird_down}\" \
-B \"${aird_back}\" \
-M \"${aird_menu}\""
run_rc_command "$1"
|