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

Add support for Windows 10/11 distinction #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pfetch
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,12 @@ get_os() {
# If the kernel version string ends in "-Microsoft",
# we're very likely running under Windows 10 in WSL1.
if [ "$WSLENV" ]; then
distro="${distro}${WSLENV+ on Windows 10 [WSL2]}"
# If we are on WSL2 then we can use interop to
# find out if it is win 10 or win 11
# FIXME: we are assuming windows is mount on /c/
# and system have 'tr'
winver=$(/mnt/c/Windows/System32/wbem/wmic.exe os get Caption | grep -i windows | tr -d '\r')
distro="${distro}${WSLENV+ on ${winver} [WSL2]}"

# Check to see if Linux is running in Windows 10 under
# WSL2 (Windows subsystem for Linux [version 2]) and
Expand Down