sway: Project wiki example systemd user unit does not work

I have been trying to start sway as a systemd user unit using the example on the project wiki. Sway does not start at all.

  • ~/.config/systemd/user/sway.service:
[Unit]
Description=sway - SirCmpwn's Wayland window manager
Documentation=man:sway(5)
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.target

[Service]
Type=simple
ExecStart=/usr/bin/sway
  • Sway Version:
{
   "human_readable": "1.0",
   "variant": "sway",
   "major": 1,
   "minor": 0,
   "patch": 0,
   "loaded_config_file_name": "\/home\/$USER\/.config\/sway\/config"
 }
  • journalctl --user -u sway:
May 16 11:52:31 carbon-x1 systemd[963]: Started sway - SirCmpwn's Wayland window manager.
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/wayland/backend.c:199] Could not connect to remote display: No such file or directory
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/x11/backend.c:185] Failed to open X connection
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/session/logind.c:576] Session '893' isn't a graphical session (type: 'tty')
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/session/direct-ipc.c:35] Do not have CAP_SYS_ADMIN; cannot become DRM master
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/session/session.c:96] Failed to load session backend
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [wlroots-0.5.0/backend/backend.c:282] Failed to start a DRM session
May 16 11:52:31 carbon-x1 sway[27079]: 2019-05-16 11:52:31 - [sway-1.0/sway/server.c:46] Unable to create backend
May 16 11:52:31 carbon-x1 systemd[963]: sway.service: Main process exited, code=exited, status=1/FAILURE
May 16 11:52:31 carbon-x1 systemd[963]: sway.service: Failed with result 'exit-code'.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Isn’t there a “standard” env variable for this?

There is, check out this code.