Last active
August 29, 2015 14:02
-
-
Save ronihcohen/d2e07e0b2043845e6a94 to your computer and use it in GitHub Desktop.
Ubuntu toggle HDMI display + sound output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This shell script is PUBLIC DOMAIN. You may do whatever you want with it. | |
TOGGLE=$HOME/.toggle | |
if [ ! -e $TOGGLE ]; then | |
touch $TOGGLE | |
xrandr --output HDMI2 --auto --left-of VGA1 | |
pactl set-card-profile 0 output:hdmi-stereo-extra2 | |
else | |
rm $TOGGLE | |
xrandr --output HDMI2 --off | |
pactl set-card-profile 0 output:analog-stereo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment