diff options
| author | Baitinq <[email protected]> | 2025-08-20 19:42:21 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-08-20 19:42:21 +0200 |
| commit | 731e4609391cf2bac73141d0956868281c07ebc7 (patch) | |
| tree | 85846999367bbd3d94af0c362506147e4f51dd65 /dotfiles | |
| parent | Hosts: Add hf package (diff) | |
| download | nixos-config-731e4609391cf2bac73141d0956868281c07ebc7.tar.gz nixos-config-731e4609391cf2bac73141d0956868281c07ebc7.tar.bz2 nixos-config-731e4609391cf2bac73141d0956868281c07ebc7.zip | |
Hardware: PC: Set high refresh rate automatically
Diffstat (limited to 'dotfiles')
| -rw-r--r-- | dotfiles/.xinitrc | 16 |
1 files changed, 15 insertions, 1 deletions
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 |