From 72ac97cb9ab54a9dc11451c9ea937f28c1d4258c Mon Sep 17 00:00:00 2001 From: Markus K Brechtel Date: Sat, 30 Jul 2022 00:19:10 +0200 Subject: [PATCH 1/5] improve vncserver call --- tasks/i3.yaml | 10 ++++++++-- tasks/vnc.yaml | 2 +- templates/i3/i3wm@.service.j2 | 13 +++++++++++++ .../{vncserver.service.j2 => vncserver@.service.j2} | 10 +++++----- vars/main.yaml | 6 +++--- 5 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 templates/i3/i3wm@.service.j2 rename templates/vnc/{vncserver.service.j2 => vncserver@.service.j2} (74%) diff --git a/tasks/i3.yaml b/tasks/i3.yaml index 0bbc053..0be8a6e 100644 --- a/tasks/i3.yaml +++ b/tasks/i3.yaml @@ -36,14 +36,20 @@ dest: ~/.config/i3blocks/config notify: i3 reload -- name: i3wm graphical-session service +- name: i3wm graphical-session service for the default xsession template: src: i3/i3wm.service.j2 dest: ~/.config/systemd/user/i3wm.service 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 systemd: - name: i3wm.service + name: i3wm@.service enabled: true scope: user diff --git a/tasks/vnc.yaml b/tasks/vnc.yaml index 1cad20b..a1954ad 100644 --- a/tasks/vnc.yaml +++ b/tasks/vnc.yaml @@ -14,6 +14,6 @@ - name: vncserver user service template: - src: vnc/vncserver.service.j2 + src: vnc/vncserver@.service.j2 dest: ~/.config/systemd/user/vncserver@.service notify: systemd daemon-reload diff --git a/templates/i3/i3wm@.service.j2 b/templates/i3/i3wm@.service.j2 new file mode 100644 index 0000000..0bee1a4 --- /dev/null +++ b/templates/i3/i3wm@.service.j2 @@ -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 diff --git a/templates/vnc/vncserver.service.j2 b/templates/vnc/vncserver@.service.j2 similarity index 74% rename from templates/vnc/vncserver.service.j2 rename to templates/vnc/vncserver@.service.j2 index cd0870a..c58f052 100644 --- a/templates/vnc/vncserver.service.j2 +++ b/templates/vnc/vncserver@.service.j2 @@ -21,14 +21,14 @@ After=syslog.target network.target [Service] WorkingDirectory=%h Environment=DISPLAY=%i -Environment=XAUTHORITY=%h/.Xauthority +Environment=XAUTHORITY=%h/.Xauthority%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 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] WantedBy=default.target diff --git a/vars/main.yaml b/vars/main.yaml index 176246d..b326433 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -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 #--slice-inherit home_autostart_desktop_apps: - name: terminal @@ -138,11 +138,11 @@ todo_i3block_socket: "{{todo_folder}}/i3block.sock" vncserver_options: | -desktop %H%i - -auth %h/.Xauthority + -auth %h/.Xauthority%i -geometry {{home_vncserver_geometry}} -depth 24 -rfbwait 30000 - -rfbunixpath %h/.vnc/socket + -rfbunixpath %h/.vnc/socket%i -nolisten tcp -pn -localhost From 37d9915dbe4ae5a4ce925361ec8a46efa7b9b01a Mon Sep 17 00:00:00 2001 From: Markus K Brechtel Date: Wed, 3 Aug 2022 19:30:02 +0200 Subject: [PATCH 2/5] zoom i3 config --- templates/i3/i3.config.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/i3/i3.config.j2 b/templates/i3/i3.config.j2 index 4d358bc..192e84b 100644 --- a/templates/i3/i3.config.j2 +++ b/templates/i3/i3.config.j2 @@ -352,6 +352,7 @@ for_window [class="^Pavu"] floating enable for_window [class="^Paman$"] floating enable for_window [class="^Blueman"] floating enable for_window [class="^URxvt$" title="^tmux-workspace$"] border none +for_window [class="^zoom$" title="^zoom$"] floating enable ### assign apps to workspaces assign [class="^netzdrive$"] → netzdrive @@ -359,6 +360,7 @@ assign [class="^TelegramDesktop$"] → tg assign [class="^Signal$"] → signal assign [class="^Element$"] → matrix assign [class="^thunderbird$"] → mail +assign [class="^zoom$" ] → zoom # vncviewer workspaces {% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %} {% set ws = workspaces[workspace] %} From 85c5313ceb96f9302b3becd789f5b4eabff5eed7 Mon Sep 17 00:00:00 2001 From: Markus K Brechtel Date: Fri, 5 Aug 2022 20:14:10 +0200 Subject: [PATCH 3/5] inherit display env variable for systemd-run --- vars/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/main.yaml b/vars/main.yaml index b326433..a8785c1 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -1,4 +1,4 @@ -i3_exec_command_prefix: systemd-run --user --scope --no-block -E DISPLAY=$DISPLAY #--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: - name: terminal From edd4fdb5c76ecd2c704afde8e7fd46ec43f98e94 Mon Sep 17 00:00:00 2001 From: Markus K Brechtel Date: Fri, 19 Aug 2022 10:02:54 +0200 Subject: [PATCH 4/5] disable X11 bell --- templates/x11/xsession.reload.fish.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/x11/xsession.reload.fish.j2 b/templates/x11/xsession.reload.fish.j2 index 6571168..4211eb5 100644 --- a/templates/x11/xsession.reload.fish.j2 +++ b/templates/x11/xsession.reload.fish.j2 @@ -37,3 +37,6 @@ xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display {% for xhost in home_xhosts_allow %} xhost +{{xhost}} {% endfor %} + +# disable bell +xset b off From b71881035be702bc590a4017039a56a088cc0f36 Mon Sep 17 00:00:00 2001 From: Markus K Brechtel Date: Mon, 3 Oct 2022 16:07:08 +0200 Subject: [PATCH 5/5] citrix windows --- templates/i3/i3.config.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/i3/i3.config.j2 b/templates/i3/i3.config.j2 index 192e84b..f3055b5 100644 --- a/templates/i3/i3.config.j2 +++ b/templates/i3/i3.config.j2 @@ -361,6 +361,8 @@ assign [class="^Signal$"] → signal assign [class="^Element$"] → matrix assign [class="^thunderbird$"] → mail assign [class="^zoom$" ] → zoom +assign [class="^Wfica_"] → citrix +assign [title="^Citrix maximized probe window$"] → citrix # vncviewer workspaces {% for workspace in workspaces|dict2items|json_query("[?value.type=='vncviewer'].key") %} {% set ws = workspaces[workspace] %}