From 731e4609391cf2bac73141d0956868281c07ebc7 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 20 Aug 2025 19:42:21 +0200 Subject: Hardware: PC: Set high refresh rate automatically --- dotfiles/.xinitrc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'dotfiles') diff --git a/dotfiles/.xinitrc b/dotfiles/.xinitrc index 44cbad2..f8d567e 100644 --- a/dotfiles/.xinitrc +++ b/dotfiles/.xinitrc @@ -37,7 +37,21 @@ fi # NEEDED FOR NVIDIA DRIVERS if [ -x "$(command -v nvidia-smi)" ]; then - xrandr --setprovideroutputsource modesetting NVIDIA-0 + + # Preferred resolution + refresh rate + RES="3440x1440" + RATE="160.00" + + # Find a connected display (DP-2, HDMI-0, etc.) + OUTPUT="$(xrandr | grep " connected" | cut -d' ' -f1)" + + # Only switch if the mode exists + if xrandr | grep -qE "${RES}"; then + xrandr --output "$OUTPUT" --mode "$RES" --rate "$RATE" + else + # For PRIME / hybrid setups + xrandr --setprovideroutputsource modesetting NVIDIA-0 + fi fi # NEEDED FOR CHROMEBOOK -- cgit 1.4.1