From ec919b36f1f3d379c9fdb25be0eb162bcabc7311 Mon Sep 17 00:00:00 2001 From: nemo Date: Sat, 14 Jun 2025 12:26:49 +0200 Subject: [PATCH] set-sound-card next/prev --- set-sound-card | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/set-sound-card b/set-sound-card index c1ad599..8fbab59 100755 --- a/set-sound-card +++ b/set-sound-card @@ -1,5 +1,13 @@ #!/bin/bash -echo $(amixer scontrols | cut -d "'" -f2 | dmenu -l 10) > $XDG_CONFIG_HOME/sound_card +source /home/cptbb/dev/script/bashrc + +if [[ $1 == "next" ]]; then + echo $(amixer scontrols | cut -d "'" -f2 | grep -A1 $(cat $XDG_CONFIG_HOME/sound_card) | tail -n1) > $XDG_CONFIG_HOME/sound_card +elif [[ $1 == "prev" ]]; then + echo $(amixer scontrols | cut -d "'" -f2 | grep -B1 $(cat $XDG_CONFIG_HOME/sound_card) | head -n1) > $XDG_CONFIG_HOME/sound_card +else + echo $(amixer scontrols | cut -d "'" -f2 | dmenu -l 10) > $XDG_CONFIG_HOME/sound_card +fi statusbar.sh once