feat(user_commands.bash): create custom desktop file for nvidia sessions with heredoc

This commit is contained in:
BluishHumility
2024-10-16 21:22:52 -04:00
parent c2b9c5b5ba
commit 81acd05a7f

View File

@@ -6,10 +6,18 @@ echo "Cloning the EOS Community Sway repo..."
git clone https://github.com/EndeavourOS-Community-Editions/sway.git git clone https://github.com/EndeavourOS-Community-Editions/sway.git
# Check if nvidia-inst is installed # Check if nvidia-inst is installed
if pacman -Qq nvidia-inst 2>/dev/null | grep -q .; then
# If it is, do the Nvidia stuff # If it is, do the Nvidia stuff
if pacman -Qq nvidia-inst 2>/dev/null | grep -q .; then
# Add the --unsupported-gpu flag to the sway call in greetd.conf
sed -i 's|sway -c|sway --unsupported-gpu -c|' sway/etc/greetd/greetd.conf sed -i 's|sway -c|sway --unsupported-gpu -c|' sway/etc/greetd/greetd.conf
# Create a custom desktop file that uses sway --unsupported-gpu
cat <<EOF > /usr/share/wayland-sessions/sway-nvidia.desktop
[Desktop Entry]
Name=Sway-Nvidia
Comment=Sway with Nvidia
Exec=sway --unsupported-gpu
Type=Application
EOF
fi fi
# Install the custom package list # Install the custom package list