From e6bb564d781bdfd7b65164c8f0896369ea77f85b Mon Sep 17 00:00:00 2001 From: Sunderland93 Date: Sun, 26 Nov 2023 12:16:39 +0400 Subject: [PATCH] Add start-qtile wrapper and env variables --- etc/environment.d/90tileos-qtile.conf | 17 +++++++ etc/skel/.config/qtile/autostart.sh | 18 ++++--- etc/skel/.config/qtile/config.py | 8 +-- usr/bin/start-qtile-wayland | 50 +++++++++++++++++++ .../xdg-desktop-portal/wlroots-portals.conf | 6 +++ 5 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 etc/environment.d/90tileos-qtile.conf create mode 100755 usr/bin/start-qtile-wayland create mode 100644 usr/share/xdg-desktop-portal/wlroots-portals.conf diff --git a/etc/environment.d/90tileos-qtile.conf b/etc/environment.d/90tileos-qtile.conf new file mode 100644 index 0000000..530ed1d --- /dev/null +++ b/etc/environment.d/90tileos-qtile.conf @@ -0,0 +1,17 @@ +# Force Wayland for Mozilla Firefox +MOZ_ENABLE_WAYLAND=1 +MOZ_DBUS_REMOTE=1 + +# Force Wayland for Qt apps +QT_QPA_PLATFORM="wayland;xcb" +QT_QPA_PLATFORMTHEME=qt5ct + +# Set default cursor size +XCURSOR_SIZE=24 + +# Force Wayland for EFL (Enlightenment) apps +ECORE_EVAS_ENGINE="wayland-egl" +ELM_ACCEL="gl" + +# Java XWayland blank screens fix +_JAVA_AWT_WM_NONREPARENTING=1 diff --git a/etc/skel/.config/qtile/autostart.sh b/etc/skel/.config/qtile/autostart.sh index cc69223..075d06e 100755 --- a/etc/skel/.config/qtile/autostart.sh +++ b/etc/skel/.config/qtile/autostart.sh @@ -1,14 +1,18 @@ #!/usr/bin/env bash +export XDG_CURRENT_DESKTOP=wlroots +export XDG_SESSION_DESKTOP="${XDG_SESSION_DESKTOP:-wlroots}" +export XDG_SESSION_TYPE=wayland +VARIABLES="DESKTOP_SESSION XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE" +VARIABLES="${VARIABLES} DISPLAY WAYLAND_DISPLAY" + +if hash dbus-update-activation-environment 2>/dev/null; then + # shellcheck disable=SC2086 + dbus-update-activation-environment --systemd ${VARIABLES:- --all} +fi + # PolicyKit Agent /usr/bin/mate-polkit -# nwg-drawer as a daemon -pkill nwg-drawer -/usr/bin/nwg-drawer -r & - -# PCmanFM-Qt as a daemon -/usr/bin/pcmanfm-qt -d - # Wallpaper script (you can change wallpaper with Azote) exec ~/.azotebg diff --git a/etc/skel/.config/qtile/config.py b/etc/skel/.config/qtile/config.py index 7158064..02bc67c 100644 --- a/etc/skel/.config/qtile/config.py +++ b/etc/skel/.config/qtile/config.py @@ -341,10 +341,10 @@ auto_minimize = True # When using the Wayland backend, this can be used to configure input devices. wl_input_rules = None -#@hook.subscribe.startup_once -#def start_once(): -# home = os.path.expanduser('~') -# subprocess.call([home + '/.config/qtile/autostart.sh']) +@hook.subscribe.startup_once +def start_once(): + home = os.path.expanduser('~') + subprocess.call([home + '/.config/qtile/autostart.sh']) # XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this diff --git a/usr/bin/start-qtile-wayland b/usr/bin/start-qtile-wayland new file mode 100755 index 0000000..5ae3f17 --- /dev/null +++ b/usr/bin/start-qtile-wayland @@ -0,0 +1,50 @@ +#!/usr/bin/env sh + +## General exports +export XDG_CURRENT_DESKTOP=wlroots +export XDG_SESSION_DESKTOP=wlroots +export XDG_SESSION_TYPE=wayland + +# Check if system is running in virtual machine +case "$(systemd-detect-virt)" in +qemu) + export WLR_RENDERER=pixman + export WLR_NO_HARDWARE_CURSORS=1 + ;; +kvm) + export WLR_NO_HARDWARE_CURSORS=1 + ;; +oracle) + export WLR_NO_HARDWARE_CURSORS=1 + ;; +esac + +# Apply Nvidia-specific variables +if [ -d /sys/module/nvidia ]; then + export WLR_NO_HARDWARE_CURSORS=1 + export GBM_BACKEND=nvidia-drm + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export LIBVA_DRIVER_NAME=nvidia +fi + +## Load system environment customizations +if [ -d /etc/environment.d ]; then + set -o allexport + for f in /etc/environment.d/*.conf; do + # shellcheck source=/dev/null + . "$f" + done + set +o allexport +fi + +## Load user environment customizations +if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d" ]; then + set -o allexport + for i in "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d"/*.conf; do + # shellcheck source=/dev/null + . "$i" + done + set +o allexport +fi + +exec systemd-cat -- /usr/bin/qtile start -b wayland $@ \ No newline at end of file diff --git a/usr/share/xdg-desktop-portal/wlroots-portals.conf b/usr/share/xdg-desktop-portal/wlroots-portals.conf new file mode 100644 index 0000000..aa046f6 --- /dev/null +++ b/usr/share/xdg-desktop-portal/wlroots-portals.conf @@ -0,0 +1,6 @@ +[preferred] +# Use xdg-desktop-portal-gtk for every portal interface... +default=gtk +# ... except for the ScreenCast and Screenshot +org.freedesktop.impl.portal.ScreenCast=wlr +org.freedesktop.impl.portal.Screenshot=wlr