Skip to content

Commit

Permalink
Store refresh rate
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipberndt committed Dec 31, 2014
1 parent 8429886 commit 920294a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions autorandr
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ current_cfg_xrandr() {
$XRANDR -q | awk -v primary_setup="${PRIMARY_SETUP}" '
# display is connected and has a mode
/^[^ ]+ connected [^(]/ {
output=$1
print "output "$1;
if ($3 == "primary") {
print $3
Expand All @@ -151,9 +152,19 @@ current_cfg_xrandr() {
}
next;
}
/ [0-9]+x[0-9]+ .+/ {
if (output) {
for (n=1; n<10; n++) {
if($n ~ /[0-9]+\.[0-9]+\*/) {
print "rate " gensub(/(+|\*)/, "", "g", $n);
}
}
}
}
# disconnected or disabled displays
/^[^ ]+ (dis)?connected / ||
/^[^ ]+ unknown connection / {
output=""
print "output "$1;
print "off";
next;
Expand Down

0 comments on commit 920294a

Please sign in to comment.