From fa5bd2747349dbaf3b3dfed3e1162cac84807cfc Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 10 Jan 2021 02:26:21 +0100 Subject: [PATCH] rename vdesk service to vncserver service --- tasks/clean.yaml | 13 +++++++++++++ tasks/main.yaml | 7 +++---- tasks/vdesk.yaml | 7 ------- tasks/vnc.yaml | 12 ++++++++++++ tasks/x11.yaml | 2 +- .../vdesk.service.j2 => vnc/vncserver.service.j2} | 2 +- 6 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 tasks/vdesk.yaml rename templates/{vdesk/vdesk.service.j2 => vnc/vncserver.service.j2} (91%) diff --git a/tasks/clean.yaml b/tasks/clean.yaml index 41b1ce6..e779825 100644 --- a/tasks/clean.yaml +++ b/tasks/clean.yaml @@ -24,3 +24,16 @@ state: stopped enabled: false scope: user + +- name: disable and stop vdesk user service at display 47 + systemd: + name: vdesk@:47.service + state: stopped + enabled: false + scope: user + +- name: remove vdesk user service + file: + path: ~/.config/systemd/user/vdesk@.service + state: absent + notify: systemd daemon-reload diff --git a/tasks/main.yaml b/tasks/main.yaml index 768b6e9..3d48f92 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -4,7 +4,6 @@ - import_tasks: structure.yaml - import_tasks: ssh.yaml -- import_tasks: vnc.yaml - import_tasks: tmux.yaml - import_tasks: pulseaudio.yaml - import_tasks: git.yaml @@ -19,15 +18,15 @@ - import_tasks: background.yaml - import_tasks: rofi.yaml - import_tasks: x11.yaml - - import_tasks: vdesk.yaml + - import_tasks: vnc.yaml when: home_desktop - name: flush handlers meta: flush_handlers -- name: enable and start vdesk user service +- name: enable and start vncserver user service systemd: - name: vdesk@:{{home_vdesk_display_number}}.service + name: vncserver@:{{home_vdesk_display_number}}.service state: started enabled: true scope: user diff --git a/tasks/vdesk.yaml b/tasks/vdesk.yaml deleted file mode 100644 index 0ffb6d4..0000000 --- a/tasks/vdesk.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: vdesk user service - template: - src: vdesk/vdesk.service.j2 - dest: ~/.config/systemd/user/vdesk@.service - notify: systemd daemon-reload diff --git a/tasks/vnc.yaml b/tasks/vnc.yaml index 487c171..072b42f 100644 --- a/tasks/vnc.yaml +++ b/tasks/vnc.yaml @@ -30,3 +30,15 @@ src: vnc/default.tigervnc.j2 dest: ~/.vnc/default.tigervnc mode: 0755 + +- name: vncserver user service + template: + src: vnc/vncserver.service.j2 + dest: ~/.config/systemd/user/vncserver@.service + notify: systemd daemon-reload + +- name: Xvnc-session script + template: + src: x11/xsessionrc.j2 + dest: ~/.vnc/Xvnc-session + mode: 0755 diff --git a/tasks/x11.yaml b/tasks/x11.yaml index 82f5094..909c494 100644 --- a/tasks/x11.yaml +++ b/tasks/x11.yaml @@ -22,7 +22,7 @@ dest: ~/.xsession.reload.fish mode: 0755 -- name: xsessionrc +- name: xsessionrc script template: src: x11/xsessionrc.j2 dest: ~/.xsessionrc diff --git a/templates/vdesk/vdesk.service.j2 b/templates/vnc/vncserver.service.j2 similarity index 91% rename from templates/vdesk/vdesk.service.j2 rename to templates/vnc/vncserver.service.j2 index 0cf84f9..a9083c1 100644 --- a/templates/vdesk/vdesk.service.j2 +++ b/templates/vnc/vncserver.service.j2 @@ -21,7 +21,7 @@ After=syslog.target network.target [Service] Type=forking ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' -ExecStart=/usr/bin/fish -c "/usr/bin/vncserver -xstartup ~/.xsession.fish %i" +ExecStart=/usr/bin/fish -c "/usr/bin/vncserver %i" ExecStop=/usr/bin/vncserver -kill %i [Install]