Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2f6cabb
Library: prepare for static linking
CarterLi May 23, 2024
81318f4
Fastfetch: don't detect `.conf` in `--list-config-paths`
CarterLi May 24, 2024
b25e8c2
Fastfetch: list available presets in exe path
CarterLi May 24, 2024
6326405
Percentage: support monochrome bar type
CarterLi May 24, 2024
4b33e1b
Terminal (Windows): don't try to detect terminals in MSYS shell
CarterLi May 24, 2024
3d48de8
CMake: be able to build as a dynamic linked binary
CarterLi May 24, 2024
64a3573
Packaging: update debian stuff
CarterLi May 24, 2024
5302a82
Fastfetch: disable `dlsym` function call if `dlopen` is disabled
CarterLi May 24, 2024
d7098e7
CMake: set link library dirs
CarterLi May 24, 2024
f938f5e
CMake: remove useless code
CarterLi May 24, 2024
374997b
Board: fix typo (#965)
lucsansag May 24, 2024
099e2b5
Editor (Windows): support editor version detection
CarterLi May 24, 2024
f83a31e
Presets: update `examples/7.jsonc` to fix archlinux compatibility
CarterLi May 25, 2024
e0d5a90
Logo (File / Data): apply default color palettes
CarterLi May 25, 2024
b030bd6
README: add example of FIGlet text logo [ci skip]
CarterLi May 25, 2024
152f5d3
Revert "OS (Linux): remove special handling of Loc-OS"
CarterLi May 26, 2024
20b433f
Logo: Cereus Linux (#968)
Anonyzard May 26, 2024
0ae2d38
CMake: we support FreeBSD only, not OpenBSD nor NetBSD
CarterLi May 25, 2024
7e1c426
README: add more installation methods [ci skip]
CarterLi May 26, 2024
dee208f
Chore: remove unnecessary files [ci skip]
CarterLi May 27, 2024
0869bfa
Doc: update changelog [ci skip]
CarterLi May 27, 2024
ad709c4
README: update screenshot [ci skip]
CarterLi May 27, 2024
9657773
Packages (Linux): Add Guix package manager. (#972)
Dariqq May 28, 2024
c8451ca
Global: support for named format arguments
CarterLi May 27, 2024
a14a73b
Doc: update changelog
CarterLi May 28, 2024
81e0af8
Format: support named color placeholders
CarterLi May 28, 2024
5fa18a8
Custom: detect & convert color placeholders (`{#xxx}`)
CarterLi May 28, 2024
3ba8992
Util: add `ffCharIsDigit` and use it
CarterLi May 28, 2024
5172a13
Global: fix `outputColor` doesn't work if module keys are disabled
CarterLi May 28, 2024
8bdca1b
Formatting: small optimizations
CarterLi May 28, 2024
745865d
Presets: convert hard coded ANSI escape code to formatting placeholders
CarterLi May 28, 2024
983e5c6
Display: add option `--color-separator`
CarterLi May 28, 2024
66ba5d0
Doc: document named placeholders
CarterLi May 28, 2024
3ae2047
Doc: update changelog
CarterLi May 28, 2024
1f3d18c
Doc: document `--color-separator`
CarterLi May 28, 2024
3811bb1
TerminalShell: move process info query logic into common place
CarterLi May 28, 2024
90690ba
InitSystem: add new module
CarterLi May 28, 2024
bb11cff
InitSystem: detect version
CarterLi May 29, 2024
e8dc500
Processing (Linux): return errors more actively
CarterLi May 29, 2024
7e8b204
InitSystem: resolve real path of exe path
CarterLi May 29, 2024
7c1b6c6
CI: test initsystem
CarterLi May 29, 2024
1863bde
InitSystem: better systemd version detection
CarterLi May 30, 2024
d7e9094
Shell (macOS): better xonsh detection
CarterLi May 30, 2024
44257b7
Shell: don't try to get arg1 if python was executed without extra args
CarterLi May 30, 2024
49840a8
Vulkan: print reason on error
CarterLi May 30, 2024
c0c7629
Release: v2.14.0
CarterLi May 30, 2024
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
18 changes: 1 addition & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@ assignees: ''

---

## Before requesting a new feature

* A lot of features are not enabled by default. Please try `fastfetch --list-modules` and `fastfetch -c all.jsonc` to see if it has been supported
* Fastfetch supports `Command` module, which can be used to grab output from a custom shell script. Please check if it fits your needs

```jsonc
// ~/.config/fastfetch/fastfetch.jsonc
{
"modules": [
{
"type": "command",
"text": "/path/to/your/script",
"key": "Feature Title"
}
]
}
```
Be sure to read [FAQ](https://github.com/fastfetch-cli/fastfetch?tab=readme-ov-file#faq) before submitting a new issue.

## Wanted features:

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ cscope.*
tags
fastfetch.kdev4
*.user
*.user.*
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# 2.14.0

Features:
* Support monochrome bar type (#960)
* Support editor version detection on Windows (Editor, Windows)
* Apply default color palettes in `--file` and `--data` (Logo)
* Print all presets in `--list-presets` for better Windows support (Windows)
* Support for guix package manager detection (Packages, Linux)
* Support named variable placeholders in custom module formattion string (#796)
* `--title-format '{user-name-colored}{at-symbol-colored}{host-name-colored}'` is equivalent to `--title-format '{6}{7}{8}'`
* Support named color placeholders in custom module formattion string
* `--<module>-format '{#red}'` is equivalent to `--<module>-format '{#31}'`
* `'{#red}'` or `'{#31}'` is preferred over `\u001b[31m` because is more readable and `--pipe` aware (will be ignored in pipe mode)
* Supported in `Custom` module too
* See `fastfetch -h format` for detail
* Add option `--color-separator` to set the color of key-value separators
* Support Guix package manager count (#792, Packages, Linux)
* Improve python based shell detection (#977, Shell, macOS)
* Print error reason when vulkan init fails (Vulkan)

Bugfixes:
* Don't detect `.conf` files in `--list-config-paths`
* Don't try to detect terminals in MSYS shell with process backtracing (Windows)
* Fix `outputColor` doesn't work if module keys are disabled

Logos:
* Add Cereus Linux
* Re-add special handling of Loc-OS

# 2.13.2

Another hotfix release :(
Expand Down
34 changes: 31 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url

project(fastfetch
VERSION 2.13.2
VERSION 2.14.0
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
Expand All @@ -14,9 +14,9 @@ set(PROJECT_LICENSE "MIT license")
###################
if(ANDROID)
set(LINUX FALSE)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Ll]inux.*")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LINUX TRUE CACHE BOOL "..." FORCE) # LINUX means GNU/Linux, not just the kernel
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Bb][Ss][Dd].*")
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(BSD TRUE CACHE BOOL "..." FORCE)
elseif(NOT APPLE AND NOT WIN32)
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
Expand Down Expand Up @@ -77,6 +77,13 @@ option(BUILD_TESTS "Build tests" OFF) # Also create test executables
option(SET_TWEAK "Add tweak to project version" ON) # This is set to off by github actions for release builds
option(IS_MUSL "Build with musl libc" OFF) # Used by Github Actions

set(BINARY_LINK_TYPE_OPTIONS dlopen dynamic static)
set(BINARY_LINK_TYPE dlopen CACHE STRING "How to link fastfetch")
set_property(CACHE BINARY_LINK_TYPE PROPERTY STRINGS ${BINARY_LINK_TYPE_OPTIONS})
if(NOT BINARY_LINK_TYPE IN_LIST BINARY_LINK_TYPE_OPTIONS)
message(FATAL_ERROR "BINARY_LINK_TYPE must be one of ${BINARY_LINK_TYPE_OPTIONS}")
endif()

if (LINUX)
set(CUSTOM_PCI_IDS_PATH "" CACHE STRING "Custom path to file pci.ids, defaults to `/usr/share/hwdata/pci.ids`")
set(CUSTOM_AMDGPU_IDS_PATH "" CACHE STRING "Custom path to file amdgpu.ids, defaults to `/usr/share/libdrm/amdgpu.ids`")
Expand Down Expand Up @@ -336,6 +343,7 @@ set(LIBFASTFETCH_SRC
src/modules/gpu/gpu.c
src/modules/host/host.c
src/modules/icons/icons.c
src/modules/initsystem/initsystem.c
src/modules/gamepad/gamepad.c
src/modules/kernel/kernel.c
src/modules/lm/lm.c
Expand Down Expand Up @@ -424,6 +432,7 @@ if(LINUX)
src/detection/gtk_qt/gtk.c
src/detection/host/host_linux.c
src/detection/icons/icons_linux.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_linux.c
src/detection/lm/lm_linux.c
src/detection/loadavg/loadavg_linux.c
Expand Down Expand Up @@ -482,6 +491,7 @@ elseif(ANDROID)
src/detection/gpu/gpu_nosupport.c
src/detection/host/host_android.c
src/detection/icons/icons_nosupport.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_android.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_linux.c
Expand Down Expand Up @@ -552,6 +562,7 @@ elseif(BSD)
src/detection/host/host_bsd.c
src/detection/lm/lm_linux.c
src/detection/icons/icons_linux.c
src/detection/initsystem/initsystem_linux.c
src/detection/libc/libc_bsd.c
src/detection/loadavg/loadavg_bsd.c
src/detection/locale/locale_linux.c
Expand Down Expand Up @@ -611,6 +622,7 @@ elseif(APPLE)
src/detection/gpu/gpu_apple.m
src/detection/host/host_apple.c
src/detection/icons/icons_nosupport.c
src/detection/initsystem/initsystem_linux.c
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_bsd.c
src/detection/libc/libc_apple.c
Expand Down Expand Up @@ -669,6 +681,7 @@ elseif(WIN32)
src/detection/gpu/gpu_windows.c
src/detection/host/host_windows.c
src/detection/icons/icons_windows.c
src/detection/initsystem/initsystem_nosupport.c
src/detection/libc/libc_windows.cpp
src/detection/lm/lm_nosupport.c
src/detection/loadavg/loadavg_nosupport.c
Expand Down Expand Up @@ -817,6 +830,11 @@ if(NOT "${CUSTOM_OS_RELEASE_PATH}" STREQUAL "")
target_compile_definitions(libfastfetch PRIVATE FF_CUSTOM_OS_RELEASE_PATH=${CUSTOM_OS_RELEASE_PATH})
endif()

if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
message(STATUS "Enabling custom link type: ${BINARY_LINK_TYPE}")
target_compile_definitions(libfastfetch PRIVATE FF_DISABLE_DLOPEN=1)
endif()

function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
if(NOT ENABLE_${VARNAME})
return()
Expand Down Expand Up @@ -845,6 +863,11 @@ function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)
target_compile_definitions(libfastfetch PRIVATE FF_HAVE_${VARNAME}=1)
target_include_directories(libfastfetch PRIVATE ${${VARNAME}_INCLUDE_DIRS})

if(NOT BINARY_LINK_TYPE STREQUAL "dlopen")
target_link_directories(libfastfetch PUBLIC ${${VARNAME}_LIBRARY_DIRS})
target_link_libraries(libfastfetch PRIVATE ${${VARNAME}_LIBRARIES})
endif()

foreach(FLAG ${${VARNAME}_CFLAGS_OTHER})
if(FLAG MATCHES "-D.*")
string(SUBSTRING ${FLAG} 2 -1 FLAG)
Expand Down Expand Up @@ -1093,6 +1116,11 @@ elseif(APPLE)
)
endif()

if(BINARY_LINK_TYPE STREQUAL "static")
target_link_options(fastfetch PRIVATE "-static")
target_link_options(flashfetch PRIVATE "-static")
endif()

###################
# Testing targets #
###################
Expand Down
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,28 @@ Replace sudo with doas depending on what you use.

[See also if fastfetch has been packaged for your favorite Linux distro](#Packaging).

If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternate: `brew install fastfetch`
If fastfetch is not packaged for your distro or an outdated version is packaged, [linuxbrew](https://brew.sh/) is a good alternative: `brew install fastfetch`

### macOS

...via [HomeBrew](https://brew.sh):

`brew install fastfetch`

...via [MacPorts](https://www.macports.org):

`sudo port install fastfetch`
* [HomeBrew](https://formulae.brew.sh/formula/fastfetch#default): `brew install fastfetch`
* [MacPorts](https://ports.macports.org/port/fastfetch/): `sudo port install fastfetch`

### Windows

`scoop install fastfetch`
* [scoop](https://scoop.sh/#/apps?q=fastfetch): `scoop install fastfetch`
* [winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/f/Fastfetch-cli/Fastfetch): `winget install fastfetch`
* [MSYS2 MinGW](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-fastfetch): `pacman -S mingw-w64-<subsystem>-<arch>-fastfetch`

You may also download it directly from [GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) and extract the archive.

### FreeBSD

`pkg install fastfetch`
* `pkg install fastfetch`

### Android (Termux)

`pkg install fastfetch`
* `pkg install fastfetch`

## Build from source

Expand Down Expand Up @@ -155,6 +152,15 @@ See `fastfetch -h format` for basic usage. For module specific formattion, see `

Try `fastfetch -l /path/to/logo`. See [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for detail.

If you just want to display distro name in [FIGlet text](https://github.com/pwaller/pyfiglet)

```bash
# install pyfiglet and jq first
pyfiglet -s -f small_slant $(fastfetch -s os --format json | jq -r '.[0].result.name') && fastfetch -l none
```

![image](https://github.com/fastfetch-cli/fastfetch/assets/6134068/6466524e-ab8c-484f-848d-eec7ddeb7df2)

### Q: Fastfetch runs in white and black on shell startup. Why?

This issue usually happens when using fastfetch with `p10k`. There are known incompatibility between fastfetch and p10k instant prompt.
Expand Down
42 changes: 42 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
fastfetch (2.13.2) jammy; urgency=medium

* Update to 2.13.2

-- Carter Li <zhangsongcui@live.cn> Fri, 24 May 2024 13:48:59 +0800

fastfetch (2.13.1) jammy; urgency=medium

* Update to 2.13.1

-- Carter Li <zhangsongcui@live.cn> Tue, 21 May 2024 15:10:37 +0800

fastfetch (2.12.0) jammy; urgency=medium

* Update to 2.12.0

-- Carter Li <zhangsongcui@live.cn> Tue, 14 May 2024 16:33:33 +0800

fastfetch (2.11.5) jammy; urgency=medium

* Update to 2.11.5

-- Carter Li <zhangsongcui@live.cn> Tue, 07 May 2024 09:30:05 +0800

fastfetch (2.11.3) jammy; urgency=medium

* Update to 2.11.3

-- Carter Li <zhangsongcui@live.cn> Mon, 06 May 2024 08:46:45 +0800

fastfetch (2.10.2) jammy; urgency=medium

* Update to 2.10.2

-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 15:18:23 +0800

fastfetch (2.10.1) jammy; urgency=medium

* Update to 2.10.1

-- Carter Li <zhangsongcui@live.cn> Tue, 23 Apr 2024 09:55:02 +0800

fastfetch (2.9.2) jammy; urgency=medium

* Update to 2.9.2
Expand Down
2 changes: 1 addition & 1 deletion debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fastfetch_2.9.2_source.buildinfo universe/utils optional
fastfetch_2.13.2_source.buildinfo universe/utils optional
8 changes: 6 additions & 2 deletions doc/json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@
"output": {
"description": "Set the color of the module output",
"$ref": "#/$defs/colors"
},
"separator": {
"description": "Set the color of the key-value separator",
"$ref": "#/$defs/colors"
}
}
}
Expand Down Expand Up @@ -515,7 +519,7 @@
"properties": {
"type": {
"type": "number",
"description": "Set the percentage output type. 1 for percentage number, 2 for bar, 3 for both, 6 for bar only, 9 for colored number",
"description": "Set the percentage output type. 1 for percentage number, 2 for multi-color bar, 3 for both, 6 for bar only, 9 for colored number, 10 for monochrome bar",
"minimum": 0,
"maximum": 255,
"default": 9
Expand Down Expand Up @@ -778,7 +782,7 @@
},
{
"const": "board",
"description": "Print mather board name and other info"
"description": "Print motherboard name and other info"
},
{
"const": "bootmgr",
Expand Down
1 change: 1 addition & 0 deletions presets/all.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"board",
"chassis",
"kernel",
"initsystem",
"uptime",
"loadavg",
"processes",
Expand Down
2 changes: 1 addition & 1 deletion presets/archey.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
{
"type": "terminal",
"format": "{5} {6} \u001b[37m█\u001b[97m█ \u001b[36m█\u001b[96m█ \u001b[35m█\u001b[95m█ \u001b[34m█\u001b[94m█ \u001b[33m█\u001b[93m█ \u001b[32m█\u001b[92m█ \u001b[31m█\u001b[91m█ \u001b[30m█\u001b[90m█"
"format": "{5} {6} {#37}█{#97}█ {#36}█{#96}█ {#35}█{#95}█ {#34}█{#94}█ {#33}█{#93}█ {#32}█{#92}█ {#31}█{#91}█ {#30}█{#90}█"
},
{
"type": "packages",
Expand Down
1 change: 1 addition & 0 deletions presets/ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"board",
"chassis",
"kernel",
"initsystem",
"uptime",
"loadavg",
"processes",
Expand Down
16 changes: 10 additions & 6 deletions presets/examples/10.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@
"modules": [
{
"type": "custom",
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
"format": "┌────────────────────────────────────────────────────────────┐",
"outputColor": "90"
},
{
"type": "title",
"keyWidth": 10
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
"format": "└────────────────────────────────────────────────────────────┘",
"outputColor": "90"
},
{
"type": "custom",
"format": " \u001b[90m\u001b[31m\u001b[32m\u001b[33m\u001b[34m\u001b[35m\u001b[36m\u001b[37m\u001b[38m\u001b[39m  \u001b[38m\u001b[37m\u001b[36m\u001b[35m\u001b[34m\u001b[33m\u001b[32m\u001b[31m\u001b[90m"
"format": " {#90}{#31}{#32}{#33}{#34}{#35}{#36}{#37}{#38}{#39}  {#38}{#37}{#36}{#35}{#34}{#33}{#32}{#31}{#90}"
},
{
"type": "custom",
"format": "\u001b[90m┌────────────────────────────────────────────────────────────┐"
"format": "┌────────────────────────────────────────────────────────────┐",
"outputColor": "90"
},
{
"type": "os",
Expand Down Expand Up @@ -139,12 +142,13 @@
},
{
"type": "custom",
"format": "\u001b[90m└────────────────────────────────────────────────────────────┘"
"format": "└────────────────────────────────────────────────────────────┘",
"outputColor": "90"
},
"break",
{
"type": "custom",
"format": " \u001b[90m\u001b[31m\u001b[32m\u001b[33m\u001b[34m\u001b[35m\u001b[36m\u001b[37m\u001b[38m\u001b[39m  \u001b[38m\u001b[37m\u001b[36m\u001b[35m\u001b[34m\u001b[33m\u001b[32m\u001b[31m\u001b[90m"
"format": " {#90}{#31}{#32}{#33}{#34}{#35}{#36}{#37}{#38}{#39}  {#38}{#37}{#36}{#35}{#34}{#33}{#32}{#31}{#90}"
}
]
}
5 changes: 4 additions & 1 deletion presets/examples/11.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"type": "small"
},
"display": {
"separator": "\u001b[31m-> "
"separator": "-> ",
"color": {
"separator": "red"
}
},
"modules": [
{
Expand Down
Loading