1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2026-04-19 12:44:40 +03:00

Switch to clean PipeWire WirePlumber i3block

Old scripts were horrible hacks
This commit is contained in:
2024-03-27 18:40:24 +02:00
parent 9ce2930c6f
commit 16f7c0b069
7 changed files with 50 additions and 457 deletions

View File

@@ -1,19 +0,0 @@
#!/bin/sh
# src: https://codeberg.org/trill/dotfiles/src/branch/master/.local/bin/i3blocks/pipewire-sink.sh
# `pactl list sinks` shows sink properties with a mix of english language and local language
# defined by LANG env var, so we unset the var to guarantee only the fallback language is used
unset LANG;
sink_list="$(wpctl status | sed -n '/^Audio/,/Sink endpoints:/p' | sed -n '/Sinks:/,/|\s*$/p' | head -n -2 | tail -n +2 | tr -d '│')"
CONTENT="$sink_list"
OPTION_SELECTED=$(echo "$CONTENT" \
| rofi -dmenu -location 2 \
| sed -e 's/[^0-9]*\([0-9]*\).*/\1/g')
echo ""
if ! [[ -z "$OPTION_SELECTED" ]]; then
wpctl set-default "$OPTION_SELECTED"
fi

View File

@@ -1,11 +0,0 @@
#!/bin/bash
SELECTED=$(pactl list short sinks |\
awk '{print $1 " " $2 " " $7}' |\
column -t |\
sort -k3 -r |\
rofi -dmenu -i |\
awk '{print $2}'
)
echo $SELECTED
pactl set-default-sink $SELECTED