您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

vncserver.service.j2 1.2KB

4 年前
12345678910111213141516171819202122232425262728293031323334
  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=systemctl --user restart dbus.service
  27. ExecStartPost=systemctl --user start xsession.target
  28. ExecStartPost=fish -c "set -x XDG_SESSION_TYPE x11; systemctl --user import-environment XDG_SESSION_TYPE"
  29. [Install]
  30. WantedBy=default.target