Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions screenfetch-dev
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,7 @@ detectshell () {


# Resolution Detection - Begin
# Egs `1920x1080`
detectres () {
xResolution="No X Server"
if [[ ${distro} == "Mac OS X" || $distro == "macOS" ]]; then
Expand All @@ -2003,6 +2004,8 @@ detectres () {
elif [[ -n ${DISPLAY} ]]; then
if type -p xdpyinfo >/dev/null 2>&1; then
xResolution=$(xdpyinfo | "${AWK}" '/^ +dimensions/ {print $2}')
elif type -p xrandr > /dev/null 2>&1; then
xResolution=$(xrandr --listmonitors | "${AWK}" '/[0-9]+\/[0-9]+x[0-9]+\/[0-9]+/ { split($3,a); gsub(/\/[[:digit:]]+|\+[0-9]/,"",a[1]); print(a[1])}')
fi
fi
verboseOut "Finding current resolution(s)...found as '$xResolution'"
Expand Down