3

I'm trying to start cheese such that it runs on a specific head on a multi-head display setup. The application options include a --display=DISPLAY setting:

$ cheese --help
Usage:
  cheese [OPTION...]

...
Application Options:
  -w, --wide               Start in wide mode
  -d, --device=DEVICE      Device to use as a camera
  -v, --version            Output version information and exit
  -f, --fullscreen         Start in fullscreen mode
  --display=DISPLAY        X display to use

I'm thinking that I can set the head with something like --display=:0.1, however only ":0" allows the app to start (on the wrong head).

What argument parameter would force this to start on another head / display on the same workstation?

2
  • The only way may be saving the preferences/current setup/location of the x position, and it is highly depend on the desktop environment you are using, and if it offers support for it. Commented May 6, 2016 at 23:52
  • --display only sets the display. Multiple heads of the same display are still the same display. Commented May 7, 2016 at 19:09

1 Answer 1

4

The syntax :0.NUMBER specifies a screen number on display 0. The concept of screen was intended to describe multiple monitors on the same display, but an application can't be moved from one display to another, so it's been pretty much abandoned. Your monitors are all on screen 0, i.e. :0.0, which is equivalent to :0 since the only screen is the default screen.

All the monitors are placed on a rectangular canvas. In a two-monitor configuration, one monitor has its top left corner at position 0x0 and the other has its top left corner at position 0xH (vertical arrangement) or Wx0 (horizontal arrangement) where WxH is the size of the first monitor.

Well-behaved application take an option -geometry or --geometry that allows the user to specify the position and size of the application's main window. For example, with two 1600x1200 monitors in a horizontal arrangement, xterm -geometry +1600+0 launches xterm at the top left of the right-hand monitor. Unfortunately Cheese is not well-behaved¹.

If you always want to run the application at a specific position, you can use Devil's Pie to make it reposition the window when it's created. With devilspie2, create a file ~/.config/devilspie2/cheese-geometry.lua containing

if (get_application_name() == "Cheese" and get_window_name() == "Cheese") then
  set_window_position(1600, 0);
end

With the original Devil's Pie, create a file ~/.devilspie/cheese-geometry.ds containing

(if (and (is (application_name) “Cheese”) (is (window_name) “Cheese”))
    (geometry "+100+1"))

Note that your window manager may override the position — the window manager has final say when positioning windows. If your window manager overrides the position, hopefully it has a way to configure it.

¹ It's a GNOME application. GNOME believes in removing any ability for users to choose how programs behave.

2
  • I appreciate the details here regarding DISPLAY. I had always had in the back of my mind that that should work, but I never knew precisely why it wasn't working and so that's appreciated.
    – ylluminate
    Commented May 8, 2016 at 2:20
  • +1 if only for your note about GNOME - TRUE!
    – Richard T
    Commented Sep 15, 2023 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .