Merge pull request #188 from iandrewt/screenresolution
made resolution way faster on OS X
This commit is contained in:
commit
4ffedf49e1
|
@ -5,6 +5,10 @@ os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install screenresolution; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sudo make install
|
- sudo make install
|
||||||
- neofetch --test --ascii --color_blocks off --config off --ascii_distro travis
|
- neofetch --test --ascii --color_blocks off --config off --ascii_distro travis
|
||||||
|
|
|
@ -95,7 +95,7 @@ your distro's logo or any ascii art of your choice!
|
||||||
|
|
||||||
##### OSX
|
##### OSX
|
||||||
|
|
||||||
- Current Song: `itunes`
|
- Resolution (quicker): `screenresolution
|
||||||
|
|
||||||
|
|
||||||
\[1\] See **[#79](https://github.com/dylanaraps/neofetch/issues/79)** about why this is now a required dependency.
|
\[1\] See **[#79](https://github.com/dylanaraps/neofetch/issues/79)** about why this is now a required dependency.
|
||||||
|
|
19
neofetch
19
neofetch
|
@ -12,10 +12,12 @@
|
||||||
# Optional Dependencies: (You'll lose these features without them)
|
# Optional Dependencies: (You'll lose these features without them)
|
||||||
# Displaying Images: w3m + w3m-img
|
# Displaying Images: w3m + w3m-img
|
||||||
# Image Cropping: ImageMagick
|
# Image Cropping: ImageMagick
|
||||||
|
# Displaying song with Google Play Music: gpmdp-bash
|
||||||
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
|
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
|
||||||
# [ Linux / BSD ] Current Song: mpc, cmus, moc
|
# [ Linux / BSD ] Current Song: mpc, cmus, moc
|
||||||
# [ Linux ] Current Song: spotify
|
# [ Linux ] Current Song: spotify
|
||||||
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
|
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
|
||||||
|
# [ OS X ] Getting screen resolution (faster): screenresolution
|
||||||
#
|
#
|
||||||
# Created by Dylan Araps
|
# Created by Dylan Araps
|
||||||
# https://github.com/dylanaraps/
|
# https://github.com/dylanaraps/
|
||||||
|
@ -1251,16 +1253,17 @@ getresolution () {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
case "$refresh_rate" in
|
if type -p screenresolution >/dev/null 2>&1; then
|
||||||
"on")
|
resolution=$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')
|
||||||
|
resolution=${resolution//x??@/ @ }
|
||||||
|
|
||||||
|
else
|
||||||
resolution=$(system_profiler SPDisplaysDataType |\
|
resolution=$(system_profiler SPDisplaysDataType |\
|
||||||
awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')
|
awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')
|
||||||
;;
|
fi
|
||||||
"off")
|
|
||||||
resolution=$(system_profiler SPDisplaysDataType |\
|
[[ "$refresh_rate" == "off" ]] && \
|
||||||
awk '/Resolution:/ {printf $2"x"$4", "}')
|
resolution=${resolution// @ +([0-9])Hz}
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Windows")
|
"Windows")
|
||||||
|
|
Reference in New Issue