aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2024-03-06 12:46:39 +0100
committerGuillermo Ramos2024-03-06 13:47:23 +0100
commitbcd4636a8f1235ef9429599e04d294384572650e (patch)
tree80fbac488472e8a9e14d9ebc6310f77585a95fcb
parent7533fdb5ed76185176291e9d4ed7c3735d7a0a17 (diff)
downloadcli-bcd4636a8f1235ef9429599e04d294384572650e.tar.gz
ssf fix; cycle_pa_sinks
-rwxr-xr-xcycle_pa_sinks14
-rwxr-xr-xssf2
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
diff --git a/ssf b/ssf
index a0d64d0..f10db57 100755
--- a/ssf
+++ b/ssf
@@ -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>) {