Browse Source

Merge pull request 'vncserver-changes' (#1) from vncserver-changes into master

master
ka 2 years ago
parent
commit
e8d4d0e557
7 changed files with 37 additions and 11 deletions
  1. +8
    -2
      tasks/i3.yaml
  2. +1
    -1
      tasks/vnc.yaml
  3. +4
    -0
      templates/i3/i3.config.j2
  4. +13
    -0
      templates/i3/i3wm@.service.j2
  5. +5
    -5
      templates/vnc/vncserver@.service.j2
  6. +3
    -0
      templates/x11/xsession.reload.fish.j2
  7. +3
    -3
      vars/main.yaml

+ 8
- 2
tasks/i3.yaml View File

@@ -36,14 +36,20 @@
dest: ~/.config/i3blocks/config dest: ~/.config/i3blocks/config
notify: i3 reload notify: i3 reload


- name: i3wm graphical-session service
- name: i3wm graphical-session service for the default xsession
template: template:
src: i3/i3wm.service.j2 src: i3/i3wm.service.j2
dest: ~/.config/systemd/user/i3wm.service dest: ~/.config/systemd/user/i3wm.service
notify: systemd daemon-reload notify: systemd daemon-reload


- name: i3wm graphical-session service for specific displays
template:
src: i3/i3wm@.service.j2
dest: ~/.config/systemd/user/i3wm@.service
notify: systemd daemon-reload

- name: i3wm graphical-session service enabled - name: i3wm graphical-session service enabled
systemd: systemd:
name: i3wm.service
name: i3wm@.service
enabled: true enabled: true
scope: user scope: user

+ 1
- 1
tasks/vnc.yaml View File

@@ -14,6 +14,6 @@


- name: vncserver user service - name: vncserver user service
template: template:
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

+ 4
- 0
templates/i3/i3.config.j2 View File

@@ -352,6 +352,7 @@ for_window [class="^Pavu"] floating enable
for_window [class="^Paman$"] floating enable for_window [class="^Paman$"] floating enable
for_window [class="^Blueman"] floating enable for_window [class="^Blueman"] floating enable
for_window [class="^URxvt$" title="^tmux-workspace$"] border none for_window [class="^URxvt$" title="^tmux-workspace$"] border none
for_window [class="^zoom$" title="^zoom$"] floating enable


### assign apps to workspaces ### assign apps to workspaces
assign [class="^netzdrive$"] → netzdrive assign [class="^netzdrive$"] → netzdrive
@@ -359,6 +360,9 @@ assign [class="^TelegramDesktop$"] → tg
assign [class="^Signal$"] → signal assign [class="^Signal$"] → signal
assign [class="^Element$"] → matrix assign [class="^Element$"] → matrix
assign [class="^thunderbird$"] → mail assign [class="^thunderbird$"] → mail
assign [class="^zoom$" ] → zoom
assign [class="^Wfica_"] → citrix
assign [title="^Citrix maximized probe window$"] → citrix
# vncviewer workspaces # vncviewer workspaces
{% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %} {% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %}
{% set ws = workspaces[workspace] %} {% set ws = workspaces[workspace] %}


+ 13
- 0
templates/i3/i3wm@.service.j2 View File

@@ -0,0 +1,13 @@
[Unit]
Description=i3 Window Manager for Display %i
After=vncserver@%i.service

[Service]
Environment=DISPLAY=%i
Environment=XAUTHORITY=%h/.Xauthority%i
Type=exec
ExecStart=i3
ExecReload=i3-msg reload

[Install]
WantedBy=default.target

templates/vnc/vncserver.service.j2 → templates/vnc/vncserver@.service.j2 View File

@@ -21,14 +21,14 @@ After=syslog.target network.target
[Service] [Service]
WorkingDirectory=%h WorkingDirectory=%h
Environment=DISPLAY=%i Environment=DISPLAY=%i
Environment=XAUTHORITY=%h/.Xauthority
Environment=XAUTHORITY=%h/.Xauthority%i
ExecStart=Xtigervnc $DISPLAY {{vncserver_options|replace('\n',' ')|trim}} ExecStart=Xtigervnc $DISPLAY {{vncserver_options|replace('\n',' ')|trim}}
ExecStartPost=fish -c "while not xdpyinfo > /dev/null 2> /dev/null; sleep 0.1; end" ExecStartPost=fish -c "while not xdpyinfo > /dev/null 2> /dev/null; sleep 0.1; end"
ExecStartPost=xrandr --output VNC-0 --primary ExecStartPost=xrandr --output VNC-0 --primary
ExecStartPost=systemctl --user import-environment DISPLAY XAUTHORITY
ExecStartPost=fish -c "set -x XDG_SESSION_TYPE x11; systemctl --user import-environment XDG_SESSION_TYPE"
ExecStartPost=systemctl --user restart dbus.service
ExecStartPost=systemctl --user start xsession.target
#ExecStartPost=systemctl --user import-environment DISPLAY XAUTHORITY
#ExecStartPost=fish -c "set -x XDG_SESSION_TYPE x11; systemctl --user import-environment XDG_SESSION_TYPE"
#ExecStartPost=systemctl --user restart dbus.service
#ExecStartPost=systemctl --user start xsession.target


[Install] [Install]
WantedBy=default.target WantedBy=default.target

+ 3
- 0
templates/x11/xsession.reload.fish.j2 View File

@@ -37,3 +37,6 @@ xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display
{% for xhost in home_xhosts_allow %} {% for xhost in home_xhosts_allow %}
xhost +{{xhost}} xhost +{{xhost}}
{% endfor %} {% endfor %}

# disable bell
xset b off

+ 3
- 3
vars/main.yaml View File

@@ -1,4 +1,4 @@
i3_exec_command_prefix: systemd-run --user --scope --no-block #--slice-inherit
i3_exec_command_prefix: systemd-run --user --scope --no-block -E DISPLAY=$DISPLAY -E XDG_SESSION_TYPE=x11 #--slice-inherit


home_autostart_desktop_apps: home_autostart_desktop_apps:
- name: terminal - name: terminal
@@ -138,11 +138,11 @@ todo_i3block_socket: "{{todo_folder}}/i3block.sock"


vncserver_options: | vncserver_options: |
-desktop %H%i -desktop %H%i
-auth %h/.Xauthority
-auth %h/.Xauthority%i
-geometry {{home_vncserver_geometry}} -geometry {{home_vncserver_geometry}}
-depth 24 -depth 24
-rfbwait 30000 -rfbwait 30000
-rfbunixpath %h/.vnc/socket
-rfbunixpath %h/.vnc/socket%i
-nolisten tcp -nolisten tcp
-pn -pn
-localhost -localhost