dylanaraps / pfetch

🐧 A pretty system information tool written in POSIX sh.
MIT License
2.06k stars 167 forks source link

macOS support #1

Closed elsorino closed 5 years ago

elsorino commented 5 years ago

Running script gives an error

./pfetch
./pfetch: line 239: syntax error near unexpected token `;;'
./pfetch: line 239: `            ;;'

In addition, here is the output of vm_stat

Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free:                             1118272.
Pages active:                           1060942.
Pages inactive:                          668196.
Pages speculative:                       755350.
Pages throttled:                              0.
Pages wired down:                        591235.
Pages purgeable:                          29929.
"Translation faults":                  42688398.
Pages copy-on-write:                    1035881.
Pages zero filled:                     32389026.
Pages reactivated:                         2512.
Pages purged:                             20942.
File-backed pages:                      1101425.
Anonymous pages:                        1383063.
Pages stored in compressor:                   0.
Pages occupied by compressor:                 0.
Decompressions:                               0.
Compressions:                                 0.
Pageins:                                2545623.
Pageouts:                                     0.
Swapins:                                      0.
Swapouts:                                     0.
dylanaraps commented 5 years ago

Thanks for opening this issue.

Can you test master and see if the error still appears?

dylanaraps commented 5 years ago

I've pushed memory support for macOS, please test it too. :+1:

fzxt commented 5 years ago

@dylanaraps getting the following on master on macOS

./pfetch: line 247: syntax error near unexpected token `;;'
./pfetch: line 247: `            ;;'
dylanaraps commented 5 years ago

What shell does macOS use for /bin/sh?

This should be somewhat telling: /bin/sh --help

dylanaraps commented 5 years ago

I've tested ash, dash and bash and can't reproduce this issue.

fzxt commented 5 years ago

I sympathize, seems weird

output from /bin/sh --help

bash-4.4$ /bin/sh --help
GNU bash, version 3.2.57(1)-release-(x86_64-apple-darwin18)
Usage:  /bin/sh [GNU long option] [option] ...
    /bin/sh [GNU long option] [option] script-file ...
GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --protected
    --rcfile
    --restricted
    --verbose
    --version
    --wordexp
Shell options:
    -irsD or -c command or -O shopt_option      (invocation only)
    -abefhkmnptuvxBCHP or -o option
Type `/bin/sh -c "help set"' for more information about shell options.
Type `/bin/sh -c help' for more information about shell builtin commands.
Use the `bashbug' command to report bugs.
dylanaraps commented 5 years ago

Ah, it's bash 3 acting as /bin/sh.

Let me build bash 3 and test.

dylanaraps commented 5 years ago

I can reproduce with bash 3:

-> pfetch
/home/goldie/.local/bin/pfetch: line 247: syntax error near unexpected token `;;'
/home/goldie/.local/bin/pfetch: line 247: `            ;;'
dylanaraps commented 5 years ago

Fixed the error.

dylanaraps commented 5 years ago

See: https://github.com/dylanaraps/pfetch/blob/master/pfetch#L227-L235

elsorino commented 5 years ago

Yep it works now, used memory is shown as 0 though

 ./pfetch
       .:'      elso@elsos-iMac.local
    _ :'_       os     macOS
 .'`_`-'_``.    host   iMac18,3
:________.-'    kernel 18.7.0
:_______:       uptime 20m
 :_______`-;    pkgs   93
  `._.-._.'     memory 0MiB / 16384MiB
dylanaraps commented 5 years ago

This is the code (ignore the EOF indentation, it's GitHub):

        # Used memory is calculated using the following "formula" (MacOS):
        # wired + active + occupied * 4 / 1024
        Darwin*)
            mem_full=$(($(sysctl -n hw.memsize) / 1024 / 1024))

            # Parse the 'vmstat' file splitting on ':' and '.'.
            # The format of the file is 'key:   000.' and an additional
            # split is used on '.' to filter it out.
            while IFS=:. read -r key val; do
                case $key in
                    *wired*|*active*|*occupied*)
                        mem_used=$((mem_used + ${val:-0}))
                    ;;
                esac

            # Using '<<-EOF' is the only way to loop over a command's
            # output without the use of a pipe ('|') or subshell.
            # This ensures that any variables defined in the while loop
            # are still accessible in the script.
            done <<-EOF
                $(vmstat)
            EOF

            mem_used=$((mem_used * 4 / 1024))
        ;;

From what I can see, this code should work.

dylanaraps commented 5 years ago

Oh, is it vm_stat and not vmstat?

dylanaraps commented 5 years ago

Try master now!

elsorino commented 5 years ago

Works perfectly now

./pfetch
       .:'      elso@elsos-iMac.local
    _ :'_       os     macOS
 .'`_`-'_``.    host   iMac18,3
:________.-'    kernel 18.7.0
:_______:       uptime 25m
 :_______`-;    pkgs   93
  `._.-._.'     memory 6735MiB / 16384MiB

Side note, is there intention to add hackintosh detection like neofetch has?

dylanaraps commented 5 years ago

Is there a simpler method of detection other than:

            if [[ "$(kextstat | grep -F -e "FakeSMC" -e "VirtualSMC")" != "" ]]; then
                model="Hackintosh (SMBIOS: $(sysctl -n hw.model))"

?

What's the full output of kextstat?

dylanaraps commented 5 years ago

A simpler method of retrieving this information would be handy too:

    if [[ "$kernel_name" == "Darwin" ]]; then
        IFS=$'\n' read -d "" -ra sw_vers <<< "$(awk -F'<|>' '/key|string/ {print $3}' \
                            "/System/Library/CoreServices/SystemVersion.plist")"
        for ((i=0;i<${#sw_vers[@]};i+=2)) {
            case ${sw_vers[i]} in
                ProductName)          darwin_name=${sw_vers[i+1]} ;;
                ProductVersion)       osx_version=${sw_vers[i+1]} ;;
                ProductBuildVersion)  osx_build=${sw_vers[i+1]}   ;;
            esac
        }
    fi
dylanaraps commented 5 years ago

There's:

% sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.4
BuildVersion: 14E101A

But how fast/slow is it to execute? time sw_vers?

fzxt commented 5 years ago

time sw_vers:

ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G95

real    0m0.017s
user    0m0.005s
sys 0m0.009s
dylanaraps commented 5 years ago

What about?:

time awk -F'<|>' '/key|string/ {print $3}' "/System/Library/CoreServices/SystemVersion.plist"
fzxt commented 5 years ago
ProductBuildVersion
18G95
ProductCopyright
1983-2019 Apple Inc.
ProductName
Mac OS X
ProductUserVisibleVersion
10.14.6
ProductVersion
10.14.6
iOSSupportVersion
12.3.1

real    0m0.005s
user    0m0.002s
sys 0m0.003s
dylanaraps commented 5 years ago

Nice.

Full output of cat /System/Library/CoreServices/SystemVersion.plist?

elsorino commented 5 years ago
Output of kextstat

``` kextstat Index Refs Address Size Wired Name (Version) UUID 1 97 0xffffff7f80c00000 0x9e50 0x9e50 com.apple.kpi.bsd (18.7.0) 569454DD-7267-48AD-A549-E70B93051D41 2 12 0xffffff7f810c5000 0x3900 0x3900 com.apple.kpi.dsep (18.7.0) E629FDD3-FC1D-46E4-9BD9-E6271AFDB035 3 116 0xffffff7f80c2a000 0x21be0 0x21be0 com.apple.kpi.iokit (18.7.0) B9BDF555-9EDF-4AED-9D68-FCFED9619425 4 0 0xffffff7f83f12000 0x34b0 0x34b0 com.apple.kpi.kasan (18.7.0) 958900E7-E2EE-4C01-A569-ACA79833E87E 5 123 0xffffff7f80c0a000 0xd540 0xd540 com.apple.kpi.libkern (18.7.0) C4982EB3-AC20-4397-AA54-52C19D78150C 6 109 0xffffff7f80c18000 0x3f60 0x3f60 com.apple.kpi.mach (18.7.0) 4D2C3D70-DCEE-4057-BF87-A6EB7D84A1C8 7 68 0xffffff7f80c1c000 0xd6d0 0xd6d0 com.apple.kpi.private (18.7.0) DEC2D286-9386-4298-B584-036CD09FC370 8 78 0xffffff7f80c8f000 0x5ed0 0x5ed0 com.apple.kpi.unsupported (18.7.0) DCA9B1DA-9DFB-4733-A600-DCA023C73E1C 9 8 0xffffff7f810c9000 0xba000 0xba000 com.apple.kec.corecrypto (1.0) 16D0DE4A-4774-32C4-B05D-D35601D9FC39 <8 7 6 5 3 1> 10 2 0xffffff7f829e6000 0x10000 0x10000 com.apple.kec.Libm (1) EF5A0705-9EFD-3232-A6B3-B61DCA161EA7 <5> 11 0 0xffffff7f831b1000 0xa000 0xa000 com.apple.kec.pthread (1) B29EB8C4-AB00-31D9-98C9-ECC62761A605 <8 7 6 5 3 1> 12 24 0xffffff7f8128a000 0x9000 0x9000 com.apple.iokit.IOACPIFamily (1.4) 3E8E9870-2E41-33F6-ACBF-35DDC08F22B5 <8 7 5 3> 13 32 0xffffff7f80c95000 0x36000 0x36000 com.apple.iokit.IOPCIFamily (2.9) BFDEB8D4-50FE-3DDB-87B7-F6A504393830 <8 7 6 5 3> 14 6 0xffffff7f81293000 0x1e000 0x1e000 com.apple.driver.AppleSMC (3.1.9) 0A338AA2-4958-384B-9941-59A96A38C42C <13 12 8 7 6 5 3 1> 15 1 0xffffff7f83253000 0x9c000 0x9c000 com.apple.driver.AppleACPIPlatform (6.1) F5A615E4-D5B8-3E06-A29F-F79EA07A15EF <14 13 12 8 7 6 5 3 1> 16 8 0xffffff7f80fb7000 0x30000 0x30000 com.apple.iokit.IONetworkingFamily (3.4) E04C914F-B8A8-3EBF-8D4A-E492DAD7A657 <8 7 6 5 3 1> 17 2 0xffffff7f80fee000 0x2d000 0x2d000 com.apple.iokit.IOTimeSyncFamily (740.2) FFFEE1AA-EBA2-3F01-8B09-6D2EC9030B20 <16 6 5 3 1> 18 3 0xffffff7f828b3000 0x7000 0x7000 com.apple.iokit.IOReportFamily (47) 0BC9F93B-456A-3D97-BE4C-69DCBB5E8A3C <6 5 3> 19 4 0xffffff7f829f6000 0x7000 0x7000 com.apple.driver.IOSlaveProcessor (1) 244F753E-D683-3D49-9161-39C69C912545 <5 3> 20 3 0xffffff7f83ca9000 0x18000 0x18000 com.apple.driver.AppleSEPManager (1.0.1) B2B33433-3492-3C98-90A1-15746564513D <19 13 9 8 7 6 5 3 1> 21 1 0xffffff7f812b3000 0x8000 0x8000 com.apple.driver.AppleBusPowerController (1.0) 3AF293C0-2A5D-3EB2-8518-9F096E1B9198 <14 12 7 6 5 3> 22 7 0xffffff7f812bb000 0x8000 0x8000 com.apple.driver.usb.AppleUSBCommon (1.0) FA45971B-83C4-3569-901E-749A36177C94 <6 5 3 1> 23 11 0xffffff7f812c3000 0x7a000 0x7a000 com.apple.iokit.IOUSBHostFamily (1.2) BD06015A-414D-34DF-BE36-7B9034D7360D <22 21 8 7 6 5 3 1> 24 3 0xffffff7f82e51000 0x1d000 0x1d000 com.apple.driver.KernelRelayHost (1) 2022DC75-7FEF-381F-BF4C-94667D323FA8 <23 6 5 3> 25 1 0xffffff7f83cd5000 0x45000 0x45000 com.apple.driver.AppleCredentialManager (1.0) F9848951-CCFA-34DC-8734-665B2BDA4888 <24 20 19 9 8 7 6 5 3 1> 26 2 0xffffff7f81183000 0xa000 0xa000 com.apple.kext.CoreTrust (1) 8FB05D33-57F2-3A26-93FE-5311D097097A <9 5> 27 8 0xffffff7f80f83000 0x28000 0x28000 com.apple.iokit.IOStorageFamily (2.1) 71BB22B0-3075-35A1-B04E-FBAC574DA80D <8 7 6 5 3 1> 28 3 0xffffff7f80c4c000 0x2b000 0x2b000 com.apple.iokit.IOSCSIArchitectureModelFamily (408.250.3) AC4EC757-066C-3DCC-A5E4-729C40FE1122 <7 6 5 3 1> 29 1 0xffffff7f82a1a000 0x19000 0x19000 com.apple.iokit.IOSCSIBlockCommandsDevice (408.250.3) FDFC6048-696F-333A-9A88-5C032B9EB3A5 <28 27 7 6 5 3 1> 30 1 0xffffff7f831d8000 0x2d000 0x2d000 com.apple.iokit.IOUSBMassStorageDriver (145.200.2) 10D00E14-59D6-3271-9B87-DF8C4393C7DD <28 27 23 7 6 5 3 1> 31 5 0xffffff7f8118d000 0x1d000 0x1d000 com.apple.driver.AppleMobileFileIntegrity (1.0.5) 1D716047-7F62-3FFA-8C01-26C166B3739A <26 9 8 7 6 5 3 2 1> 32 1 0xffffff7f8320c000 0x15000 0x15000 com.apple.driver.AppleUSBTDM (456.260.3) 06BF62CF-BFAF-36E5-B077-51BE6EFD129D <31 30 29 28 27 23 8 7 6 5 3 1> 33 0 0xffffff7f83d1c000 0x6c000 0x6c000 com.apple.driver.AppleKeyStore (2) 2A909B63-7771-3C63-A686-CD4B4EEA9E08 <32 31 26 25 24 20 19 9 8 7 6 5 3 1> 34 2 0xffffff7f8250f000 0xc000 0xc000 com.apple.driver.AppleEffaceableStorage (1.0) 10658FF3-EB34-3240-9E63-3FB47B9700FF <8 6 5 3 1> 35 0 0xffffff7f83df3000 0xc000 0xc000 com.apple.driver.AppleFDEKeyStore (28.30) 8643062A-676E-3DD4-9A8F-EEE29FE4AC7D <34 9 8 7 6 5 3 1> 36 0 0xffffff7f84294000 0x19000 0x19000 com.apple.driver.DiskImages (493.0.0) ECEBC905-AB56-31FD-8C54-21C8E999A165 <27 8 7 6 5 3 1> 37 0 0xffffff7f85656000 0x4000 0x4000 com.rehabman.driver.USBInjectAll (0.7.1) 88901B62-E4A2-3374-A33C-873C8BC29F9C <13 12 5 3> 38 1 0xffffff7f8565b000 0x22000 0x22000 as.vit9696.Lilu (1.3.8) FC38993B-FBDB-3E9A-AC3E-73704D26ACF6 <8 6 5 3 2 1> 39 0 0xffffff7f8567d000 0x120000 0x120000 as.vit9696.AppleALC (1.4.1) 643175DA-A09A-3A9A-9C1C-3C0A8A573B85 <38 13 8 6 5 3 2 1> 40 2 0xffffff7f811aa000 0x5000 0x5000 com.apple.kext.AppleMatch (1.0.0d1) 68C4CE89-1070-3D54-B5D7-C9EABEE393F8 <5 1> 41 2 0xffffff7f811af000 0x31000 0x31000 com.apple.security.sandbox (300.0) 02A9659F-52A4-3BD8-85EF-5325FF6EF0EE <40 31 27 8 7 6 5 3 2 1> 42 1 0xffffff7f811e0000 0x8000 0x8000 com.apple.security.quarantine (3) 3163A9E7-AEF4-3C89-AB9D-6E25A9BB25F8 <41 40 8 7 6 5 2 1> 43 0 0xffffff7f84291000 0x2000 0x2000 com.apple.security.TMSafetyNet (8) 4EE213F8-6233-3394-A7BD-82C7836351B9 <8 7 6 5 2 1> 44 0 0xffffff7f84386000 0x9000 0x9000 com.apple.nke.applicationfirewall (201) 03E35AA2-EEF9-35A5-946E-C5AFD5DCEF3B <8 7 6 5 3 1> 45 0 0xffffff7f84489000 0x3000 0x3000 com.apple.driver.AppleAPIC (1.7) 11588E04-78B2-398C-9651-CFE08B2003C5 <13 5 3> 46 0 0xffffff7f83c8d000 0x4000 0x4000 com.apple.driver.AppleSMBIOS (2.1) 48329F64-23D4-398A-A169-1E8F7940B4AE <8 5 3> 47 0 0xffffff7f840af000 0x3000 0x3000 com.apple.driver.AppleHPET (1.8) 77230D9E-AC65-31CF-B159-0595927A9BF7 <12 8 6 5 3> 48 3 0xffffff7f811f5000 0x7f000 0x7f000 com.apple.iokit.IOHIDFamily (2.0.0) 4D861DA4-FE3A-3D9D-8123-038E9FBFE182 <8 7 6 5 3 2 1> 49 0 0xffffff7f83302000 0x4000 0x4000 com.apple.driver.AppleACPIButtons (6.1) 68E83114-84B1-343A-8BA9-C747F745BF2F <48 18 15 12 8 7 6 5 3 1> 50 0 0xffffff7f82e46000 0x8000 0x8000 com.apple.driver.AppleRTC (2.0) FCF912D2-E98B-318E-B6E5-B9BC91307D76 <12 8 6 5 3 1> 51 1 0xffffff7f821c0000 0x5000 0x5000 com.apple.driver.AppleEFIRuntime (2.1) A300E812-BACC-30FC-B394-0D932CE4DAEE <8 7 6 5 3> 52 0 0xffffff7f8579d000 0xb000 0xb000 org.netkas.FakeSMC (3.5.2) 6278FBFB-B844-3B87-AB22-082386772375 <12 8 6 5 3> 53 2 0xffffff7f821c5000 0xb000 0xb000 com.apple.driver.AppleEFINVRAM (2.1) B83F29B8-24AC-303B-BBBA-CF332168FDE6 <51 8 7 6 5 3 1> 54 0 0xffffff7f8444c000 0x3000 0x3000 com.apple.private.KextAudit (1.0) 6E0EFF07-77B5-3FB1-83BD-5EFFD9E2F851 <14 8 7 6 5 3> 55 1 0xffffff7f82327000 0x56000 0x56000 com.apple.driver.usb.AppleUSBXHCI (1.2) E5C347ED-E207-3FEF-8270-9B2904BA7653 <23 22 12 8 7 6 5 3 1> 56 0 0xffffff7f82453000 0x2f000 0x2f000 com.apple.driver.usb.AppleUSBXHCIPCI (1.2) 14F9335D-653F-39F8-A910-03B646120303 <55 23 22 13 12 8 7 6 5 3 1> 57 2 0xffffff7f833a1000 0x1a000 0x1a000 com.apple.iokit.IOAHCIFamily (288) B7178C43-012A-31E1-AE28-746CEAAC690E <6 5 3 1> 58 0 0xffffff7f8426e000 0x14000 0x14000 com.apple.driver.AppleAHCIPort (329.260.5) 6E7BDACD-4241-3EE4-B78B-443ADD38F452 <57 13 6 5 3 1> 59 0 0xffffff7f857a8000 0x67000 0x67000 com.insanelymac.RealtekRTL8111 (2.2.1) 07D64653-7867-3C3A-837B-E491B33C21B7 <16 13 6 5 3 1> 60 0 0xffffff7f833cb000 0x28000 0x28000 com.apple.iokit.IOAHCIBlockStorage (301.270.1) CA0640F1-A3C6-37DB-BEFE-79647B21C283 <57 53 27 7 6 5 3 1> 62 2 0xffffff7f828cb000 0x102000 0x102000 com.apple.filesystems.apfs (945.275.7) ACFDCC84-EBFD-376E-8361-B16CC6CAF740 <34 27 9 8 7 6 5 3 1> 63 3 0xffffff7f8135e000 0x9a000 0x9a000 com.apple.iokit.IOUSBFamily (900.4.2) C08AA22E-A406-39A6-BF36-A93C30CDD6D1 <23 22 13 8 6 5 3 1> 64 0 0xffffff7f8244e000 0x5000 0x5000 com.apple.driver.usb.AppleUSBHostPacketFilter (1.0) DF6A1255-43D4-3559-9005-940C05736061 <23 22 8 7 6 5 3 1> 65 0 0xffffff7f811e8000 0x8000 0x8000 com.apple.AppleSystemPolicy (1.0) 867DFBBC-98E5-3B1F-94B8-CDB914C11383 <42 41 31 8 7 6 5 3 2 1> 66 1 0xffffff7f821dd000 0x8000 0x8000 com.apple.filesystems.hfs.encodings.kext (1) F76AF156-5151-3B21-98A6-E23A826FCDAE <8 7 6 5 3 1> 67 0 0xffffff7f8225f000 0xd000 0xd000 com.apple.AppleFSCompression.AppleFSCompressionTypeZlib (1.0.0) 1D7FD955-A278-3BB0-B0A4-14DBB18A3555 <7 5 3 2 1> 68 0 0xffffff7f82cda000 0x10000 0x10000 com.apple.BootCache (40) 9BF4FEE0-95F9-3CC6-AB24-87B6540DF1CD <8 7 6 5 3 1> 69 0 0xffffff7f83628000 0x3000 0x3000 com.apple.AppleFSCompression.AppleFSCompressionTypeDataless (1.0.0d1) 876F3AAE-F974-35C3-B958-D50B078079A3 <8 7 5 3 2 1> 70 0 0xffffff7f840b4000 0x68000 0x68000 com.apple.filesystems.hfs.kext (407.200.4) 12725927-ECEC-3C53-AC40-B7713D6D78AB <66 8 7 6 5 3 1> 71 3 0xffffff7f833f7000 0xe000 0xe000 com.apple.iokit.IOSerialFamily (11) E65B3C11-3495-3A4B-B2A3-88202EAA7466 <8 7 6 5 3 1> 72 0 0xffffff7f842ed000 0x13000 0x13000 com.apple.driver.AppleVirtIO (2.1.3) 8A8A046D-6551-3812-98A2-EDAEC937B13E <71 27 13 6 5 3 1> 74 0 0xffffff7f81345000 0x8000 0x8000 com.apple.driver.usb.AppleUSBHostCompositeDevice (1.2) 7B91C916-590C-3850-BE30-8B73C1B830EC <23 22 7 6 5 3 1> 75 0 0xffffff7f8228b000 0x8000 0x8000 com.apple.driver.usb.networking (5.0.0) 7E80C29C-03A4-364F-934C-A556ADC9F04E <23 7 6 5 3 1> 77 1 0xffffff7f82446000 0x4000 0x4000 com.apple.driver.AppleUSBHostMergeProperties (1.2) B7BBAFAC-C52A-361B-AB26-1ED5F0307499 <5 3 1> 78 2 0xffffff7f82a3c000 0xd0000 0xd0000 com.apple.vecLib.kext (1.2.0) 154A1DE0-6A35-3208-B356-1E5F49868336 <10 7 6 5 3> 79 5 0xffffff7f82b0c000 0x3f000 0x3f000 com.apple.iokit.IOAudioFamily (206.5) 63F5D76B-9DD5-3740-9415-798E8DCB52FC <78 6 5 3 1> 80 0 0xffffff7f8134d000 0xc000 0xc000 com.apple.driver.usb.IOUSBHostHIDDevice (1.2) ABDA1D73-0350-3F07-84A1-D51E51AD6F33 <48 23 22 6 5 3 1> 82 0 0xffffff7f8140a000 0xa51000 0xa51000 com.realtek.driver.RtWlanU (1830.20.b23) 2C48F324-228F-3593-986C-25E06117F9F8 <63 16 6 5 3 1> 83 1 0xffffff7f8223e000 0x5000 0x5000 com.apple.iokit.IOSlowAdaptiveClockingFamily (1.0.0) 249C8C73-2F5F-330F-8D89-31DD1DBDB741 <8 7 6 5 3 1> 84 0 0xffffff7f83f2b000 0x2000 0x2000 com.apple.driver.AppleIntelSlowAdaptiveClocking (4.0.0) 31CC5B50-17C2-3747-A465-2129C7CE963A <83 5 3> 85 16 0xffffff7f821e5000 0x4c000 0x4c000 com.apple.iokit.IOGraphicsFamily (530.66) 373EAB85-2C5F-3B84-B86D-421F79C47DF2 <13 8 6 5 3 1> 86 5 0xffffff7f8251b000 0xa000 0xa000 com.apple.AppleGraphicsDeviceControl (3.50.12) 5334847D-B612-3E8C-88A3-C2A5853675CD <85 13 8 7 6 5 3 1> 87 0 0xffffff7f82543000 0xd000 0xd000 com.apple.AppleGPUWrangler (3.50.12) B3913C1D-A3A7-3541-A899-E302C766950F <86 85 13 8 7 6 5 3 1> 88 2 0xffffff7f8258b000 0x202000 0x202000 com.apple.kext.AMDSupport (2.1.1) 863E08D0-EF33-371E-B393-2C9E981CCE4D <86 85 13 12 8 6 5 3 1> 89 0 0xffffff7f827ac000 0x77000 0x77000 com.apple.kext.AMD9500Controller (2.1.1) D2EE149C-AE6D-3189-B62E-5D182E7F97CE <88 86 85 13 12 6 5 3 1> 90 2 0xffffff7f8330a000 0xa000 0xa000 com.apple.driver.IOPlatformPluginFamily (6.0.0d8) 3853637B-C980-3A9D-8E4A-AB9202C9432A <12 8 7 6 5 3> 91 1 0xffffff7f83314000 0x12000 0x12000 com.apple.driver.IOPlatformPluginLegacy (1.0.0) 2FC6A89A-DAF5-30A4-AAC5-E1FE3F01BC7F <90 12 8 7 6 5 3> 92 0 0xffffff7f83328000 0x10000 0x10000 com.apple.driver.ACPI_SMC_PlatformPlugin (1.0.0) 1A7A54C3-8FE2-302B-810A-57AA1D8C7D5E <91 90 14 13 12 8 7 6 5 3> 94 2 0xffffff7f82ea3000 0x10000 0x10000 com.apple.iokit.IONDRVSupport (530.51) D8CFB89E-3E74-3E49-9ED0-BD2F34A1B31A <85 13 8 6 5 3> 95 0 0xffffff7f843a4000 0x73000 0x73000 com.apple.driver.AppleGFXHDA (100.1.414) 5265FEDA-2514-35FE-A458-8F6BA345F2B5 <94 85 79 13 8 7 6 5 3 1> 97 0 0xffffff7f84135000 0x5000 0x5000 com.apple.Dont_Steal_Mac_OS_X (7.0.0) 770F366C-A027-39FD-A618-BFAF66C67202 <14 9 8 5 3 1> 98 0 0xffffff7f8407a000 0x15000 0x15000 com.apple.driver.pmtelemetry (1) E23282D6-32BF-3206-BC26-A9A40A4A91AE <8 7 6 5 3 1> 99 0 0xffffff7f8349c000 0xf9000 0xf9000 com.apple.iokit.IOBluetoothFamily (6.0.14d3) CDFAFD8A-7E75-3145-BC93-36196CEBA938 <23 18 12 8 7 6 5 3 1> 100 2 0xffffff7f82e71000 0xc000 0xc000 com.apple.iokit.IOHDAFamily (282.54) 039FEBA2-827D-3E0E-93FC-35CF5107EA15 <6 5 3 1> 101 1 0xffffff7f82e80000 0x1d000 0x1d000 com.apple.driver.AppleHDAController (282.54) E00FE0E4-B03D-34C5-8DC9-39C7D8D50B6B <100 85 79 13 8 7 6 5 3 1> 102 1 0xffffff7f83408000 0xf000 0xf000 com.apple.driver.Apple16X50Serial (3.2) AA857D04-87C2-3D29-8C80-15CFA7F2A339 <71 13 6 5 3> 103 0 0xffffff7f83417000 0x2000 0x2000 com.apple.driver.Apple16X50ACPI (3.2) B5570F1A-28C4-3696-B03F-25924EC880E6 <102 12 5 3> 104 0 0xffffff7f83ec0000 0x4000 0x4000 com.apple.driver.AppleOSXWatchdog (1) 7797FC09-DA45-3586-A426-05DDA3DD501D <13 8 7 6 5 3 1> 105 0 0xffffff7f8403f000 0xa000 0xa000 com.apple.iokit.IOBluetoothSerialManager (6.0.14d3) AAD8D8C3-300F-38F7-851E-BDA57B0CC4FC <71 8 6 5 3 1> 106 2 0xffffff7f8362f000 0x22000 0x22000 com.apple.iokit.IOSurface (255.6.1) 263BDC28-38C8-3995-BB6B-AD419E41C2DC <8 7 6 5 3 1> 107 0 0xffffff7f83d88000 0xd000 0xd000 com.apple.driver.AppleSSE (1.0) A45713C2-5CD4-327F-AE80-56BB0A41C671 <24 20 19 8 6 5 3 1> 108 0 0xffffff7f83c93000 0x6000 0x6000 com.apple.iokit.IOUserEthernet (1.0.1) 5DF7BD13-5DC2-397A-AA7B-A0D1441C0E2F <16 7 6 5 3 1> 109 0 0xffffff7f83486000 0x9000 0x9000 com.apple.driver.AppleHV (1) 1BD25A00-81B9-3EA8-A038-25D1780AFE9C <8 7 6 5 3 1> 110 1 0xffffff7f82bc1000 0x2c000 0x2c000 com.apple.iokit.IOSkywalkFamily (1) 86763C0C-E3E8-3705-B96F-86D0D0130C8B <16 7 6 5 3 1> 111 2 0xffffff7f82bf6000 0x7000 0x7000 com.apple.iokit.IOEthernetAVBController (1.1.0) 241B1EFD-6AB5-361B-B525-13C1BC687160 <16 6 5 3 1> 112 1 0xffffff7f82bfd000 0xa5000 0xa5000 com.apple.plugin.IOgPTPPlugin (740.2) 63086EBC-FAD9-3025-87FB-C04C44E08F9F <111 110 48 17 16 10 7 6 5 3 1> 113 0 0xffffff7f82cb5000 0x23000 0x23000 com.apple.iokit.IOAVBFamily (760.6) C94BA466-C3FB-3013-9A78-DA7409F1AB2C <112 111 17 16 7 6 5 3 1> 114 0 0xffffff7f82527000 0x3000 0x3000 com.apple.AGDCPluginDisplayMetrics (3.50.12) 4AAA0ED5-3161-348A-83EC-1A4407BF844F <86 8 7 6 5 3 1> 115 1 0xffffff7f8252b000 0x3000 0x3000 com.apple.driver.AppleGraphicsControl (3.50.12) D9F4AE86-377F-3405-910B-CE710343F052 <8 6 5 3 1> 116 0 0xffffff7f8252e000 0x13000 0x13000 com.apple.driver.AppleGraphicsDevicePolicy (3.50.12) A816437B-4D0D-3532-8314-AC3556260AA6 <115 86 85 13 12 8 7 6 5 3 1> 117 0 0xffffff7f85634000 0x11000 0x11000 com.apple.kext.AMDRadeonX4000HWServices (2.1.1) 9C44679E-3516-30D1-A739-61608E238671 <85 13 12 8 6 5 3 1> 118 1 0xffffff7f83653000 0xa7000 0xa7000 com.apple.iokit.IOAcceleratorFamily2 (404.14) 618B24B5-1387-31FD-A7F7-53283E2C3FEA <106 85 31 18 13 8 7 6 5 3 1> 119 0 0xffffff7f8370a000 0x440000 0x440000 com.apple.kext.AMDRadeonX4000 (2.1.1) 25F10272-62BF-31EF-813B-A3622258B230 <118 106 85 13 8 6 5 3 1> 120 0 0xffffff7f8448e000 0x1194000 0x1194000 com.apple.kext.AMDRadeonX4000HWLibs (1.0) 6AEE0B1D-E01F-35C3-81EC-375CE2172909 <13 6 5 3 1> 121 0 0xffffff7f83db4000 0x2a000 0x2a000 com.apple.kext.AMDFramebuffer (2.1.1) 944BF3CB-3F16-3A7C-9CBE-93E411897E94 <88 85 13 12 8 6 5 3 1> 122 1 0xffffff7f82eb3000 0x13000 0x13000 com.apple.kext.OSvKernDSPLib (528) FAF1FA70-450F-3F87-BB36-7C583BB7D0C3 <6 5> 123 1 0xffffff7f82ec6000 0x141000 0x141000 com.apple.driver.DspFuncLib (282.54) 6BAC2DE8-E8A3-3FD5-B2F3-79C1476D1147 <122 79 78 53 7 6 5 3 1> 124 0 0xffffff7f83012000 0xb7000 0xb7000 com.apple.driver.AppleHDA (282.54) 88BFC11D-179D-3546-A3C9-B542C9127590 <123 101 100 94 85 79 7 6 5 3 1> 125 1 0xffffff7f831bb000 0x4000 0x4000 com.apple.iokit.IOSMBusFamily (1.1) 57451E9D-A49B-3CCC-A716-42813985D023 <6 5 3> 126 1 0xffffff7f8404f000 0xe000 0xe000 com.apple.driver.AppleSMBusController (1.0.18d1) 0DCB5FF7-6E88-349E-A877-484547FA84BE <125 13 12 6 5 3> 127 0 0xffffff7f84060000 0xf000 0xf000 com.apple.driver.AppleMCCSControl (1.5.9) 0B6A8DCF-F4A8-3A57-9C22-D2583680994D <126 85 14 13 12 8 6 5 3 1> 128 0 0xffffff7f83da5000 0x5000 0x5000 com.apple.driver.AppleUpstreamUserClient (3.6.5) 88B9F9BD-39C8-3FA5-88F9-534D0D07AB3E <85 13 12 8 6 5 3 1> 130 1 0xffffff7f83f1b000 0x5000 0x5000 com.apple.kext.triggers (1.0) 62782675-1243-31AB-BDD6-2ACF400E4937 <8 7 6 5 3 1> 131 0 0xffffff7f83f20000 0x9000 0x9000 com.apple.filesystems.autofs (3.0) C416EE29-CDB1-3DFF-87A0-DBCCAF0AC9FA <130 8 7 6 5 3 2 1> 132 3 0xffffff7f8580f000 0xf0000 0xf0000 org.virtualbox.kext.VBoxDrv (6.0.12) 79AB3317-5F6D-3FE0-965C-92E45277AA0D <8 6 5 3 1> 133 1 0xffffff7f831ae000 0x3000 0x3000 com.apple.iokit.IOUSBUserClient (900.4.2) 098AB795-2FBB-3747-8224-F51970375176 <77 63 8 6 5 3 1> 134 0 0xffffff7f858ff000 0x8000 0x8000 org.virtualbox.kext.VBoxUSB (6.0.12) B1285DF7-2D17-3497-A948-40825951123A <133 132 63 8 6 5 3 1> 135 0 0xffffff7f85907000 0x5000 0x5000 org.virtualbox.kext.VBoxNetFlt (6.0.12) C1B5DFEA-CB4C-30BD-9A92-C92391F7BDE0 <132 8 6 5 3 1> 136 0 0xffffff7f8226f000 0x18000 0x18000 com.apple.fileutil (20.036.15) 29CED6F2-03E0-3AD6-AC91-DF326B3C73A5 <6 5 3 2 1> 137 0 0xffffff7f8590c000 0x6000 0x6000 org.virtualbox.kext.VBoxNetAdp (6.0.12) F8D3E46F-C4EA-397A-ACB1-EF2BF77C0506 <132 6 5 1> 138 0 0xffffff7f84232000 0x5000 0x5000 com.apple.driver.AudioAUUC (1.70) 1B5B8218-0479-3087-A3B6-F2BD73DDCDE5 <85 79 13 12 8 6 5 3 1> ```

fzxt commented 5 years ago

cat /System/Library/CoreServices/SystemVersion.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string>18G95</string>
    <key>ProductCopyright</key>
    <string>1983-2019 Apple Inc.</string>
    <key>ProductName</key>
    <string>Mac OS X</string>
    <key>ProductUserVisibleVersion</key>
    <string>10.14.6</string>
    <key>ProductVersion</key>
    <string>10.14.6</string>
    <key>iOSSupportVersion</key>
    <string>12.3.1</string>
</dict>
</plist>
dylanaraps commented 5 years ago

Added proper macOS detection: https://github.com/dylanaraps/pfetch/blob/master/pfetch#L126-L166

Please try it out. Working on Hackintosh detection now.

dylanaraps commented 5 years ago

@elsorino time kextstat?

dylanaraps commented 5 years ago

Is the Hackintosh detection even reliable? From what I'm reading online it isn't. I think it's better we leave it to Neofetch.

dylanaraps commented 5 years ago

If the new distribution detection works I'll go ahead and close this. Let me know :+1:

elsorino commented 5 years ago

Looks like some extras were left in 18G95?

       .:'      elso@elsos-iMac.local
    _ :'_       os     macOS Mojave 10.14.6 18G95
 .'`_`-'_``.    host   iMac18,3
:________.-'    kernel 18.7.0
:_______:       uptime 1h 47m
 :_______`-;    pkgs   97
  `._.-._.'     memory 7974MiB / 16384MiB
dylanaraps commented 5 years ago

That's:

ProductBuildVersion
18G95

Should I omit it?

dylanaraps commented 5 years ago

Fixed.

elsorino commented 5 years ago
       .:'      elso@elsos-iMac.local
    _ :'_       os     macOS Mojave 10.14.6
 .'`_`-'_``.    host   iMac18,3
:________.-'    kernel 18.7.0
:_______:       uptime 1h 59m
 :_______`-;    pkgs   97
  `._.-._.'     memory 8451MiB / 16384MiB

Working good now!