resolution [linux]: Add support for orientation.

This commit is contained in:
Dylan Araps 2017-07-12 11:32:37 +10:00
parent e9f491656e
commit 688bcd6e55

View file

@ -1497,7 +1497,10 @@ get_resolution() {
if type -p xrandr >/dev/null; then if type -p xrandr >/dev/null; then
case "$refresh_rate" in case "$refresh_rate" in
"on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;; "on") resolution="$(xrandr --nograb --current | awk 'match($0,/[0-9]*\.[0-9]*\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')" ;;
"off") resolution="$(xrandr --nograb --current | awk '/\*/ {printf $1 ", "}')" ;; "off")
resolution="$(xrandr --nograb --current | awk -F 'connected |+' '/ connected/ {printf $2 ", "}')"
resolution="${resolution/primary }"
;;
esac esac
resolution="${resolution//\*}" resolution="${resolution//\*}"