fastfetch-cli / fastfetch

A maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10.94k stars 423 forks source link

macOS support #222

Closed CarterLi closed 2 years ago

CarterLi commented 2 years ago

General description of bug:

Often helpful questions:

Output of fastfetch --version:

fastfetch 1.7.0

Output of fastfetch --load-config devinfo:

Error: couldn't find config: devinfo

Output of fastfetch --load-config devinfo-verbose:

Error: couldn't find config: devinfo-verbose

Output of fastfetch --list-features:

*empty*
$ ./run.sh

exec: Failed to execute process '/Users/carter/fastfetch/run.sh': The file specified the interpreter '/bin/env sh', which is not an executable command.

If run with bash run.sh

-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Looking for sys/sysinfo.h
-- Looking for sys/sysinfo.h - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/carter/fastfetch/build
[  1%] Building C object CMakeFiles/libfastfetch.dir/src/util/FFvaluestore.c.o
[  4%] Building C object CMakeFiles/libfastfetch.dir/src/util/FFlist.c.o
[  4%] Building C object CMakeFiles/libfastfetch.dir/src/common/init.c.o
[  6%] Building C object CMakeFiles/libfastfetch.dir/src/common/io.c.o
[  6%] Building C object CMakeFiles/libfastfetch.dir/src/util/FFstrbuf.c.o
[  7%] Building C object CMakeFiles/libfastfetch.dir/src/common/caching.c.o
[  8%] Building C object CMakeFiles/libfastfetch.dir/src/common/printing.c.o
[ 11%] Building C object CMakeFiles/libfastfetch.dir/src/common/properties.c.o
[ 11%] Building C object CMakeFiles/libfastfetch.dir/src/common/processing.c.o
[ 12%] Building C object CMakeFiles/libfastfetch.dir/src/common/font.c.o
[ 13%] Building C object CMakeFiles/libfastfetch.dir/src/common/format.c.o
[ 14%] Building C object CMakeFiles/libfastfetch.dir/src/common/parsing.c.o
[ 16%] Building C object CMakeFiles/libfastfetch.dir/src/common/settings.c.o
[ 17%] Building C object CMakeFiles/libfastfetch.dir/src/common/library.c.o
[ 18%] Building C object CMakeFiles/libfastfetch.dir/src/common/networking.c.o
[ 20%] Building C object CMakeFiles/libfastfetch.dir/src/logo/builtin.c.o
[ 20%] Building C object CMakeFiles/libfastfetch.dir/src/logo/image/image.c.o
[ 22%] Building C object CMakeFiles/libfastfetch.dir/src/logo/logo.c.o
[ 23%] Building C object CMakeFiles/libfastfetch.dir/src/logo/image/im7.c.o
[ 24%] Building C object CMakeFiles/libfastfetch.dir/src/logo/image/im6.c.o
[ 25%] Building C object CMakeFiles/libfastfetch.dir/src/detection/qt.c.o
[ 27%] Building C object CMakeFiles/libfastfetch.dir/src/detection/gtk.c.o
[ 30%] Building C object CMakeFiles/libfastfetch.dir/src/detection/datetime.c.o
[ 30%] Building C object CMakeFiles/libfastfetch.dir/src/detection/media.c.o
[ 30%] Building C object CMakeFiles/libfastfetch.dir/src/detection/terminalShell.c.o
[ 32%] Building C object CMakeFiles/libfastfetch.dir/src/detection/vulkan.c.o
[ 33%] Building C object CMakeFiles/libfastfetch.dir/src/detection/temps.c.o
[ 34%] Building C object CMakeFiles/libfastfetch.dir/src/detection/title.c.o
[ 35%] Building C object CMakeFiles/libfastfetch.dir/src/detection/host/host.c.o
[ 37%] Building C object CMakeFiles/libfastfetch.dir/src/detection/os/os.c.o
[ 39%] Building C object CMakeFiles/libfastfetch.dir/src/detection/cpu/cpu.c.o
[ 39%] Building C object CMakeFiles/libfastfetch.dir/src/detection/gpu/gpu.c.o
[ 40%] Building C object CMakeFiles/libfastfetch.dir/src/detection/memory/memory.c.o
[ 41%] Building C object CMakeFiles/libfastfetch.dir/src/detection/displayserver/displayserver.c.o
[ 43%] Building C object CMakeFiles/libfastfetch.dir/src/modules/break.c.o
[ 45%] Building C object CMakeFiles/libfastfetch.dir/src/modules/custom.c.o
[ 45%] Building C object CMakeFiles/libfastfetch.dir/src/modules/title.c.o
[ 46%] Building C object CMakeFiles/libfastfetch.dir/src/modules/separator.c.o
[ 48%] Building C object CMakeFiles/libfastfetch.dir/src/modules/os.c.o
[ 49%] Building C object CMakeFiles/libfastfetch.dir/src/modules/host.c.o
[ 51%] Building C object CMakeFiles/libfastfetch.dir/src/modules/kernel.c.o
[ 51%] Building C object CMakeFiles/libfastfetch.dir/src/modules/uptime.c.o
[ 53%] Building C object CMakeFiles/libfastfetch.dir/src/modules/processes.c.o
[ 54%] Building C object CMakeFiles/libfastfetch.dir/src/modules/packages.c.o
[ 55%] Building C object CMakeFiles/libfastfetch.dir/src/modules/shell.c.o
[ 56%] Building C object CMakeFiles/libfastfetch.dir/src/modules/resolution.c.o
[ 58%] Building C object CMakeFiles/libfastfetch.dir/src/modules/de.c.o
[ 59%] Building C object CMakeFiles/libfastfetch.dir/src/modules/wm.c.o
[ 60%] Building C object CMakeFiles/libfastfetch.dir/src/modules/wmtheme.c.o
[ 61%] Building C object CMakeFiles/libfastfetch.dir/src/modules/theme.c.o
[ 64%] Building C object CMakeFiles/libfastfetch.dir/src/modules/icons.c.o
[ 64%] Building C object CMakeFiles/libfastfetch.dir/src/modules/font.c.o
[ 65%] Building C object CMakeFiles/libfastfetch.dir/src/modules/cursor.c.o
[ 66%] Building C object CMakeFiles/libfastfetch.dir/src/modules/terminal.c.o
[ 67%] Building C object CMakeFiles/libfastfetch.dir/src/modules/terminalfont.c.o
[ 70%] Building C object CMakeFiles/libfastfetch.dir/src/modules/cpuUsage.c.o
[ 70%] Building C object CMakeFiles/libfastfetch.dir/src/modules/gpu.c.o
[ 71%] Building C object CMakeFiles/libfastfetch.dir/src/modules/cpu.c.o
[ 72%] Building C object CMakeFiles/libfastfetch.dir/src/modules/memory.c.o
[ 74%] Building C object CMakeFiles/libfastfetch.dir/src/modules/battery.c.o
[ 75%] Building C object CMakeFiles/libfastfetch.dir/src/modules/disk.c.o
[ 76%] Building C object CMakeFiles/libfastfetch.dir/src/modules/locale.c.o
[ 77%] Building C object CMakeFiles/libfastfetch.dir/src/modules/vulkan.c.o
[ 79%] Building C object CMakeFiles/libfastfetch.dir/src/modules/localip.c.o
[ 80%] Building C object CMakeFiles/libfastfetch.dir/src/modules/publicip.c.o
[ 81%] Building C object CMakeFiles/libfastfetch.dir/src/modules/song.c.o
[ 82%] Building C object CMakeFiles/libfastfetch.dir/src/modules/player.c.o
[ 83%] Building C object CMakeFiles/libfastfetch.dir/src/modules/datetime.c.o
[ 85%] Building C object CMakeFiles/libfastfetch.dir/src/modules/date.c.o
[ 86%] Building C object CMakeFiles/libfastfetch.dir/src/modules/time.c.o
[ 87%] Building C object CMakeFiles/libfastfetch.dir/src/modules/colors.c.o
[ 88%] Building C object CMakeFiles/libfastfetch.dir/src/modules/opengl.c.o
[ 90%] Building C object CMakeFiles/libfastfetch.dir/src/modules/opencl.c.o
[ 91%] Building C object CMakeFiles/libfastfetch.dir/src/detection/host/host_apple.c.o
[ 92%] Building C object CMakeFiles/libfastfetch.dir/src/detection/os/os_apple.c.o
[ 93%] Building C object CMakeFiles/libfastfetch.dir/src/detection/cpu/cpu_apple.c.o
[ 95%] Building C object CMakeFiles/libfastfetch.dir/src/detection/gpu/gpu_apple.c.o
[ 96%] Building C object CMakeFiles/libfastfetch.dir/src/detection/memory/memory_apple.c.o
[ 97%] Building C object CMakeFiles/libfastfetch.dir/src/detection/displayserver/displayserver_apple.c.o
/Users/carter/fastfetch/src/detection/gpu/gpu_apple.c:17:35: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
    FF_LIBRARY_LOAD_SYMBOL(iokit, kIOMasterPortDefault, )
                                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
                  ^
1 warning generated.
[ 97%] Built target libfastfetch
[ 98%] Building C object CMakeFiles/fastfetch.dir/src/fastfetch.c.o
[100%] Linking C executable fastfetch
[100%] Built target fastfetch
                     c.'          carter@litongzhoudeMacBook-Pro.local
                 ,xNMM.           ------------------------------------
               .OMMMMo            OS: macOS 12.5.1 arm64
               lMM"               Host: MacBookPro18,1
     .;loddo:.  .olloddol;.       Kernel: 21.6.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:     Uptime: 57 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.     Shell: fish 3.5.1
 XMMMMMMMMMMMMMMMMMMMMMMMX.       Resolution 1: 1728x1117 @ 120Hz
;MMMMMMMMMMMMMMMMMMMMMMMM:        Resolution 2: 2560x1440 @ 60Hz
:MMMMMMMMMMMMMMMMMMMMMMMM:        DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.       WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.     Terminal: iTerm.app
 'XMMMMMMMMMMMMMMMMMMMMMMMMMMk    CPU: Apple M1 Pro (10)
fastfetch(8722,0x102ca0580) malloc: Non-aligned pointer 0x102b2fc51 being freed
fastfetch(8722,0x102ca0580) malloc: *** set a breakpoint in malloc_error_break to debug
run.sh:行 11:  8722 Abort trap: 6           ./fastfetch "$@"
CarterLi commented 2 years ago

LLDB

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001c343ed98 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1c343ed98 <+8>:  b.lo   0x1c343edb8               ; <+40>
    0x1c343ed9c <+12>: pacibsp
    0x1c343eda0 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1c343eda4 <+20>: mov    x29, sp
Target 0: (fastfetch) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00000001c343ed98 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x00000001c3473ee0 libsystem_pthread.dylib`pthread_kill + 288
    frame #2: 0x00000001c33ae340 libsystem_c.dylib`abort + 168
    frame #3: 0x00000001c32908c0 libsystem_malloc.dylib`malloc_vreport + 552
    frame #4: 0x00000001c32a5c84 libsystem_malloc.dylib`malloc_zone_error + 100
    frame #5: 0x00000001c3287088 libsystem_malloc.dylib`szone_free + 664
    frame #6: 0x00000001c34bf768 CoreFoundation`__CFStringCreateImmutableFunnel3 + 1588
    frame #7: 0x00000001c3517c84 CoreFoundation`CFStringCreateWithCStringNoCopy + 100
    frame #8: 0x000000010001a0f8 fastfetch`ffDetectGPUImpl + 788
    frame #9: 0x00000001000123f4 fastfetch`ffDetectGPU + 152
    frame #10: 0x0000000100017558 fastfetch`ffPrintGPU + 128
    frame #11: 0x00000001000014ec fastfetch`parseStructureCommand + 868
    frame #12: 0x0000000100000f30 fastfetch`main + 256
    frame #13: 0x000000010004908c dyld`start + 520
LinusDierheimer commented 2 years ago

I think i fixed it, can you please test? I can't really test the code, because my VM refuses to start when emulating a graphics card, so i am stuck with software rendering...

CarterLi commented 2 years ago

How about adding a github runner running on macOS?

CarterLi commented 2 years ago

flashfetch ( everything enabled )

image

Number of processes is not right ( ok I saw the hard coded zero )

neofetch ( everything enabled )

image

Tbh I prefer the color palette of neofetch. I found the --color switch, but the switch changes both the color of title and keys. Can I change the color of keys to yellow (33) and leave the color of title to green?

LinusDierheimer commented 2 years ago

Tbh I prefer the color palette of neofetch. I found the --color switch, but the switch changes both the color of title and keys. Can I change the color of keys to yellow (33) and leave the color of title to green?

You can now change them independently by --color-keys and --color-title, but they are the same as neofetch by default now.

LinusDierheimer commented 2 years ago

brew package detection should be working. Are those installed as directories in /usr/local/Caskroom or /usr/local/Cellar?

CarterLi commented 2 years ago

brew package detection should be working. Are those installed as directories in /usr/local/Caskroom or /usr/local/Cellar?

For arm64 they are installed in /opt/homebrew

Use env variable $HOMEBREW_PREFIX should be a better option

CarterLi commented 2 years ago

Full screenshot on my physical machine

image
LinusDierheimer commented 2 years ago

Brew package count should now be working on M1 macs too.

CarterLi commented 2 years ago

The code was wrong.

$HOMEBREW_PREFIX is /opt/homebrew on M1 or /usr/local on Intel. You still need to check its subfolder

eg

$ ls $HOMEBREW_PREFIX/Cellar/ | wc -l
229
$ ls $HOMEBREW_PREFIX/Caskroom/ | wc -l
8
$ brew ls | wc -l
237

I suggest that you should assume brew doesn't exist if $HOMEBREW_PREFIX doesn't exit and don't hard code paths

CarterLi commented 2 years ago

I have a running Apple M1 server ( which is used for running github actions currently ). I can give you the ssh user name and password if you need a working machine to test

LinusDierheimer commented 2 years ago

I am in the process of setting up something similar for myself, but thanks for the offer.

LinusDierheimer commented 2 years ago

I think i finally got brew packages right, its working on both my tests machines now.

CarterLi commented 2 years ago

Brew packages worked, GPU didnt work still

LinusDierheimer commented 2 years ago

Might be that i need to hardcode GPU for M1 CPUs, since the gpu isn't connected via PCI anymore, but part of the actual chip. Wouldn't be surprised if system_profiler does the same thing, but sadly it doesn't seem to be open source...

LinusDierheimer commented 2 years ago

Did that. If it works for you, i think i now have decent enough Apple support to release 1.7.1 and carry on with different features.

CarterLi commented 2 years ago

Running on my old intel MBP

image
CarterLi commented 2 years ago

Might be that i need to hardcode GPU for M1 CPUs

That seems cheating. Even for Apple silicon, macOS supports discrete GPUs.

There are some open source projects to consult. For example: https://github.com/exelban/stats/tree/master/Modules/GPU

LinusDierheimer commented 2 years ago

That seems cheating. Even for Apple silicon, macOS supports discrete GPUs.

In the current code, i add a GPU with the name of CPU, if the CPU starts with Apple M. I still go through all PCI devices, so discrete GPUs should still be detected.

LinusDierheimer commented 2 years ago

There are some open source projects to consult. For example: https://github.com/exelban/stats/tree/master/Modules/GPU

They do exactly what i do, iterating over IOPCIDevice, i can't find how they handle M1. But it does contain some other interesting code, thanks for pointing out!

https://github.com/exelban/stats/blob/a9ba0aae292c4f8556892be8a16d503987d731ce/Modules/GPU/reader.swift#L37

CarterLi commented 2 years ago

Vulkan ( MoltenVK ) works fine on macOS

image image

Dirty code ( need vulkan sdk installed )

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96cbc4b..2691902 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ endif()
 include(CMakeDependentOption)

 cmake_dependent_option(ENABLE_LIBPCI "Enable libpci" ON "LINUX" OFF)
-cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX" OFF)
+cmake_dependent_option(ENABLE_VULKAN "Enable vulkan" ON "LINUX OR APPLE" OFF)
 cmake_dependent_option(ENABLE_WAYLAND "Enable wayland-client" ON "LINUX" OFF)
 cmake_dependent_option(ENABLE_XCB_RANDR "Enable xcb-randr" ON "LINUX" OFF)
 cmake_dependent_option(ENABLE_XCB "Enable xcb" ON "LINUX" OFF)
diff --git a/src/detection/vulkan.c b/src/detection/vulkan.c
index 43a208f..151122d 100644
--- a/src/detection/vulkan.c
+++ b/src/detection/vulkan.c
@@ -11,6 +11,12 @@
 #include <stdlib.h>
 #include <vulkan/vulkan.h>

+#ifdef __APPLE__
+#   define FF_SO_EXTENSION ".dylib"
+#else
+#   define FF_SO_EXTENSION ".so"
+#endif
+
 static inline void applyVulkanVersion(uint32_t vulkanVersion, FFVersion* ffVersion)
 {
     ffVersion->major = VK_VERSION_MAJOR(vulkanVersion);
@@ -35,7 +41,7 @@ static void applyDriverName(VkPhysicalDeviceDriverProperties* properties, FFstrb

 static void detectVulkan(const FFinstance* instance, FFVulkanResult* result)
 {
-    FF_LIBRARY_LOAD(vulkan, instance->config.libVulkan, , "libvulkan.so", 2)
+    FF_LIBRARY_LOAD(vulkan, instance->config.libVulkan, , "libvulkan" FF_SO_EXTENSION, 2)
     FF_LIBRARY_LOAD_SYMBOL(vulkan, vkGetInstanceProcAddr,)
     FF_LIBRARY_LOAD_SYMBOL(vulkan, vkCreateInstance,)
     FF_LIBRARY_LOAD_SYMBOL(vulkan, vkDestroyInstance,)
@@ -79,7 +85,7 @@ static void detectVulkan(const FFinstance* instance, FFVulkanResult* result)
         .apiVersion = requestedVkVersion
     };

-    const VkInstanceCreateInfo instanceCreateInfo = {
+    VkInstanceCreateInfo instanceCreateInfo = {
         .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
         .pNext = NULL,
         .pApplicationInfo = &applicationInfo,
@@ -90,6 +96,14 @@ static void detectVulkan(const FFinstance* instance, FFVulkanResult* result)
         .flags = 0
     };

+    #if defined(__APPLE__) && defined(VK_KHR_portability_enumeration)
+    // Required for macOS ( MoltenVK ) compatibility
+    const char *exts[] = { VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME };
+    instanceCreateInfo.ppEnabledExtensionNames = exts;
+    instanceCreateInfo.enabledExtensionCount = 1;
+    instanceCreateInfo.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
+    #endif
+
     VkInstance vkInstance;
     if(ffvkCreateInstance(&instanceCreateInfo, NULL, &vkInstance) != VK_SUCCESS)
     {
diff --git a/src/flashfetch.c b/src/flashfetch.c
index a571345..8e156fa 100644
--- a/src/flashfetch.c
+++ b/src/flashfetch.c
@@ -9,50 +9,51 @@ int main(int argc, char** argv)
     ffInitInstance(&instance); //This also applys default configuration to instance.config

     //Modify instance.config here
+    instance.config.showErrors = true;

     //Does things like starting detection threads, disabling line wrap, etc
     ffStart(&instance);

     //Printing
-    ffPrintTitle(&instance);
-    ffPrintSeparator(&instance);
-    ffPrintOS(&instance);
-    ffPrintHost(&instance);
-    ffPrintKernel(&instance);
-    ffPrintUptime(&instance);
-    //ffPrintProcesses(&instance);
-    ffPrintPackages(&instance);
-    ffPrintShell(&instance);
-    ffPrintResolution(&instance);
-    ffPrintDesktopEnvironment(&instance);
-    ffPrintWM(&instance);
-    ffPrintWMTheme(&instance);
-    ffPrintTheme(&instance);
-    ffPrintIcons(&instance);
-    ffPrintFont(&instance);
-    ffPrintCursor(&instance);
-    ffPrintTerminal(&instance);
-    ffPrintTerminalFont(&instance);
+    // ffPrintTitle(&instance);
+    // ffPrintSeparator(&instance);
+    // ffPrintOS(&instance);
+    // ffPrintHost(&instance);
+    // ffPrintKernel(&instance);
+    // ffPrintUptime(&instance);
+    // ffPrintProcesses(&instance);
+    // ffPrintPackages(&instance);
+    // ffPrintShell(&instance);
+    // ffPrintResolution(&instance);
+    // ffPrintDesktopEnvironment(&instance);
+    // ffPrintWM(&instance);
+    // ffPrintWMTheme(&instance);
+    // ffPrintTheme(&instance);
+    // ffPrintIcons(&instance);
+    // ffPrintFont(&instance);
+    // ffPrintCursor(&instance);
+    // ffPrintTerminal(&instance);
+    // ffPrintTerminalFont(&instance);
     ffPrintCPU(&instance);
-    //ffPrintCPUUsage(&instance);
-    ffPrintGPU(&instance);
-    ffPrintMemory(&instance);
-    //ffPrintSwap(&instance);
-    ffPrintDisk(&instance);
-    ffPrintBattery(&instance);
-    //ffPrintPlayer(&instance);
-    //ffPrintSong(&instance);
-    //ffPrintLocalIp(&instance);
-    //ffPrintPublicIp(&instance);
-    ffPrintLocale(&instance);
-    //ffPrintDateTime(&instance);
-    //ffPrintDate(&instance);
-    //ffPrintTime(&instance);
-    //ffPrintVulkan(&instance);
-    //ffPrintOpenGL(&instance);
-    //ffPrintOpenCL(&instance);
-    ffPrintBreak(&instance);
-    ffPrintColors(&instance);
+    // ffPrintCPUUsage(&instance);
+    // ffPrintGPU(&instance);
+    // ffPrintMemory(&instance);
+    // ffPrintSwap(&instance);
+    // ffPrintDisk(&instance);
+    // ffPrintBattery(&instance);
+    // ffPrintPlayer(&instance);
+    // ffPrintSong(&instance);
+    // ffPrintLocalIp(&instance);
+    // ffPrintPublicIp(&instance);
+    // ffPrintLocale(&instance);
+    // ffPrintDateTime(&instance);
+    // ffPrintDate(&instance);
+    // ffPrintTime(&instance);
+    ffPrintVulkan(&instance);
+    // ffPrintOpenGL(&instance);
+    // ffPrintOpenCL(&instance);
+    // ffPrintBreak(&instance);
+    // ffPrintColors(&instance);

     ffFinish(&instance);
     return 0;
diff --git a/src/modules/vulkan.c b/src/modules/vulkan.c
index c62489f..a689dfa 100644
--- a/src/modules/vulkan.c
+++ b/src/modules/vulkan.c
@@ -1,5 +1,6 @@
 #include "fastfetch.h"
 #include "common/printing.h"
+#include "detection/gpu/gpu.h"
 #include "detection/vulkan.h"

 #define FF_VULKAN_MODULE_NAME "Vulkan"
@@ -40,4 +41,10 @@ void ffPrintVulkan(FFinstance* instance)
             {FF_FORMAT_ARG_TYPE_STRBUF, &vulkan->conformanceVersion}
         });
     }
+
+    for(uint32_t i = 0; i < vulkan->gpus.length; i++) {
+        FFGPUResult* gpu = ffListGet(&vulkan->gpus, i);
+        ffPrintLogoAndKey(instance, "GPU", 0, &instance->config.gpu.key);
+        ffStrbufWriteTo(&gpu->name, stdout);
+    }
 }
LinusDierheimer commented 2 years ago

Thanks for the vulkan code. I will definitely update the current one, to make in work on MacOS too. But i still think it should be only the fallback for the pci code. Im am still figuring out how to use CFStringGetCString correctly...

CarterLi commented 2 years ago

Why? You don't need to run GPU detection code when vulkan module have been run. It will save time. If vulkan fails then fallback to the pci code

CarterLi commented 2 years ago

Noticed that Disk usage was wrong.

image

可用 means storage left, means storage total

LinusDierheimer commented 2 years ago

Total usage seems right, 234 GiB = 251 GB. I will look into what is wrong with the used one.

And the crash in gpu_apple.c might be resolved now.

LinusDierheimer commented 2 years ago

Disk is now working correctly. Use --binary-prefix si to get the exact same information as "About this Mac".

Is there anything else missing, before i can make the bugfix release?

CarterLi commented 2 years ago

--localip-show-loop doesn't work on macOS. See my PR

CarterLi commented 2 years ago
image
LinusDierheimer commented 2 years ago

I am pretty happy with this. I want to leave WM Theme / Terminal Font for Hacktoberfest next month. Can this be closed, or is there anything else that should be done before the release?

CarterLi commented 2 years ago

I'd like to have Battery and Power Adapter ( because my MBP supports PD charging ) working before switching to fastfetch from neofetch, but It's ok to release a bug fix version.