Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit eb9c8a3

Browse files
committed
pfetch: WSL support
1 parent 59340ff commit eb9c8a3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pfetch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,19 @@ get_os() {
171171
# don't follow any os-release/lsb standards whatsoever.
172172
command -v crux && distro=$(crux)
173173
command -v guix && distro='Guix System'
174+
175+
# Check to see if Linux is running in Windows 10 under
176+
# WSL (Windows subsystem for Linux) and append a string
177+
# accordingly.
178+
#
179+
# If the kernel version string ends in "-Microsoft",
180+
# we're very likely running under Windows 10 in WSL.
181+
#
182+
# This also acts as a means of allowing the user to
183+
# fake this by changing their kernel version to end in
184+
# "Microsoft".
185+
[ "${kernel%%*-Microsoft}" ] ||
186+
distro="$distro on Windows 10"
174187
;;
175188

176189
Darwin*)

0 commit comments

Comments
 (0)