@@ -6,24 +6,6 @@ | |||||
state: directory | state: directory | ||||
mode: 0700 | mode: 0700 | ||||
- name: vnc config | |||||
template: | |||||
src: vnc/config.j2 | |||||
dest: ~/.vnc/config | |||||
mode: 0644 | |||||
- name: vnc env | |||||
template: | |||||
src: vnc/vncserver.env.j2 | |||||
dest: ~/.vnc/vncserver.env | |||||
mode: 0644 | |||||
- name: vnc server config | |||||
template: | |||||
src: vnc/vnc.conf.j2 | |||||
dest: ~/.vnc/vnc.conf | |||||
mode: 0644 | |||||
- name: vnc passwd | - name: vnc passwd | ||||
copy: | copy: | ||||
content: "{{ lookup('pipe','pwgen 24 1' )}}" | content: "{{ lookup('pipe','pwgen 24 1' )}}" | ||||
@@ -54,15 +36,3 @@ | |||||
src: vnc/vncserver.service.j2 | src: vnc/vncserver.service.j2 | ||||
dest: ~/.config/systemd/user/vncserver@.service | dest: ~/.config/systemd/user/vncserver@.service | ||||
notify: systemd daemon-reload | notify: systemd daemon-reload | ||||
- name: Xvnc-session script | |||||
template: | |||||
src: vnc/Xvnc-session.j2 | |||||
dest: ~/.vnc/Xvnc-session | |||||
mode: 0755 | |||||
- name: vnc xsession script | |||||
template: | |||||
src: vnc/xsession.j2 | |||||
dest: ~/.vnc/xsession | |||||
mode: 0755 |
@@ -1,7 +0,0 @@ | |||||
#!/bin/sh | |||||
{{ansible_managed|comment}} | |||||
xrandr --output VNC-0 --primary | |||||
exec /etc/X11/Xsession ~/.vnc/xsession |
@@ -1 +0,0 @@ | |||||
{{ ansible_managed | comment }} |
@@ -1,4 +0,0 @@ | |||||
{{ ansible_managed | comment }} | |||||
$desktopName = "{{inventory_hostname}}$ENV{DISPLAY}"; | |||||
$geometry = "{{home_vncserver_geometry}}"; |
@@ -1,3 +0,0 @@ | |||||
{{ ansible_managed | comment }} | |||||
VNCSERVER_OPTIONS="{{vncserver_options|replace('\n',' ')|trim}}" |
@@ -19,10 +19,12 @@ Description=vncserver service - display %i | |||||
After=syslog.target network.target | After=syslog.target network.target | ||||
[Service] | [Service] | ||||
EnvironmentFile=%h/.vnc/vncserver.env | |||||
Type=forking | |||||
ExecStart=/usr/bin/vncserver -autokill %i $VNCSERVER_OPTIONS | |||||
ExecStop=/usr/bin/vncserver -kill %i | |||||
WorkingDirectory=%h | |||||
Environment=DISPLAY=%i | |||||
ExecStart=Xtigervnc $DISPLAY {{vncserver_options|replace('\n',' ')|trim}} | |||||
ExecStartPost=fish -c "while not xdpyinfo > /dev/null 2> /dev/null; sleep 0.1; end" | |||||
ExecStartPost=xrandr --output VNC-0 --primary | |||||
ExecStartPost=systemctl --user start xsession.target | |||||
[Install] | [Install] | ||||
WantedBy=default.target | WantedBy=default.target |
@@ -1,5 +0,0 @@ | |||||
#!/bin/sh | |||||
{{ansible_managed|comment}} | |||||
exec systemctl --user start --wait xsession.target |
@@ -7,5 +7,5 @@ exec systemctl --user start --wait xsession.target | |||||
{% else %} | {% else %} | ||||
systemctl --user start vncserver@:{{home_vncserver_display_number}}.service | systemctl --user start vncserver@:{{home_vncserver_display_number}}.service | ||||
i3 -c ~/.config/i3/null.config & | i3 -c ~/.config/i3/null.config & | ||||
exec xtigervncviewer localhost:{{home_vncserver_display_number}} -PasswordFile ~/.vnc/passwd -FullScreen=1 -Maximize=1 | |||||
exec xtigervncviewer ~/.vnc/socket -PasswordFile ~/.vnc/passwd -FullScreen=1 -Maximize=1 | |||||
{% endif %} | {% endif %} |
@@ -135,6 +135,17 @@ timer_folder: ~/.timer | |||||
timer_config: {} | timer_config: {} | ||||
vncserver_options: | | vncserver_options: | | ||||
-desktop %H%i | |||||
-auth %h/.Xauthority | |||||
-geometry {{home_vncserver_geometry}} | |||||
-depth 24 | |||||
-rfbwait 30000 | |||||
-rfbauth %h/.vnc/passwd | |||||
-rfbunixpath %h/.vnc/socket | |||||
-nolisten tcp | |||||
-pn | |||||
-localhost | |||||
-SecurityTypes VncAuth | |||||
{% if not home_vncserver_allow_resize %} | {% if not home_vncserver_allow_resize %} | ||||
-AcceptSetDesktopSize=0 | -AcceptSetDesktopSize=0 | ||||
{% endif %} | {% endif %} |