Repositories: displayset.


displayset is being used on one computer, but it seems to work fine.

Notebook dock and undock

displayset is designed to solve a particular problem on the author's work laptop, a Lenovo Thinkpad X201:

  • The X201 docks via a media slice to which two 4:3 1600x1200 LCD monitors are connected.
  • Xubuntu 12.04 does not automatically shift display configuration on dock and undock events. Ubuntu 11.10 running Gnome classic shell almost did it right...
  • The laptop has a 12 inch widescreen with 1280x800 resolution, so when using the LCD panel, maximizing non-dialog windows and dispensing with their title bars offers better usability and more effective use of screen real estate.
  • When docked and using the dual external displays, the traditional windows manager behavior is more appropriate.

How it works (with XFCE)

The displayset script is called from keyboard shortcuts, which are added under the Settings Manager. I use <super>l (lowercase L) to switch to the LCD panel and <super>d to switch to the dual external monitors. Each key combination calls the displayset utility, with a different argument in each case:

  • For LCD panel: displayset lcd
  • For dual external monitors: displayset dualext


displayset requires xrandr, wmctrl and maximus installed. For Xubuntu 12.04, the following command will do the job, although the x11-xserver-utils package is probably already installed.

sudo apt-get install x11-xserver-utils wmctrl maximus

To install displayset, simply copy the script to /usr/local/bin, or somewhere else in the path, and make it executable. This would do:

sudo cp displayset /usr/local/bin/
sudo chmod 0755 /usr/local/bin/displayset

To map the keys to call displayset, run the XFCE Settings Manager, click on the Keyboard icon, then select the Application Shortcuts tab.

How to use

To undock

There are a lot of variations on this use case. Typically when I undock, the notebook is currently active and I want it to be suspended after undock.

  • Physically undock the notebook. For the media slice, this means pressing the undock button, waiting for the red triangle to go green, then using the lever to release the notebook from the slice.
  • Open and close the lid to signal a suspend event to the notebook.
  • Later, when the lid is opened to wake the notebook,
  • Type in the screensaver password (if enabled). The display will not be active at this time.
  • Press <super>l to switch the display to the LCD panel.

To dock

There are variations to this use case as well, but generally this author finds the notebook last using the LCD panel and suspended when docking. Therefore:

  • Physically dock the notebook into the media slice.
  • Wake the notebook from suspend by pressing the power button on the front of the slice. Wait a few seconds for the notebook to unsuspend.
  • Type in the screensaver password (if enabled). The display will not be active at this time.
  • Press <super>d to switch the dual external monitors.

More information can be gleaned directly from the project's README file.