Created
March 6, 2018 05:09
-
-
Save pirogoeth/5f4f1124dfece5e84052173ab18cefc0 to your computer and use it in GitHub Desktop.
AWK script for matching display modes from `xrandr --query`
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
BEGIN { | |
matched = 0; | |
if (!display) { | |
print "No display variable set"; | |
exit; | |
} | |
} | |
# Matches modelines | |
match($0, /^[[:blank:]]+/) { | |
if (matched == 1) { | |
print $0; | |
next; | |
} | |
} | |
match($0, display) { | |
matched = 1; | |
next; | |
} | |
{ | |
matched = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment