aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>) {