Created
December 11, 2023 03:00
-
-
Save jmkelly/809ae0c941ee0ef71c7301b4c27e3161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Replace these values with your actual setup | |
DISPLAY_NAME="HDMI-1" | |
WIDTH=2560 | |
HEIGHT=1080 | |
CUSTOM_MODE_NAME="${WIDTH}x${HEIGHT}" | |
# Use cvt to generate modeline data | |
MODELINEDATA=$(cvt $WIDTH $HEIGHT | grep Modeline | cut -d' ' -f4-) | |
# Add custom mode | |
xrandr --newmode "$CUSTOM_MODE_NAME" $MODELINEDATA | |
xrandr --addmode $DISPLAY_NAME "$CUSTOM_MODE_NAME" | |
# Apply the new resolution | |
xrandr --output $DISPLAY_NAME --mode "$CUSTOM_MODE_NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment