From 7b5b1b3a36f6ea6266becd7b4aaf5f3c44b8fb1a Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 1 Feb 2016 08:16:47 +1100 Subject: [PATCH] Windows: OS now shows Windows edition (Windows 7 Ultimate, etc) --- fetch | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/fetch b/fetch index f19b2fd2..6bdc88ed 100755 --- a/fetch +++ b/fetch @@ -401,31 +401,11 @@ case "$os" in ;; "Windows") - case "$(cmd /c ver)" in - *"XP"*) - distro="Windows XP" - ;; - - *"7"*) - distro="Windows 7" - ;; - - *"8.1"*) - distro="Windows 8.1" - ;; - - *"8"*) - distro="Windows 8" - ;; - - *"10"*) - distro="Windows 10" - ;; - - *) - distro="Windows" - ;; - esac + distro="$(wmic os get Caption /value)" + distro=${distro/Caption} + distro=${distro//[[:space:]]/ } + distro=${distro// } + distro=${distro/Microsoft } ;; *)