From ff22dceb83c96249ac9efc8f4f83c4f88d852736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Fri, 17 Jul 2020 00:59:57 -0300 Subject: [PATCH] Move wayland-vars to compositor launch time. Add wayfire start. --- wayland/.local/bin/launcher | 6 +--- wayland/.local/bin/startsway | 20 +------------ wayland/.local/bin/startwayfire | 3 ++ wayland/.local/bin/wayland-vars | 52 +++++++++++++++++++++------------ wayland/.local/bin/wofitheme | 8 +---- 5 files changed, 40 insertions(+), 49 deletions(-) create mode 100755 wayland/.local/bin/startwayfire diff --git a/wayland/.local/bin/launcher b/wayland/.local/bin/launcher index f5ae4f2..d0aac72 100755 --- a/wayland/.local/bin/launcher +++ b/wayland/.local/bin/launcher @@ -1,7 +1,3 @@ #!/bin/sh - -# ericonr's script for launching applications with the appropriate env - -. "$HOME/.local/bin/wayland-vars" - +# ericonr's script for launching applications exec generic-launcher /bin/bash -c 'compgen -c | sort -u | fzf --border | xargs lnch' diff --git a/wayland/.local/bin/startsway b/wayland/.local/bin/startsway index 0b7e75f..3a01ca7 100755 --- a/wayland/.local/bin/startsway +++ b/wayland/.local/bin/startsway @@ -1,21 +1,3 @@ #!/bin/sh - -# created by elogind, usually -if test -z "${XDG_RUNTIME_DIR}"; then - export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir - if ! test -d "${XDG_RUNTIME_DIR}"; then - mkdir "${XDG_RUNTIME_DIR}" - chmod 0700 "${XDG_RUNTIME_DIR}" - fi -fi - -export XDG_SESSION_TYPE=wayland . ~/.local/bin/wayland-vars - -# catch crashes -ulimit -c unlimited - -# start the compositor itself -WLR_DRM_DEVICES=/dev/dri/card0 exec dbus-run-session \ - sway --my-next-gpu-wont-be-nvidia -d -V 2>&1 \ - > "${XDG_RUNTIME_DIR}/sway-$(date "+%Y-%m-%d").log" +launch_compositor sway --my-next-gpu-wont-be-nvidia -d -V diff --git a/wayland/.local/bin/startwayfire b/wayland/.local/bin/startwayfire new file mode 100755 index 0000000..81a131c --- /dev/null +++ b/wayland/.local/bin/startwayfire @@ -0,0 +1,3 @@ +#!/bin/sh +. ~/.local/bin/wayland-vars +launch_compositor wayfire diff --git a/wayland/.local/bin/wayland-vars b/wayland/.local/bin/wayland-vars index 79eb574..0f58c40 100644 --- a/wayland/.local/bin/wayland-vars +++ b/wayland/.local/bin/wayland-vars @@ -1,20 +1,36 @@ -# ericonr's environment for launching applications +# ericonr's environment for launching wayland compositors -if [ "$XDG_SESSION_TYPE" = wayland ] -then - # Qt - export QT_QPA_PLATFORM=wayland-egl - export QT_QPA_PLATFORMTHEME=qt5ct - # Firefox - export MOZ_ENABLE_WAYLAND=1 - # Java - export _JAVA_AWT_WM_NONREPARENTING=1 - # SDL - not working for most games - #export SDL_VIDEODRIVER=wayland - # Vulkan should use the Intel GPU - export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json - export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json -else - # useful for KDE - export GTK_USE_PORTAL=1 +# created by elogind, usually +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR="/tmp/$(mktemp -d ${UID}-runtime-XXXXXX)" + if ! test -d "${XDG_RUNTIME_DIR}"; then + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" + fi fi + +# Session +export XDG_SESSION_TYPE=wayland + +# Qt +export QT_QPA_PLATFORM=wayland-egl +# Firefox +export MOZ_ENABLE_WAYLAND=1 +# Java +export _JAVA_AWT_WM_NONREPARENTING=1 +# SDL - not working for most games +#export SDL_VIDEODRIVER=wayland + +# Vulkan should use the Intel GPU +export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json +# EGL should use the Mesa driver -> segfaults with Nvidia on musl +export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json +# Pass Intel GPU wlroots - hope naming doesn't change +export WLR_DRM_DEVICES=/dev/dri/card0 + +# catch crashes +ulimit -c unlimited + +launch_compositor() { + exec dbus-run-session "$@" > "${XDG_RUNTIME_DIR}/$1-$(date "+%Y-%m-%d").log" 2>&1 +} diff --git a/wayland/.local/bin/wofitheme b/wayland/.local/bin/wofitheme index 93c4f73..5519244 100755 --- a/wayland/.local/bin/wofitheme +++ b/wayland/.local/bin/wofitheme @@ -1,9 +1,3 @@ #!/bin/sh - -# ericonr's script for launching applications with the appropriate env - -. "$HOME/.local/bin/wayland-vars" - -export GTK_THEME=Breeze - +# ericonr's script for launching applications exec wofi -i -t alacritty "$@"