Display Settings

When I'm working at my desk, my laptop sits in a docking station with a dual monitor configuration.  However, I often work undocked, or work with a projector attached (i.e. in a meeting). When I return my laptop to the dock, I have to re-configure my monitor configuration. It is not a difficult task, involving only about half a dozen clicks, and taking only about 20 seconds. Right click on the desktop, select properties, adjust monitor 1 size, click monitor 2, click "Extend the desktop", click OK. It is not difficult, but it is annoying.

So I did what any able-bodied developer would do; I wrote a utility to make things easier for me: dispsetc.exe

With this utility, you can save your display settings configuration to a snapshot, and restore your display settings from a snapshot.

Here are the options:

dispsetc.exe - Display Settings Console

usage: dispsetc.exe -s|-r|-p|-l [name]
name -- name of the configuration. If not supplied the name 'default' is used.
-s[ave] [name] -- save the current settings.
-r[estore] [name] -- restore display settings from a saved configuration.
-p[rint] [name] -- print display settings; if name is not provided, current settings are displayed (not 'default').
-l[ist] -- list all saved display setting configurations.

To use the utility, you first configure you display settings to a point you'd like to keep. Then run the utility with the -s argument:

dispsetc -s my-config-name

When you want to restore your configuration, run the utility with the -r argument:

dispsetc -r my-config-name

If you want to see the display settings stored in a configuration, run the utility with the -p argument:

dispsetc -p my-config-name

I personally have configurations for single monitors in (1400x900), (1280x1024) and (1024x768); and for dual monitors in (1400x900; 1280x1024) and (1280x1024,1280x1024).

There is one problem I've run into with this code - when I'm displaying a single screen simultaneously on both the built-in screen, and an external screen (i.e. projector), the utility fails to change the configuration.

AttachmentSize
dispsetc.zip91.13 KB
DisplaySettingsSource.zip200.06 KB