!7 cmodule AudioAdjuster > DynPrintLogAndEnabled { transient S goodMic = "USB PnP Audio Device Analog Stereo"; transient S headphones = "Bluedio"; transient S internal = "HD-Audio Generic Analog Stereo"; start { doEvery(10.0, r check); } void check enter { if (!enabled) ret; Map sinks = dm_systemAudioSinkNames(); bool haveGoodMic = cicValue(sinks, goodMic); bool haveHeadphones = cicValue(sinks, headphones); S defaultSink = haveHeadphones ? headphones : internal; dm_pulseAudio_setDefaultSinkAndSwitchAllClients(defaultSink); } }