diff --git a/README.md b/README.md index 46b805335..17943094d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,18 @@ -# fastfetch +#
Fastfetch
-fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying them in a pretty way. It is written in c to achieve much better performance, in return only Linux and Android are supported. It also uses mechanisms like multithreading and caching to finish as fast as possible. - -The output on my personal machine with default configurations looks like this: -example output +Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying them in a pretty way. It is written in c to achieve much better performance, in return only Linux and Android are supported. It also uses mechanisms like multithreading and caching to finish as fast as possible. + +
+
+ + +
+
+ + + +
+
## Customization @@ -11,8 +20,8 @@ With customization and speed being two competing goals, this project actually bu The main one being `fastfetch`, which can be very greatly configured via flags. These flags can be made persistent in `~/.config/fastfetch/config.conf`. To view the available options run `fastfetch --help`. The second executable being built is called `flashfetch`, which is configured at compile time to eliminate any possible overhead. Configuration of it can be very easily done in [`src/flashfetch.c`](src/flashfetch.c). At the moment the performance difference is measurable, but too small to be human recognizable. But the leap will get bigger with more and more options coming, and on slow machines this might actually make a difference. - -There are some presets defined for fastfech in [`presets`](presets), you can can load them with `--load-config`. They may also serve as a good example for format arguments. + +There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `--load-config `. They may also serve as a good example for format arguments. ## Dependencies @@ -45,12 +54,12 @@ All categories not listed here should work without needing a specific implementa ##### Available Modules ``` -Title, Separator, OS, Host, Kernel, Uptime, Processes, Packages, Shell, Resolution, DE, WM, WMTheme, Theme, Icons, Font, Cursor, Terminal, Terminal Font, CPU, CPUUsage, GPU, Memory, Disk, Battery, Player, Song, Vulkan, OpenGL, OpenCL, LocalIP, PublicIP, DateTime, Date, Time, Locale, Colors, Break, Custom +Title, Separator, OS, Host, Kernel, Uptime, Processes, Packages, Shell, Resolution, DE, WM, WMTheme, Theme, Icons, Font, Cursor, Terminal, Terminal Font, CPU, CPUUsage, GPU, Memory, Disk, Battery, Player, Media, Vulkan, OpenGL, OpenCL, LocalIP, PublicIP, DateTime, Date, Time, Locale, Colors, Break, Custom ``` ##### Logos ``` -AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, Debian, Devuan, Deepin, Endeavour, Fedora, Garuda, Gentoo, KDE Neon, KISS, Kubuntu, LangitKetujuh, Linux, Manjaro, Mint, MSYS2 NixOS, OpenSUSE, OpenSUSE Tumbleweed, OpenSUSE LEAP, Pop!_OS, RebornOS, RedstarOS, Rocky, Rosa, Ubuntu, Void, Zorin +AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, Debian, Devuan, Deepin, Endeavour, Fedora, Garuda, Gentoo, KDE Neon, KISS, Kubuntu, LangitKetujuh, Linux, Manjaro, Mint, MSYS2, NixOS, OpenSUSE, OpenSUSE Tumbleweed, OpenSUSE LEAP, Pop!_OS, RebornOS, RedstarOS, Rocky, Rosa, Ubuntu, Void, Zorin ``` * Most of the logos have a small variant. Access it by appending _small to the logo name. * Some logos have an old variant. Access it by appending _old to the logo name. diff --git a/presets/examples/1 b/presets/examples/1 new file mode 100644 index 000000000..99a981ad3 --- /dev/null +++ b/presets/examples/1 @@ -0,0 +1 @@ +# Load with --load-config examples/1 diff --git a/presets/examples/2 b/presets/examples/2 new file mode 100644 index 000000000..a7eda7fd9 --- /dev/null +++ b/presets/examples/2 @@ -0,0 +1,24 @@ +# Load with --load-config examples/2 +# Note that you must replace the image path to an existing image to display it. + +--kitty /home/linus/Bilder/Gentoo.png +--logo-width 28 + +--separator "  " + +--set-keyless HardwareStart=┌───────── \e[1mHardware Information\e[0m ─────────┐ +--set-keyless SoftwareStart=├───────── \e[1mSoftware Information\e[0m ─────────┤ +--set-keyless InformationEnd=└────────────────────────────────────────┘ +--set-keyless Colors= \e[38m \e[37m \e[36m \e[35m \e[34m \e[33m \e[32m \e[31m +--structure HardwareStart:Host:CPU:GPU:SoftwareStart:OS:Kernel:WM:Shell:Terminal:TerminalFont:Packages:InformationEnd:Colors + +--host-key " " +--cpu-key " " +--gpu-key " ﬙" +--os-key " " +--kernel-key " " +--wm-key " " +--shell-key " " +--terminal-key " " +--terminal-font-key " " +--packages-key " " diff --git a/presets/examples/3 b/presets/examples/3 new file mode 100644 index 000000000..bd89f592f --- /dev/null +++ b/presets/examples/3 @@ -0,0 +1,7 @@ +# Load with --load-config example/3 + +--logo debian_small +--structure Vulkan:OpenGL:OpenCL:Memory:Disk:LocalIP +--binary-prefix si +--localip-show-loop false +--disk-folders /:/home:/boot:/efi diff --git a/presets/examples/4 b/presets/examples/4 new file mode 100644 index 000000000..bd0ea06b5 --- /dev/null +++ b/presets/examples/4 @@ -0,0 +1,7 @@ +# Load with --load-config examples/4 + +--color blue +--logo arch_small +--logo-padding-right 1 +--separator "  " +--structure Date:Time:Break:Player:Media diff --git a/presets/examples/5 b/presets/examples/5 new file mode 100644 index 000000000..349257b72 --- /dev/null +++ b/presets/examples/5 @@ -0,0 +1,12 @@ +# Load with --load-config examples/5 + +--logo none +--color reset_magenta +--structure Theme:Icons:Font:Cursor +--theme-key T +--theme-format {7} +--icons-key I +--icons-format {5} +--font-key F +--font-format {21} +--cursor-key C diff --git a/screenshots/example.png b/screenshots/example.png deleted file mode 100644 index bf2b33dd3..000000000 Binary files a/screenshots/example.png and /dev/null differ diff --git a/screenshots/example1.png b/screenshots/example1.png new file mode 100644 index 000000000..7839a9701 Binary files /dev/null and b/screenshots/example1.png differ diff --git a/screenshots/example2.png b/screenshots/example2.png new file mode 100644 index 000000000..44950b053 Binary files /dev/null and b/screenshots/example2.png differ diff --git a/screenshots/example3.png b/screenshots/example3.png new file mode 100644 index 000000000..5dc3e54c6 Binary files /dev/null and b/screenshots/example3.png differ diff --git a/screenshots/example4.png b/screenshots/example4.png new file mode 100644 index 000000000..1e7080ee1 Binary files /dev/null and b/screenshots/example4.png differ diff --git a/screenshots/example5.png b/screenshots/example5.png new file mode 100644 index 000000000..9afb3923f Binary files /dev/null and b/screenshots/example5.png differ diff --git a/screenshots/ffmanjaro.png b/screenshots/ffmanjaro.png deleted file mode 100644 index 8e91d18d2..000000000 Binary files a/screenshots/ffmanjaro.png and /dev/null differ diff --git a/src/data/modules.txt b/src/data/modules.txt index 60101764e..3c73bceb5 100644 --- a/src/data/modules.txt +++ b/src/data/modules.txt @@ -15,6 +15,7 @@ Icons Kernel Locale LocalIP +Media Memory OS OpenCL @@ -26,7 +27,6 @@ PublicIP Resolution Separator Shell -Song Terminal TerminalFont Theme diff --git a/src/fastfetch.c b/src/fastfetch.c index 89dd5aeec..9133ed53d 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1364,7 +1364,7 @@ static void parseStructureCommand(FFinstance* instance, FFdata* data, const char ffPrintPublicIp(instance); else if(strcasecmp(line, "player") == 0) ffPrintPlayer(instance); - else if(strcasecmp(line, "song") == 0) + else if(strcasecmp(line, "media") == 0 || strcasecmp(line, "song") == 0) ffPrintSong(instance); else if(strcasecmp(line, "datetime") == 0) ffPrintDateTime(instance); diff --git a/src/modules/opencl.c b/src/modules/opencl.c index 316529a17..024ffb552 100644 --- a/src/modules/opencl.c +++ b/src/modules/opencl.c @@ -7,6 +7,7 @@ #ifdef FF_HAVE_OPENCL #include "common/library.h" #include "common/parsing.h" +#include #define CL_TARGET_OPENCL_VERSION 100 #include @@ -42,6 +43,11 @@ static const char* openCLHandelData(FFinstance* instance, OpenCLData* data) if(!ffStrSet(version)) return "clGetDeviceInfo returned NULL or empty string"; + const char* versionPretty = version; + const char* prefix = "OpenCL "; + if(strncasecmp(version, prefix, sizeof(prefix) - 1) == 0) + versionPretty = version + sizeof(prefix) - 1; + char device[128]; data->ffclGetDeviceInfo(deviceID, CL_DEVICE_NAME, sizeof(device), device, NULL); @@ -51,12 +57,12 @@ static const char* openCLHandelData(FFinstance* instance, OpenCLData* data) if(instance->config.openCL.outputFormat.length == 0) { ffPrintLogoAndKey(instance, FF_OPENCL_MODULE_NAME, 0, &instance->config.openCL.key); - puts(version); + puts(versionPretty); } else { ffPrintFormat(instance, FF_OPENCL_MODULE_NAME, 0, &instance->config.openCL, FF_OPENCL_NUM_FORMAT_ARGS, (FFformatarg[]) { - {FF_FORMAT_ARG_TYPE_STRING, version}, + {FF_FORMAT_ARG_TYPE_STRING, versionPretty}, {FF_FORMAT_ARG_TYPE_STRING, device}, {FF_FORMAT_ARG_TYPE_STRING, vendor} }); diff --git a/src/modules/song.c b/src/modules/song.c index 69b571368..2c6d27cd8 100644 --- a/src/modules/song.c +++ b/src/modules/song.c @@ -4,7 +4,7 @@ #include -#define FF_SONG_MODULE_NAME "Song" +#define FF_SONG_MODULE_NAME "Media" #define FF_SONG_NUM_FORMAT_ARGS 5 static bool shouldIgoreChar(char c) @@ -55,9 +55,9 @@ void ffPrintSong(FFinstance* instance) FFstrbuf songPretty; ffStrbufInitCopy(&songPretty, &media->song); const char* removeStrings[] = { - "(Official Music Video)", "(Official Video)", "(Music Video)", - "[Official Music Video]", "[Official Video]", "[Music Video]", - "| Official Music Video", "| Official Video", "| Music Video", + "(Official Music Video)", "(Official Video)", "(Music Video)", "(Official HD Video)", + "[Official Music Video]", "[Official Video]", "[Music Video]", "[Official HD Video]", + "| Official Music Video", "| Official Video", "| Music Video", "| Official HD Video", "[Official Audio]", "[Audio]", "(Audio)", "| Official Audio", "| Audio", "| OFFICIAL AUDIO", "(Lyric Video)", "(Official Lyric Video)", "(Lyrics)", "[Lyric Video]", "[Official Lyric Video]", "[Lyrics]", diff --git a/src/modules/vulkan.c b/src/modules/vulkan.c index b73c7fd58..c62489f64 100644 --- a/src/modules/vulkan.c +++ b/src/modules/vulkan.c @@ -19,16 +19,16 @@ void ffPrintVulkan(FFinstance* instance) { ffPrintLogoAndKey(instance, FF_VULKAN_MODULE_NAME, 0, &instance->config.vulkan.key); - if(vulkan->driver.length > 0) + if(vulkan->apiVersion.length > 0) { - printf("%s (driver)", vulkan->driver.chars); + ffStrbufWriteTo(&vulkan->apiVersion, stdout); - if(vulkan->apiVersion.length > 0) - fputs(", ", stdout); + if(vulkan->driver.length > 0) + fputs(" - ", stdout); } - if(vulkan->apiVersion.length > 0) - printf("%s (api version)", vulkan->apiVersion.chars); + if(vulkan->driver.length > 0) + ffStrbufWriteTo(&vulkan->driver, stdout); putchar('\n'); }