Quick xrandr script
Just wanted to write down that I created a quick method for a coworker to fix her monitors when she docked her laptop. The problem was that XFCE (she’s using Xubuntu 16.04) wasn’t remembering the monitor’s settings. When she docked the laptop, she had to manually put things back using the GUI for monitor settings. I wrote a quick script something like this:
#!/bin/bash
xrandr --output <monitor 1> --auto
xrandr --output <monitor 2> --auto
xrandr --output <monitor 3> --auto
xrandr --output <monitor 2> --right-of <monitor 1> --output <monitor 3> --right-of <monitor 2>
The xrandr -q
. I did find that without running the –auto lines FIRST, nothing else took. xrandr man page and examples made it seem like I could do one single command and have everything work. But in this case, one single command made everything break instead.
I then just added a button to her menu that she can click. If I could hijack the signal somehow of when the computer was docked I could do that, rather than have XFCE pop up a “what do you wanna do with these monitors?” dialogue. But it is what it is. She no longer dreads having to undock and go to a meeting.