added check for whether user wants refresh rate for linux

This commit is contained in:
Andrew Titmuss 2016-03-26 08:36:00 +11:00
parent b971e214e6
commit c5f22dacb3
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ your distro's logo or any ascii art of your choice!
- Wallpaper: `feh`, `nitrogen` or `gsettings`
- Current Song: `mpc` or `cmus`
- Resolution: `xorg-xdpyinfo` or `xrandr`
- Resolution: `xorg-xdpyinfo`
- Screenshot: `scrot` \[5\]

View file

@ -1273,7 +1273,7 @@ getsong () {
getresolution () {
case "$os" in
"Linux" | *"BSD")
if type -p xrandr >/dev/null 2>&1; then
if type -p xrandr >/dev/null 2>&1 && [ "$refresh_rate" == "on" ]; then
resolution=$(xrandr --nograb --current | awk 'match($0,/[0-0]{2,3}.[0-9]{2}\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')
resolution=${resolution//\*}