Skip to content

Instantly share code, notes, and snippets.

@avindra
Last active November 29, 2020 21:27
Show Gist options
  • Save avindra/744a47752db5053c075f905b1e3d77e0 to your computer and use it in GitHub Desktop.
Save avindra/744a47752db5053c075f905b1e3d77e0 to your computer and use it in GitHub Desktop.
Some boilerplate for dealing with common issues when trying to start Sway (window manager) on an NVIDIA card.
#!/bin/sh
primaryGPU=/dev/dri/card0
if [[ ! -c "$primaryGPU" ]]; then
echo "No dri card detected"
exit 1
fi
export WLR_DRM_DEVICES=$primaryGPU
echo "Starting sway... using WLR_DRM_DEVICES=$WLR_DRM_DEVICES"
ls -lh $primaryGPU
# Why is there propaganda in a command line flag?
#
# https://github.com/swaywm/sway/blob/6991ac8c70869ca19a87cfc173e280cab7ff20d0/sway/main.c#L100-L102
#
# To understand more, see Anti-Software-Bloatist Drew DeVault's blog https://drewdevault.com ,
# while you can. He will probably end up on some foreign network stack and off the "clear" web soon.
sway -d --my-next-gpu-wont-be-nvidia 2>&1 > /dev/shm/sway.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment