Changed dot-config to .config
This commit is contained in:
parent
9ea93f8144
commit
0ab0f24015
118 changed files with 29 additions and 980 deletions
43
misc/.local/bin/menu-wpio
Executable file
43
misc/.local/bin/menu-wpio
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/sh
|
||||
# Simple rofi script for changing default audio sink
|
||||
|
||||
audio_info="$(wpctl status \
|
||||
| awk '/Audio/,/Video/ {print}')"
|
||||
|
||||
case $1 in
|
||||
sink)
|
||||
section="$(echo "$audio_info" \
|
||||
| awk '/Sinks:/,/Sink endpoints:/ {print}')"
|
||||
;;
|
||||
source)
|
||||
section="$(echo "$audio_info" \
|
||||
| awk '/Sources:/,/Source endpoints:/ {print}')"
|
||||
;;
|
||||
*)
|
||||
echo "Aguments must be one of (sink|source)."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
devices_and_numbers="$(echo "$section" \
|
||||
| tail -n +2 | head -n -2 | cut -c 10-)"
|
||||
|
||||
devices="$(echo "$devices_and_numbers" \
|
||||
| awk -F'.' '{print $2}' \
|
||||
| awk -F'[' '{print $1}' \
|
||||
| cut -c 2-)"
|
||||
|
||||
lines="$(echo "$devices" | wc -l)"
|
||||
chosen="$(echo "$devices" | fuzzel -l $lines --dmenu -p "Select audio $1:" -i)"
|
||||
if [ -z "$chosen" ]; then
|
||||
# Exited without selecting
|
||||
exit
|
||||
fi
|
||||
|
||||
number="$(echo "$devices_and_numbers" \
|
||||
| grep "$chosen" \
|
||||
| awk '{print $1}' \
|
||||
| sed 's/\./ /')"
|
||||
|
||||
wpctl set-default $number
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue