Skip to content

Allow using launcher-direct on non-default seat with non-root user

Pekka Paalanen requested to merge pq/weston:mr/direct-nonroot into master

I have long been against launcher-direct, trying to eradicate any reason it might have to exist over the past years, because I think having three different components doing the same thing is just silly and a maintenance burden. Recently I learnt that I simply can't do what I want with logind: [systemd-devel] Logind: how to access a device when you're not the session controller. Apparently the maintenance burden is also minimal.

So here is a MR to make launcher-direct more useful for developer testing.

How to run Weston/DRM simultaneously with your normal desktop

You need:

  • an extra graphics card in your machine
  • some extra input devices, like a keyboard and a mouse (optional)
  • this MR
  • a udev rules file

Steps:

  1. Use the udev rules file to assign the extra graphics card and the input devices to a new seat. I named the seat seat-insecure because these devices will be insecure as my normal user needs to be able to open them. So never type your passwords on that keyboard. Here is the rules file I used.

/etc/udev/rules.d/63-insecure-seat.rules:

ACTION=="remove", GOTO="id_insecure_seat_end"

SUBSYSTEM=="drm", KERNEL=="card*", KERNELS=="0000:01:00.0", ENV{ID_SEAT}="seat-insecure"

# ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c01e", OWNER="pq", ENV{ID_SEAT}="seat-insecure"

# ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c312", OWNER="pq", ENV{ID_SEAT}="seat-insecure"

LABEL="id_insecure_seat_end"
  1. Run your normal desktop as usual. The seat assignment in the udev rules makes it so that your normal desktop will ignore all those devices. Make sure they are really ignored.

  2. Open your terminal window, and start weston as your normal user:

$ weston -Bdrm-backend.so --seat=seat-insecure

If all goes well, you will have your normal desktop running fine, and Weston running a terminal window (where you can e.g. Ctrl+c it) with the DRM-backend using your extra devices. It's almost like multi-seat.

Note: Weston is not a separate session, it's just a bunch of processes on the same user as your normal desktop. That might have weird effects with some apps. As a display server developer, you knew that already.

Merge request reports