In a terminal, enter: monitor udevadm
Afterwards, try plugging/unplugging your HDMI cable. I get some output about drm/card0. What does yours say? My laptop only has Intel HD 3000 graphics, so if you have another graphics card onboard, maybe that’s why it isn’t working? Also, you could try searching in /sys for anything related to “HDMI”. For me, /sys/class/drm/card0-HDMI-A-1 is only a link to some other, longer directory. Again, I only have Intel graphics on my laptop so I’m unsure of other scenarios. Hope you figure it out!

When you plug/unplug your hdmi cable, does the /proc/asound/HDMI/pcm3p/sub0/status change from “connected” to “disconnected”? If so, then you probably need to change the HDMI_STATUS line to HDMI_STATUS="$(cat /proc/asound/HDMI/pcm3p/sub0/status)". Also, your udev rule will be different. What’s the output of udevadm monitor when you plug/unplug your hdmi cable?

Yeah, the status changes. However, I’m not getting any output from “udevadm monitor”…It tells me
“monitor will print the received events for:
UDEV – the event which udev sends out after rule processing
KERNEL – the kernel uevent”
and then sits there with a blinking cursor. Somehow I’m not triggering any events.

(I believe) “udevadm monitor” should show changes in the hardware of your system. For instance, if you plug in a USB flash drive, change the brighness, and so forth, then these changes should be printed in the terminal (under the header you quoted). But if plugging in your HDMI cable doesn’t produce any output, then I don’t know what else you could do; the setup for the sound toggle uses udev to detect the changes and if it isn’t being picked up, it won’t run the script.

Just set up this script on my Acer Aspire running Ubuntu 12.10 and it seems to work just fine. Tested it briefly last night, taking it into the classroom today. Great solution to an annoying problem Charles, thanks!

not exactly sure what your script is supposed to do, when i use it it lets me know that i plugged the hdmi in and switches to it correctly, but if i unplug it then i have no sound and your script doesnt seem to make it switch back. your older script worked better atleast until a reboot. the whole alt f2 and typing in killall pulse still doesnt make this an auto toggle at all….

Maybe you could update your script with the “killall pulsaudio” command and post that up, I’ve tried implementing it in both of your scripts and it doesnt work and nobody seems to be able to help me out with this.

So Even after completely reinstalling this damn distro and using youre script it doesnt work, at all it extends my desktop, and when i close the lid on my laptop the gnome bars dissappear, the sound doesnt switch at all, if you’re going to post up instructions, you need to include your particular drivers and chipsets and everything else involved cause im so damn pissed right now im about to toss my fucking laptop…………. This shit should work outta the box …. period…. windows does this on the fly.

So After i played around with all kinds of settings i finally got it working. please the next time you post up some instructions, assume anyone whos reading is like 5 alright, you didnt say anything about mirroring displays then disabling the laptop display, or anything.