I use my laptop primarly at home with an external monitor as discrete, meaning that I have the laptop monitor turned off and I only use it. At times this is also called a dedicated monitor. GNOME can be set to disable the laptop monitor and enable the external but it wasn’t able to hotplug the monitor after I returned the laptop, and at times wouldn’t do so after resuming from sleep. Also in the proccess I discovered that the X.org server DPI setting wasn’t being done correctly and that GNOME’s text scaling needed to be adjusted. So I decided to do it in a script and it turned out to be pretty easy.
I wrote the basic script that toggles monitors depending if the external monitor is present, then it detects correct physical size dimension of the screen so the the correct DPI can be set. After this, I added a startup script (.desktop file), a pm-utils script to runafter resuming, and a udev script to detect andset the monitor when plugged in. The udev rule is generic but appears to be working for a lot of people, it relys on Kernel Mode setting (KMS) so doesn’t work for me wiht the catalyst driver, but every thing else works great. I put it on github for any who like to look at it.
The bash script cannot be used right away instead a couple bit will need to be directed:
The package cannot be installed directly and be expected to work, some edits will need to be made. First, in the resume script '80_discretemon' a username will need to be defined; next, the monitor names will need to be defined as created by the driver in 'discretemon'.
Also, the monitors can be defined in
xorg.conf but the fix for after resume from sleep, remains.
Section "Monitor" Identifier "0-LVDS" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Acer Aspire Laptop Screen" Option "DPMS" "true" Option "TargetRefresh" "60" Option "Position" "0 0" Option "Rotate" "normal" Option "Disable" "true" DisplaySize 344 194 # only works with xrandr disabled. EndSection Section "Monitor" Identifier "0-DFP1" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Samsung SyncMaster SA350" Option "DPMS" "true" Option "PreferredMode" "1920x1080" Option "TargetRefresh" "60" Option "Position" "0 0" Option "Rotate" "normal" Option "Disable" "false" DisplaySize 476 268 # only works with xrandr disabled. Option "DPI" "102 x 102" EndSection