Add start-sway wrapper

This commit is contained in:
Aleksey Samoilov 2023-04-10 19:41:19 +04:00
parent a56823530f
commit 4e8bdbd3a1
3 changed files with 32 additions and 0 deletions

1
debian/control vendored
View file

@ -10,4 +10,5 @@ Rules-Requires-Root: no
Package: tileos-settings-sway
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: tileos-settings-river
Description: default settings for Sway on TileOS

1
debian/tileos-settings-sway.install vendored Normal file
View file

@ -0,0 +1 @@
/usr

30
usr/bin/start-sway Executable file
View file

@ -0,0 +1,30 @@
#!/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