i3: Add active port to volume notif
This commit is contained in:
parent
6e4ffa9d03
commit
7da4c8f101
1 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue