You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

35 lines
1.2KB

  1. {{ ansible_managed | comment }}
  2. #
  3. # /usr/lib/systemd/user/vncserver@.service
  4. #
  5. # 1. Switches for vncserver should be entered in ~/.vnc/config rather than
  6. # hard-coded into this unit file. See the vncserver(1) manpage.
  7. #
  8. # 2. Users wishing for the server to continue running after the owner logs
  9. # out MUST enable 'linger' with loginctl like this:
  10. # `loginctl enable-linger username`
  11. #
  12. # 3. The server can be enabled and started like this once configured:
  13. # `systemctl --user start vdesk@:<display>.service`
  14. # `systemctl --user enable vdesk@:<display>.service`
  15. [Unit]
  16. Description=vncserver service - display %i
  17. After=syslog.target network.target
  18. [Service]
  19. WorkingDirectory=%h
  20. Environment=DISPLAY=%i
  21. Environment=XAUTHORITY=%h/.Xauthority
  22. ExecStart=Xtigervnc $DISPLAY {{vncserver_options|replace('\n',' ')|trim}}
  23. ExecStartPost=fish -c "while not xdpyinfo > /dev/null 2> /dev/null; sleep 0.1; end"
  24. ExecStartPost=xrandr --output VNC-0 --primary
  25. ExecStartPost=systemctl --user import-environment DISPLAY XAUTHORITY
  26. ExecStartPost=fish -c "set -x XDG_SESSION_TYPE x11; systemctl --user import-environment XDG_SESSION_TYPE"
  27. ExecStartPost=systemctl --user restart dbus.service
  28. ExecStartPost=systemctl --user start xsession.target
  29. [Install]
  30. WantedBy=default.target