1

Kubuntu 14.04 LTS (3.16.0-45-generic)- KDE - Pulse Audio volume control - System settings > display settings.

Current in/outputs and system setup.

1st HDMI output to main PC screen.

2nd HDMI output available to a/v sound system & projector screen (have to switch audio to a/v with pulse audio controller, add in projector with display settings, display setting has to be made to have the HDMI actually output anything to the receiver)

What I have to do now: Prepare media, open display settings, add display(projector), open pulse audio controller, switch to hdmi source, play media.

What I want to do:

Open Terminal, type in $(alias)

display added, sound switched

$(aliasstop)

2nd display taken off, sound switched back

1 Answer 1

1

I would possibly write a short bash script to include both. You have to know your displays' and sinks' names prior to writing it.

To see your displays use xrandr -q command, to find your sinks use pacmd list-sinks command

The script

#!/bin/bash

function changes {
xrandr --output yourpcdisplay --same-as 2nddisplayname
pacmd set-default-sink "sinkname"
}
#xrandr will now mirror your displays, I guess that was the idea
#pacmd will set your default output sink as you name it

function reset {
xrandr --output 2nddisplayname --off
pacmd set-default-sink "sinkname"
}
#this time xrandr will switch off the second display

while [ 1 ]
do
echo "1 - make changes"
echo "2 - reset"
read -n1 answ
case $answ in
1) changes
   break
   ;;
2) reset
   break
   ;;
*) echo "not an option"
   break
esac
done

Now as you run the script, pressing 1 will make the desired changes and 2 will reset them. Run the script with its path or add it to $PATH environment variable. It's possible to create aliases too.

Hope this was even close to the solution you wanted.

NOTE changing the output sink via command line may only take effect if stream target device reading is disabled. It can be done by editing the corresponding line in /etc/pulse/default.pa to:

load-module module-stream-restore restore_device=false

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .