added Linux support
This commit is contained in:
parent
46a76f55c9
commit
b971e214e6
2 changed files with 7 additions and 2 deletions
|
@ -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`
|
||||
- Resolution: `xorg-xdpyinfo` or `xrandr`
|
||||
- Screenshot: `scrot` \[5\]
|
||||
|
||||
|
||||
|
|
7
neofetch
7
neofetch
|
@ -1273,8 +1273,13 @@ getsong () {
|
|||
getresolution () {
|
||||
case "$os" in
|
||||
"Linux" | *"BSD")
|
||||
type -p xdpyinfo >/dev/null 2>&1 && \
|
||||
if type -p xrandr >/dev/null 2>&1; then
|
||||
resolution=$(xrandr --nograb --current | awk 'match($0,/[0-0]{2,3}.[0-9]{2}\*/) {printf $1 " @ " substr($0,RSTART,RLENGTH) "Hz, "}')
|
||||
resolution=${resolution//\*}
|
||||
|
||||
elif type -p xdpyinfo >/dev/null 2>&1 && \
|
||||
resolution=$(xdpyinfo 2>/dev/null | awk '/dimensions:/ {printf $2}')
|
||||
fi
|
||||
;;
|
||||
|
||||
"Mac OS X")
|
||||
|
|
Loading…
Reference in a new issue