5

One can change displays in Xfce (in 14.04) from GUI by choosing between:

Laptop
Mirror Displays
Extend to the Right
Monitor

Is there a command to cycle between these options?

(So that I associate it to a shortkey and then just press that key to cycle displays directly, that is, without GUI, without opening the Display window, selecting, closing, etc.)

3 Answers 3

5

I have found here about Disper. See link for details.

It can be installed from Synaptic or the terminal.

The command to cycle between clone, extended, internal and external displays should be like this:

disper --cycle-stages='-e : -c : -S : -s' --cycle

In that case, it would extend to the right. To cycle between the same options but extend to the left:

disper --direction=left --cycle-stages='-e : -c : -S : -s' --cycle

The command can be then associated to a short-key.

enter image description here

The simplest shortkey might be the Display key (XF86Display) if there is one available on the keyboard. (Because of a bug, in my case that involves an interference with the Super key, so that I prefer to use XF86HomePage.)

Disper will detect displays and use the maximal resolutions by default. If no external display is connected, nothing will happen when the short-key is touched.

2

Setting a new keyboard shortcut is possible (in Settings -> Keyboard -> Application shortcuts), but finding the right terminal command...

xrandr can change the resolution, I know it works if you're using one monitor, it's man page could have more info on what you'd like to do, other answers advise using it...? Here's a clip from it's man page:

--left-of, --right-of, --above, --below, --same-as another-output
Use one of these options to position the output relative to the position of another output. This allows convenient tiling of outputs within the screen. The position is always computed relative to the new position of the other output, so it is not valid to say --output a --left-of b --output b --left-of a.

--off Disables the output.

--reflect reflection
Reflection can be one of 'normal' 'x', 'y' or 'xy'. This causes the output contents to be reflected across the specified axes.

Searching for the "display" program, with dpkg -S display then searching that for xfce found the .desktop file /usr/share/applications/xfce-display-settings.desktop, and it's target xfce4-settings: /usr/bin/xfce4-display-settings. It has a very basic man page, but a search on this site found:

0

enter image description here

You can also use the keyboard arrows left and right to cycle through the options (in screenshot I've selected the right-most option) and then use enter to activate the desired option.

4
  • 1
    that is obvious. i was looking for a shortkey associated to one single command that would cycle display without opening a GUI etc
    – user47206
    Feb 1, 2015 at 22:14
  • I see. Perhaps you can make this more clear in the question...
    – landroni
    Feb 1, 2015 at 22:19
  • did that now, i hope it is clearer
    – user47206
    Feb 2, 2015 at 10:18
  • 2
    In case anyone wonders, the command to display the visual mode selector as depicted in this answer is xfce4-display-settings --minimal. This command is by default assigned to CTRL+ALT+P but can be assigned to a key combination of your choice (in Keyboard Settings->Application Shortcuts) to show the mode selector. Pressing the key combination (thus executing the command) a second time will not cycle through the modes (as it is the case in Windows). You will have to use a mouse or arrow keys to pick the desired mode.
    – brett
    Aug 17, 2019 at 16:51

You must log in to answer this question.