From c3d8379045c72577a2284d3d1f75f191e3dee19c Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 29 Apr 2022 10:42:31 +0200 Subject: New script to change sound card --- .local/bin/swsnd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .local/bin/swsnd (limited to '.local') diff --git a/.local/bin/swsnd b/.local/bin/swsnd new file mode 100755 index 0000000..d64a034 --- /dev/null +++ b/.local/bin/swsnd @@ -0,0 +1,18 @@ +#!/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 notify-send \ + -u low \ + -t 2000 \ + 'swsnd' \ + "Switched to `grep default /dev/sndstat | \ + sed -e 's/.*<\(.*\)>.*/\1/' | \ + sed -e 's/.*(\(.*\)).*/\1/'`" -- cgit v1.2.3