Created
November 19, 2024 18:23
-
-
Save betapictoris/a92093e835baeb35e2ead68bf8a9b0fd to your computer and use it in GitHub Desktop.
Script to set the resolution to input
This file contains hidden or 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
## setResolution.sh - 2024-11-19 | |
## | |
## Example: | |
## bash ./setResolution.sh 1410 940 | |
## | |
# Get the string for the mode | |
mode="$(cvt $1 $2 | sed -n '2,2p' | sed 's/Modeline //g')" | |
name="$(echo $mode | grep -o "^\".*\"")" | |
echo $name | |
# Create and set the mode | |
xrandr --newmode $mode | |
xrandr --addmode eDP-1 $name | |
xrandr --output eDP-1 --mode $name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment