From 4711ad24164b2f56315af1257f8b47db50ccba43 Mon Sep 17 00:00:00 2001 From: frosty Date: Mon, 9 Sep 2024 22:02:04 -0400 Subject: [PATCH] add some xrandr checks for nvidia-related stuff, and change dbus run command --- .xinitrc | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.xinitrc b/.xinitrc index 5757a0a..90042fc 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,33 +1,23 @@ #!/bin/sh -xrandr --setprovideroutputsource modesetting NVIDIA-0 -xrandr --auto -xrandr --dpi 96 -xrandr \ - --output eDP-1 --off \ - --output HDMI-2 --primary --mode 1280x1024 --pos 0x0 --rate 75 +if $(xrandr --listproviders | grep 'NVIDIA'); then + xrandr --setprovideroutputsource modesetting NVIDIA-0 + xrandr --auto + xrandr --dpi 96 + xrandr \ + --output eDP-1 --off \ + --output HDMI-2 --primary --mode 1280x1024 --pos 0x0 --rate 75 -export __NV_PRIME_RENDER_OFFLOAD=1 -export __GLX_VENDOR_LIBRARY_NAME="nvidia" + export __NV_PRIME_RENDER_OFFLOAD=1 + export __GLX_VENDOR_LIBRARY_NAME="nvidia" +fi [ -f "$XDG_DATA_HOME/wallpaper" ] && xwallpaper --zoom "$XDG_DATA_HOME/wallpaper" & xrdb -merge "$HOME/.Xresources" -pipewire & -pipewire-pulse & -wireplumber & - -dunst & -picom & -udiskie & -mpd --no-daemon & - +runsvdir "$SVDIR" & modbot -x & while :; do - if command -v dbus-launch >/dev/null; then - dbus-launch --sh-syntax --exit-with-session dwm - elif command -v dbus-run-session >/dev/null; then - dbus-run-session dwm - fi + dbus-launch --sh-syntax --exit-with-session dwm done