Ubuntu: Make persistent expanded screen preferences when using multiple monitors


I'm currently running Xubuntu 13.10 with the 3.12rc7 kernel on a Sony Vaio Pro 13 notebook. When I connect my LCD TV through HDMI nothing happens in first instance. Only when I go to my display settings (settings manager > display), select 'use this output' and 'Right of' (notebook screen - I want an expanded desktop rather than a clone), the TV screen gets activated.

My question: Is it possible to store this setting, so that when I plug in the HDMI cable the TV is automatically activated and set as secondary display / desktop extension? And when I plug out the cable, the secondary display is deactivated?


I managed to make the expanded display setting persistent by using the following xrandr command:

#!/bin/sh  xrandr --output HDMI1 --mode 1280x720 --pos 1920x0 --rotate normal --output DP1 --off --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off  

(My primary display has 1920x1080 resolution, my secondary display which is the one connected through HDMI has 1280x720)

But this does not automatically disactivate HDMI output when the HDMI cable is plugged out (which is a feature I wanted). Haven't found out how to do this yet.

However I also found out about the minimalistic xfce4 display settings dialog, which I didn't know before. This is appears to be useful for quick extending to another screen or deactivating it. It's invoked as follows:

xfce4-display-settings -m  

I found this command was already bound to shortcut (+p, same as in Windows). If that is not yet the case you can set this by going to Settings Manager > Keyboard > Application Shortcuts and assigning the shortcut there.

For me this is an equally satisfying solution.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »