I'm sure I'm not the only one in this situation: I run Ubuntu 16 on my laptop, and I use that to connect to my workstation in the office.
Now there are a couple things that I have to do every day when I connect to my workstation, such as fixing my bluetooth mouse speed, setting the right resolution for both screens and restoring my wallpaper with nitrogen. For each of these tasks I have a (startup) script which works fine, but when I connect my second screen, the laptop is already booted.
So my question is, next to start-up applications, how could I (i.e.) run
nitrogen --restore and scale down the resolution on my laptop (from 2560×1600 to 1440×900) when I connect the second screen?
What I do now is run all seperate scripts again manually, which isn't a big deal, but we don't use Ubuntu to just accept how it is, right? 😉
To clarify; my question isn't too specific for these tasks, but more in a general sense; how could I fire anything from the terminal on specific actions like "input of display detected"?