diff --git a/desktop/tauri/src-tauri/tauri.conf.json5 b/desktop/tauri/src-tauri/tauri.conf.json5 index 289926712..ac10ea6f2 100644 --- a/desktop/tauri/src-tauri/tauri.conf.json5 +++ b/desktop/tauri/src-tauri/tauri.conf.json5 @@ -65,7 +65,6 @@ "/usr/lib/portmaster/portmaster-core": "binary/portmaster-core", "/usr/lib/portmaster/portmaster.zip": "binary/portmaster.zip", "/usr/lib/portmaster/assets.zip": "binary/assets.zip", - // Intel files "/var/lib/portmaster/intel/index.json": "intel/index.json", "/var/lib/portmaster/intel/base.dsdl": "intel/base.dsdl", @@ -79,6 +78,9 @@ "/var/lib/portmaster/intel/notifications.yaml": "intel/notifications.yaml", "/var/lib/portmaster/intel/news.yaml" : "intel/news.yaml", + // Scripts + "/usr/lib/portmaster/ui-wrapper": "../../../packaging/linux/ui-wrapper", + // Shortcut "/etc/xdg/autostart/portmaster.desktop": "../../../packaging/linux/portmaster-autostart.desktop" }, @@ -113,6 +115,9 @@ "/var/lib/portmaster/intel/notifications.yaml": "intel/notifications.yaml", "/var/lib/portmaster/intel/news.yaml" : "intel/news.yaml", + // Scripts + "/usr/lib/portmaster/ui-wrapper": "../../../packaging/linux/ui-wrapper", + // Shortcut "/etc/xdg/autostart/portmaster.desktop": "../../../packaging/linux/portmaster-autostart.desktop" }, diff --git a/packaging/linux/postinst b/packaging/linux/postinst index a54ee8e58..476638d71 100644 --- a/packaging/linux/postinst +++ b/packaging/linux/postinst @@ -63,8 +63,15 @@ if command -V semanage >/dev/null 2>&1; then fi echo "[ ] Initializing binary files" -mv /usr/bin/portmaster /usr/lib/portmaster/portmaster -ln -s /usr/lib/portmaster/portmaster /usr/bin/portmaster +# Upon initial install, /usr/bin/portmaster gets foisted from archive unpacking. +# Upon reconfiguration or reinstall, this state is undefined. +if ! test -L "/usr/bin/portmaster" || ! test -e "/usr/bin/portmaster"; then + # When /usr/bin/portmaster is not the ui-wrapper, the state must be either + # a reinstall or upgrade and not reconfigure. + mv /usr/bin/portmaster /usr/lib/portmaster/portmaster-ui; +fi; +chmod +x /usr/lib/portmaster/ui-wrapper; +ln -srf /usr/lib/portmaster/ui-wrapper /usr/bin/portmaster; chmod +x /usr/lib/portmaster/portmaster-core diff --git a/packaging/linux/ui-wrapper b/packaging/linux/ui-wrapper new file mode 100644 index 000000000..47657f4ed --- /dev/null +++ b/packaging/linux/ui-wrapper @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# NOTE: This is a workaround for a WebkitGTK issue detailed in: +# -> https://github.com/flusterIO/fluster/issues/11 +if command -v "loginctl" >/dev/null 2>&1; then + case "$(loginctl -P Type show-session auto)" in + ("x11") + exec /usr/lib/portmaster/portmaster-ui "$@"; + ;; + (*) + WEBKIT_DISABLE_DMABUF_RENDERER=1 \ + WEBKIT_DISABLE_COMPOSITING_MODE=1 \ + exec /usr/lib/portmaster/portmaster-ui "$@"; + ;; + esac; +else + # Assume worst case scenario for compatibility with Wayland in + # distributions that choose to avoid Systemd. + WEBKIT_DISABLE_DMABUF_RENDERER=1 \ + WEBKIT_DISABLE_COMPOSITING_MODE=1 \ + exec /usr/lib/portmaster/portmaster-ui "$@"; +fi;