From bd6fe43b4a0824f4e03f0db8d51298e6f3ecce14 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Mon, 22 Aug 2022 18:16:19 +0100 Subject: [PATCH] Add audio output controls to polybar --- home/vylpes/.config/i3/config | 3 +++ home/vylpes/.config/polybar/config.ini | 11 ++++++++++- home/vylpes/.scripts/audio/get-sink-name.sh | 11 +++++++++++ home/vylpes/.scripts/dwmblocks/battery.sh | 4 ---- 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 home/vylpes/.scripts/audio/get-sink-name.sh delete mode 100644 home/vylpes/.scripts/dwmblocks/battery.sh diff --git a/home/vylpes/.config/i3/config b/home/vylpes/.config/i3/config index 5f951d2..7c2cd43 100644 --- a/home/vylpes/.config/i3/config +++ b/home/vylpes/.config/i3/config @@ -73,6 +73,9 @@ bindsym $mod+Shift+o exec --no-startup-id "passmenu-otp -combi-modi window,drun, # .desktop file. It is a wrapper around dmenu, so you need that installed. # bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop +bindsym $mod+Shift+F11 exec --no-startup-id "pactl set-default-sink 3 && sh ~/.scripts/audio/get-sink-name.sh > ~/.cache/scripts/get-sink-name.txt" +bindsym $mod+Shift+F12 exec --no-startup-id "pactl set-default-sink 76 && sh ~/.scripts/audio/get-sink-name.sh > ~/.cache/scripts/get-sink-name.txt" + # change focus bindsym $mod+h focus left bindsym $mod+j focus down diff --git a/home/vylpes/.config/polybar/config.ini b/home/vylpes/.config/polybar/config.ini index 254fa96..6f43c95 100644 --- a/home/vylpes/.config/polybar/config.ini +++ b/home/vylpes/.config/polybar/config.ini @@ -52,7 +52,7 @@ font-0 = Hack;2 font-1 = Font Awesome modules-left = xworkspaces xwindow -modules-right = filesystem pulseaudio xkeyboard memory cpu eth date +modules-right = filesystem audiooutput pulseaudio xkeyboard memory cpu eth date cursor-click = pointer cursor-scroll = ns-resize @@ -113,6 +113,15 @@ label-volume = %percentage%% label-muted = muted label-muted-foreground = ${colors.disabled} +[module/audiooutput] +type = custom/script +exec = cat ~/.cache/scripts/get-sink-name.txt +interval = 1 +format =