My Ubuntu laptop gets docked into a few different locations per day with different hardware and use cases. I'd like to automate the preference settings for each of these locations:
- Work computer, dual head 1280x1024
External USB audio and bluetooth audio
- Home computer, dual head 1280x1024, 1080p
External USB audio
Basically, when I dock the box in either (1) or (2), I want to automagically get the right xrandr settings for the different screen geometries and the right audio routing.
What scripts, etc. are responsible for the inscrutable default behavior?
Are there packages for customizing this?
If I wanted to roll my own, what is the right library to use to catch the hotplug events?