mirror of
https://github.com/imgurbot12/rmenu.git
synced 2024-11-14 05:13:48 +01:00
18 lines
590 B
Bash
Executable File
18 lines
590 B
Bash
Executable File
#!/bin/sh
|
|
|
|
get_sinks() {
|
|
sinks=`pactl list sinks | grep -e 'Sink' -e 'Name' -e 'Description' | nl -s '>'`
|
|
default=`pactl get-default-sink`
|
|
for i in `seq 1 3 $(echo "$sinks" | wc -l)`; do
|
|
sink=`echo "$sinks" | grep "$i>" | cut -d '#' -f2`
|
|
name=`echo "$sinks" | grep "$(expr $i + 1)>" | cut -d ':' -f2 | xargs echo -n`
|
|
desc=`echo "$sinks" | grep "$(expr $i + 2)>" | cut -d ':' -f2 | xargs echo -n`
|
|
if [ "$name" = "$default" ]; then
|
|
desc="* $desc"
|
|
fi
|
|
rmenu-build entry -n "$desc" -a "`rmenu-build action "pactl set-default-sink $sink"`"
|
|
done
|
|
}
|
|
|
|
get_sinks
|