diff options
author | Guillermo Ramos | 2024-03-06 12:46:39 +0100 |
---|---|---|
committer | Guillermo Ramos | 2024-03-06 13:47:23 +0100 |
commit | bcd4636a8f1235ef9429599e04d294384572650e (patch) | |
tree | 80fbac488472e8a9e14d9ebc6310f77585a95fcb | |
parent | 7533fdb5ed76185176291e9d4ed7c3735d7a0a17 (diff) | |
download | cli-bcd4636a8f1235ef9429599e04d294384572650e.tar.gz |
ssf fix; cycle_pa_sinks
-rwxr-xr-x | cycle_pa_sinks | 14 | ||||
-rwxr-xr-x | ssf | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/cycle_pa_sinks b/cycle_pa_sinks new file mode 100755 index 0000000..a45ba15 --- /dev/null +++ b/cycle_pa_sinks @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Cycle between the current PulseAudio sinks. +# Based on https://askubuntu.com/a/740002 +# +# Usage: ./cycle_pa_sinks +################################################################################ + +new_sink=$(pacmd list-sinks | grep -E "index|device.product.name" | tee /dev/stdout | grep -m1 -A3 "* index" | tail -2) +new_sink_idx=$(echo "$new_sink" | head -n1 | cut -c12-) +new_sink_name=$(echo "$new_sink" | tail -n1 | cut -f2 -d'"') + +echo "Setting default sink to: #$new_sink_idx ($new_sink_name)"; +pacmd set-default-sink $new_sink_idx @@ -18,7 +18,7 @@ my @hosts; my $remote_session_name = $ENV{SSF_REMOTE_USER} || $ENV{USER}; -foreach my $cfgfile (glob "$ENV{HOME}/.ssh/config.d/*") { +foreach my $cfgfile (glob("$ENV{HOME}/.ssh/config.d/*"), "$ENV{HOME}/.ssh/config") { open(my $ssh_config, '<', $cfgfile) or die "nope"; my @line_hosts; while (my $line = <$ssh_config>) { |