title: Automatically detect when HDMI is plugged in
body: <p>Sometimes I connect my laptop to my TV over HDMI to have a bigger screen. Unfortunately, it doesn't automatically switch the audio output, so I have to do that myself every single time I plug or unplug it, with either of those two, to have the sound come from where I want it to come from.</p>
  
  <ul>
  <li><code>pacmd set-card-profile 0 output:hdmi-stereo-extra1</code></li>
  <li><code>pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo</code></li>
  </ul>
  
  <p>Is there any way to detect if HDMI is plugged in, or at least if a change has occurred? Thanks!</p>
  
  <p>Linux Mint 18.2 Xfce x64, Asus P756U</p>