i3: Add active port to volume notif

This commit is contained in:
Sijmen 2018-11-26 12:30:04 +01:00
parent 6e4ffa9d03
commit 7da4c8f101

View file

@ -19,7 +19,20 @@ else if [ $argv[1] = '-d' ]
set icon ' '
end
set title "$icon Volume"
set name ( \
pactl list | \
grep -A1000 'Name: '(pactl info | grep '^Default Sink' | cut -d' ' -f 3-)'$' | \
grep -m1 'Active Port' | \
cut -d' ' -f 3- \
)
if [ $name = 'analog-output-speaker' ]
set name 'Speakers'
else if [ $name = 'analog-output-headphones' ]
set name 'Line-out'
end
set title "$icon Volume ($name)"
set file /tmp/notify-volume.id
set age (find "$file" -cmin -0.025)