tileos-settings-sway/usr/bin/start-sway

30 lines
719 B
Bash
Executable file

#!/usr/bin/env sh
# 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
# Check if Nvidia driver installed, start Sway and send output to the journal
if [ -d /sys/module/nvidia ]; then
exec systemd-cat -- /usr/bin/sway --unsupported-gpu $@
else
exec systemd-cat -- /usr/bin/sway $@
fi