summaryrefslogtreecommitdiffstats
path: root/.local/bin/swsnd
blob: 60feb1a172f07676ccd32cec17440d5b23eea5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/csh

set cmd = 'sysctl hw.snd.default_unit'

if ($#argv > 0) then
	$cmd=$1 >&/dev/null
else if (`$cmd | rev | cut -d ' ' -f 1` == 0) then
	$cmd=4 >&/dev/null
else
	$cmd=0 >&/dev/null
endif
exec herbe \
		 "Switched to `grep default /dev/sndstat | \
		sed -e 's/.*<\(.*\)>.*/\1/' | \
		sed -e 's/.*(\(.*\)).*/\1/'`"