This commit is contained in:
parent
0636706ecf
commit
c323470f2f
13
neofetch
13
neofetch
|
@ -2801,7 +2801,7 @@ get_resolution() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if type -p xrandr >/dev/null; then
|
if type -p xrandr >/dev/null && [[ $DISPLAY && -z $WAYLAND_DISPLAY ]]; then
|
||||||
case $refresh_rate in
|
case $refresh_rate in
|
||||||
"on")
|
"on")
|
||||||
resolution="$(xrandr --nograb --current |\
|
resolution="$(xrandr --nograb --current |\
|
||||||
|
@ -2820,13 +2820,20 @@ get_resolution() {
|
||||||
esac
|
esac
|
||||||
resolution="${resolution//\*}"
|
resolution="${resolution//\*}"
|
||||||
|
|
||||||
elif type -p xwininfo >/dev/null; then
|
elif type -p xwininfo >/dev/null && [[ $DISPLAY && -z $WAYLAND_DISPLAY ]]; then
|
||||||
read -r w h \
|
read -r w h \
|
||||||
<<< "$(xwininfo -root | awk -F':' '/Width|Height/ {printf $2}')"
|
<<< "$(xwininfo -root | awk -F':' '/Width|Height/ {printf $2}')"
|
||||||
resolution="${w}x${h}"
|
resolution="${w}x${h}"
|
||||||
|
|
||||||
elif type -p xdpyinfo >/dev/null; then
|
elif type -p xdpyinfo >/dev/null && [[ $DISPLAY && -z $WAYLAND_DISPLAY ]]; then
|
||||||
resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')"
|
resolution="$(xdpyinfo | awk '/dimensions:/ {printf $2}')"
|
||||||
|
|
||||||
|
elif [[ -d /sys/class/drm ]]; then
|
||||||
|
for dev in /sys/class/drm/*/modes; do
|
||||||
|
read -r resolution _ < "$dev"
|
||||||
|
|
||||||
|
[[ $resolution ]] && break
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Reference in New Issue