aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/spotify.bash3
-rw-r--r--bash/spotify.profile9
2 files changed, 12 insertions, 0 deletions
diff --git a/bash/spotify.bash b/bash/spotify.bash
new file mode 100644
index 0000000..1593727
--- /dev/null
+++ b/bash/spotify.bash
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+[ -n "$SPOTIFY_SINK" ] && alias spotify="PULSE_SINK=$SPOTIFY_SINK spotify"
diff --git a/bash/spotify.profile b/bash/spotify.profile
new file mode 100644
index 0000000..33d0938
--- /dev/null
+++ b/bash/spotify.profile
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+SPOTIFY_OUTPUT_REGEX="BurrBrown"
+
+while read -r NUM NAME REST; do
+ [[ "$NAME" =~ $SPOTIFY_OUTPUT_REGEX ]] && SPOTIFY_SINK=$NUM
+done <<< "$(pactl list short sinks)"
+
+export SPOTIFY_SINK