Last active
February 22, 2020 22:44
-
-
Save multiplemonomials/222840296f0e10404e63b93ee278af7e 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 | |
# This script will set your Linux desktop to use a custom screen resolution. | |
# Set your resolution in the variables below, and then run the script each time your VM boots. | |
# Bam! No more annoying issues with your VM screen being too big or too small! | |
# | |
# Author: CP Jamie, with some help from StackOverflow | |
width=1280 | |
height=1024 | |
refreshrate=60 | |
res_name="${width}x${height}_${refreshrate}hz" | |
res_modeline=$(cvt $width $height ${refreshrate} | tail -1 | cut -d ' ' -f 3-) | |
monitor_name=$(xrandr --listactivemonitors | tail -1 | cut -d ' ' -f 6) | |
xrandr --newmode $res_name $res_modeline | |
xrandr --addmode $monitor_name $res_name | |
xrandr --output $monitor_name --mode $res_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment