From f5d56602df70950de6b7d40966b00c9939c81763 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 26 Jan 2020 17:16:07 +0100 Subject: Intial commit of v2 See https://drewdevault.com/2019/12/30/dotfiles.html --- bin/hibiki/soundswitch | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 bin/hibiki/soundswitch (limited to 'bin/hibiki/soundswitch') diff --git a/bin/hibiki/soundswitch b/bin/hibiki/soundswitch new file mode 100755 index 0000000..9ba73c9 --- /dev/null +++ b/bin/hibiki/soundswitch @@ -0,0 +1,41 @@ +#!/bin/sh +set -ex + +global= +focused= +profile= + +while getopts fgp: name; do + case $name in + g) global=1 ;; + f) focused=1 ;; + p) profile=1 ;; + ?) printf "usage: %s [-gf]\n" "$0" >&2; exit 2 ;; + esac +done + +if [ "$#" -lt 1 ]; then + printf "global\nfocused\nprofile\n" | menu | { + read -r line + case "${line}" in + global) exec "$0" -g ;; + focused) exec "$0" -f ;; + profile) exec "$0" -p ;; + esac + } +fi + +if [ -n "${global}" ]; then + pactl list short sinks | awk '{print $2}' | menu | xargs pactl set-default-sink + exit 0 +fi + +if [ -n "${focused}" ]; then + printf "not implemented\n" >&2 + exit 1 +fi + +if [ -n "${profile}" ]; then + printf "not implemented\n" >&2 + exit 1 +fi -- cgit 1.4.1