quick change audio output 3

Well, I couldn't resist plugging away at this and I must say I'm pretty pleased with the results.

here's the full script:

#!/bin/bash

status="$(cat /sys/class/drm/card0-HDMI-A-1/status)"

if [ "${status}" = disconnected ]
then
pactl set-card-profile 0 output:analog-stereo+input:analog-stereo
notify-send -i /usr/share/icons/Mint-X/status/48/notification-audio-volume-high.png "Audio Output" "Laptop Speakers"
exit

elif [ "${status}" = connected ]
then
pactl set-card-profile 0 output:hdmi-stereo+input:analog-stereo
notify-send -i /usr/share/icons/Mint-X/status/48/notification-audio-volume-high.png "Audio Output" "HDMI"
exit
fi


Which I openly admit I got from the dude on that thread, but hey! it's simple enough that I like to think I'd've got there myself without too much trouble. And I've tarted up the notify-send statements so they look professional, with a wee volume icon and a standardised format. It looks smart.

It looks so smart that if I show it to anyone I don't think they'll understand that it's not a built-in system feature.

Comments

Popular posts from this blog

no sound in Papers Please

pdf to png/jpg/etc

To Do