Last active
October 15, 2020 21:34
-
-
Save Himura2la/a3c2ba0f3664e1e60dcd15d1b1c240e1 to your computer and use it in GitHub Desktop.
Add a resolution to "Unknown Display"
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
#!/bin/sh | |
get_xorg_conf() { | |
local usage="Usage: ${FUNCNAME[0]} monitor horizontal_resolution vertical_resolution refresh_rate" | |
local mon=${1?$usage} | |
local X=${2?$usage} | |
local Y=${3?$usage} | |
local refresh=${4?$usage} | |
local cvt="$(cvt $X $Y $refresh)" | |
local mode_line="$(echo "$cvt" | grep '^[^#]')" | |
local mode_name="$(echo "$modeline" | cut -d' ' -f2)" | |
# WARNING: Mixed tabs and spaces below | |
cat <<-EOF | |
Section "Monitor" | |
Identifier "$mon" | |
$mode_line | |
Option "PreferredMode" $mode_name | |
EndSection | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: