From 1588155964c38cca2b568e9d37add13842fdbe26 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 23 Jan 2020 17:54:24 +0200 Subject: [PATCH] resolution: Multi monitor support for Windows. Closes #1297 --- neofetch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/neofetch b/neofetch index d59ee15b..b4e94ebf 100755 --- a/neofetch +++ b/neofetch @@ -2783,15 +2783,17 @@ get_resolution() { ;; "Windows") - local width="" - width="$(wmic path Win32_VideoController get CurrentHorizontalResolution)" - width="${width//CurrentHorizontalResolution/}" + maparray -t sw < <(wmic path Win32_VideoController get CurrentHorizontalResolution) + maparray -t sh < <(wmic path Win32_VideoController get CurrentVerticalResolution) - local height="" - height="$(wmic path Win32_VideoController get CurrentVerticalResolution)" - height="${height//CurrentVerticalResolution/}" + sw=("${sw[@]//CurrentHorizontalResolution}") + sh=("${sh[@]//CurrentHorizontalResolution}") - [[ "$(trim "$width")" ]] && resolution="${width//[[:space:]]}x${height//[[:space:]]}" + for ((mn = 0; mn < ${#sw[@]}; mn++)) { + resolution+=${sw[mn]//[[:space:]]}x${sh[mn]//[[:space:]]}, + } + + resolution=${resolution%,} ;; "Haiku")