I am running a script that produces audio output, and I want to set different volume levels depending on whether headphones are plugged into my notebook or not.
My script already sets different volume levels, and I know that if something is plugged into audio-out, it are the headphones. It is also certain that the plugged/unplugged state will not change during the run-time of the script. So I really only need to know if something is plugged in or not when the script is started.
I am running Debian testing, and my kernel does not have CONFIG_SND_HDA_INPUT_JACK, but preferably the method would work for all *nix.