diff --git a/fetch.sh b/fetch.sh index 09dd87d1..03d3a6b6 100755 --- a/fetch.sh +++ b/fetch.sh @@ -216,6 +216,10 @@ case "$(uname)" in "OpenBSD") os="OpenBSD" ;; + + "CYGWIN"*) + os="Windows" + ;; esac # Get Distro @@ -239,6 +243,15 @@ getdistro () { distro="OpenBSD" ;; + "Windows") + # TODO: Detect XP/7 + if [ "$(wmic os get version | grep -o '^10')" ]; then + distro="Windows 10" + else + distro="Windows" + fi + ;; + *) distro="Unknown" ;; @@ -302,6 +315,10 @@ getuptime () { uptime=${uptime# } ;; + "Windows") + uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}') + ;; + *) uptime="Unknown" ;; @@ -355,6 +372,10 @@ getpackages () { packages=$(pkg_info | wc -l) ;; + "Windows"*) + packages=$(cygcheck -cd | wc -l) + ;; + *) packages="Unknown" ;;