pfetch: WSL support

This commit is contained in:
Dylan Araps 2019-09-28 10:30:59 +03:00
parent 59340ff4ce
commit eb9c8a3cfe

13
pfetch
View File

@ -171,6 +171,19 @@ get_os() {
# don't follow any os-release/lsb standards whatsoever. # don't follow any os-release/lsb standards whatsoever.
command -v crux && distro=$(crux) command -v crux && distro=$(crux)
command -v guix && distro='Guix System' 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*) Darwin*)