aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-28 10:30:59 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-28 10:30:59 +0300
commiteb9c8a3cfe9d3c71d0e71a808f6f8123141aa7d9 (patch)
tree2fd4ed6964d908a67a7ea15597c56deff0e7984b
parent59340ff4cecafad33c44603e09b72483e0970e13 (diff)
downloadpfetch-eb9c8a3cfe9d3c71d0e71a808f6f8123141aa7d9.tar.gz
pfetch: WSL support
-rwxr-xr-xpfetch13
1 files changed, 13 insertions, 0 deletions
diff --git a/pfetch b/pfetch
index dd7f6e0..b52a7e5 100755
--- a/pfetch
+++ b/pfetch
@@ -171,6 +171,19 @@ get_os() {
# don't follow any os-release/lsb standards whatsoever.
command -v crux && distro=$(crux)
command -v guix && distro='Guix System'
+
+ # Check to see if Linux is running in Windows 10 under
+ # WSL (Windows subsystem for Linux) and append a string
+ # accordingly.
+ #
+ # If the kernel version string ends in "-Microsoft",
+ # we're very likely running under Windows 10 in WSL.
+ #
+ # This also acts as a means of allowing the user to
+ # fake this by changing their kernel version to end in
+ # "Microsoft".
+ [ "${kernel%%*-Microsoft}" ] ||
+ distro="$distro on Windows 10"
;;
Darwin*)