From 5b499beb57d9c9ac12f632b08f403a58f9d6f308 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 21 Feb 2016 21:48:49 +1100 Subject: [PATCH] Actual working/tested windows resolution support --- fetch | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fetch b/fetch index 7bf0bad6..c9f9d9d9 100755 --- a/fetch +++ b/fetch @@ -1119,11 +1119,15 @@ getresolution () { ;; "Windows") - resolution=$(wmic desktopmonitor get screenwidth, screenheight /value 2>/dev/null) - resolution=${resolution//ScreenWidth'='/ } - resolution=${resolution//ScreenHeight'='/x} - resolution=${resolution//$'\n'/} - resolution=${resolution/ } + width=$(wmic desktopmonitor get screenwidth /value 2>/dev/null) + width=${width/ScreenWidth'='/} + width=${width//[[:space:]]} + + height=$(wmic desktopmonitor get screenheight /value 2>/dev/null) + height=${height/ScreenHeight'='/} + height=${height//[[:space:]]} + + resolution="${width}x${height}" ;; "*")