Skip to content

Commit

Permalink
Merge pull request #1069 from fastfetch-cli/dev
Browse files Browse the repository at this point in the history
Release: v2.17.2
  • Loading branch information
CarterLi authored Jul 4, 2024
2 parents b001ea4 + 3453b72 commit cec38b9
Show file tree
Hide file tree
Showing 52 changed files with 375 additions and 231 deletions.
21 changes: 21 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7

# Issues with these labels will never be considered stale
exemptLabels:
- keepalive

# Label to use when marking an issue as stale
staleLabel: stale

# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ jobs:
- name: checkout repository
uses: actions/checkout@v4

- uses: actions/checkout@v4
- name: run VM
uses: vmactions/omnios-vm@v1
with:
Expand Down
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 2.17.2

Changes:
* Flatpak package count no longer takes runtime packages into account (Packages, Linux)

Bugfixes:
* Fix formattion with multiple batteries (Battery)
* Fix incorrect size value for large memory sticks (PhysicalMemory)
* Fix spelling of `Qt` and `LXQt`
* Fix building on SunOS if imagemagick support is enabled (Logo, SunOS)
* Fix typos

Features:
* Support Ptyxis terminal version and font detection (Terminal / TerminalFont, Linux)
* Improve Cinnamon version detection (DE)
* Support `cinnamon-wayland` (WMTheme)
* `--ts-version false` will disable editor version detection (Editor)

# 2.17.1

Hotfix for a regression that breaks Qt font detection
Expand Down Expand Up @@ -1061,7 +1079,7 @@ Bugfixes:
This release backports some changes from dev branch, and fixes 2 crashing issues

Features:
* Support KDE / LXQT / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
* Support KDE / LXQt / MATE / Cinnamon wallpaper detection (Wallpaper, Linux)
* Support QTerminal version & terminal font detection
* Support MATE Terminal version & terminal font detection
* Set `--pipe true` automatically if stdout is not a tty
Expand Down Expand Up @@ -1107,7 +1125,7 @@ Bugfixes:
* Fix Windows drives detection in WSL (Disk)

Changes:
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / QT icon params.
* In order to make Icons module consistent between different platforms, `--icons-format` no longer supports individual GTK / Qt icon params.
* `--theme-format` no longer supports individual GTK / plasma theme params.
* `--local-ip-*` and `--public-ip-*` have been changed to `--localip-*` and `--publicip-*`
* `--localip-compact-type` is no longer supported. Fastfetch now display IPs as `--localip-compat-type multiline` by default, with `--local-compact true` can be set as an alias of `--localip-compact-type oneline`
Expand Down Expand Up @@ -1481,7 +1499,7 @@ Fixes build on android (#205)
# 1.6.0

Features:
* Detect QT on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [QT]
* Detect Qt on more DEs than just KDE Plasma. The [Plasma] category was therefore renamed to [Qt]
* Alacritty font detection
* Load `/etc/fastfetch/config.conf` before user config
* Disk: print one decimal point if size < 100GB
Expand Down
16 changes: 11 additions & 5 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.17.1
VERSION 2.17.2
LANGUAGES C
DESCRIPTION "Fast neofetch-like system information tool"
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
Expand Down Expand Up @@ -74,6 +74,7 @@ cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND"

option(ENABLE_SYSTEM_YYJSON "Use system provided (instead of fastfetch embedded) yyjson library" OFF)
option(ENABLE_ASAN "Build fastfetch with ASAN (address sanitizer)" OFF)
option(ENABLE_LTO "Enable link-time optimization in release mode if supported" ON)
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
Expand Down Expand Up @@ -139,7 +140,7 @@ if(NOT WIN32)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
endif()

if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if(ENABLE_LTO AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Enabling LTO")
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
Expand Down Expand Up @@ -1322,12 +1323,17 @@ if(LINUX)
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")

if(NOT IS_MUSL)
EXECUTE_PROCESS (
EXECUTE_PROCESS(
COMMAND getconf GNU_LIBC_VERSION
OUTPUT_VARIABLE GLIBC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING (REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
if(GLIBC_VERSION)
STRING(REPLACE "glibc " "" GLIBC_VERSION ${GLIBC_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= ${GLIBC_VERSION})")
message(STATUS "found glibc ${GLIBC_VERSION}")
else()
message(WARNING "Could not determine glibc version. If `musl` is used, `-DIS_MUSL=ON` should be set")
endif()
endif()
endif()

Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2021 Linus Dierheimer
Copyright (c) 2021-2023 Linus Dierheimer
Copyright (c) 2022-2024 Carter Li

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![latest packaged version(s)](https://repology.org/badge/latest-versions/fastfetch.svg)](https://repology.org/project/fastfetch/versions)
[![Packaging status](https://repology.org/badge/tiny-repos/fastfetch.svg)](https://repology.org/project/fastfetch/versions)

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 mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, macOS, SunOS and Windows 7+ are supported.
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it prettily. It is written mainly in C, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, macOS, SunOS and Windows 7+ are supported.

<img src="screenshots/example1.png" width="49%" align="left" />
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="49%" height="16px" align="left" />
Expand All @@ -21,13 +21,13 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for
<img src="screenshots/example3.png" width="48%" align="top" />
<img src="screenshots/example5.png" height="15%" align="top" />

There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki)
There are [screenshots on different platforms](https://github.com/fastfetch-cli/fastfetch/wiki).

## Installation

### Linux

Some distros packaged an outdated fastfetch version. Older version is not supported, please always ensure that the latest version is used.
Some distros packaged an outdated fastfetch version. Older version receive no support, so please try always to use the latest version.

* Ubuntu: [`ppa:zhangsongcui3371/fastfetch`](https://launchpad.net/~zhangsongcui3371/+archive/ubuntu/fastfetch) (for Ubuntu 22.04 or newer)
* Debian: `sudo apt install fastfetch` (for Debian 13 or newer)
Expand Down Expand Up @@ -57,7 +57,7 @@ If fastfetch is not packaged for your distro or an outdated version is packaged,
* [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.
You may also download the program directly from [the GitHub releases page](https://github.com/fastfetch-cli/fastfetch/releases/latest) in the form of an archive file.

### FreeBSD

Expand All @@ -81,7 +81,7 @@ See Wiki: https://github.com/fastfetch-cli/fastfetch/wiki/Building

## Customization

Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. They may also serve as a good example for format arguments.
Fastfetch uses the JSONC (or JSON with comments) for configuration. [See Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration). There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `-c <filename>`. Those files can serve as examples of the configuration syntax.

Logos can be heavily customized too; see the [logo documentation](https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options) for more information.

Expand All @@ -103,10 +103,10 @@ Logos can be heavily customized too; see the [logo documentation](https://github

1. Fastfetch is actively maintained.
2. Fastfetch is faster. As the name suggests.
3. Fastfetch is more feature-rich. By default fastfetch only has a few modules enabled. Use `fastfetch -c all` to find what you want.
4. Fastfetch is more configurable. You can find more information in the Wiki: <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration>
5. Fastfetch is more polished. For example, neofetch prints `555MiB` in `Memory` module and `23G` in `Disk` module (notibily the difference of `MiB` and `G`), while fastfetch prints `555.00 MiB` and `22.97 GiB` respectively.
6. Fastfetch is more accurate. For example, [neofetch never actually supports Wayland protocol](https://github.com/dylanaraps/neofetch/pull/2395).
3. Fastfetch has a greater number of features, though by default fastfetch only has a few modules enabled; use `fastfetch -c all` to find what you want.
4. Fastfetch is more configurable. You can find more information in the Wiki: <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration>.
5. Fastfetch is more polished. For example, neofetch prints `555MiB` in `Memory` module and `23G` in `Disk` module, whereas fastfetch prints `555.00 MiB` and `22.97 GiB` respectively.
6. Fastfetch is more accurate. For example, [neofetch never actually supports the Wayland protocol](https://github.com/dylanaraps/neofetch/pull/2395).

### Q: Fastfetch shows my local IP address. It leaks my privacy!

Expand All @@ -118,7 +118,7 @@ If you really don't like it, you can disable the `Local IP` module in `config.js

### Q: Where is the config file? I can't find it.

`Fastfetch` don't generate config file automatically. You can use `fastfetch --gen-config` to generate one. The config file will be saved in `~/.config/fastfetch/config.jsonc` by default. See [Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration).
`Fastfetch` does not generate config file automatically. You can use `fastfetch --gen-config` to generate one. The config file will be saved in `~/.config/fastfetch/config.jsonc` by default. See [Wiki for detail](https://github.com/fastfetch-cli/fastfetch/wiki/Configuration).

### Q: The configuration is so complex. Where is the documentation?

Expand All @@ -132,7 +132,7 @@ Alternatively, you can refer to the presets in [`presets` directory](https://git

### Q: How can I customize the module output?

Fastfetch uses `format` to generate output. For example to make `GPU` module show GPU name only and ignore other information, you can use
Fastfetch uses `format` to generate output. For example, to make the `GPU` module show only the GPU name (leaving other information undisplayed), you can use

```jsonc
{
Expand All @@ -145,15 +145,15 @@ Fastfetch uses `format` to generate output. For example to make `GPU` module sho
}
```

which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`
. . which is equivalent to `fastfetch -s gpu --gpu-format '{2}'`

See `fastfetch -h format` for basic usage. For module specific formattion, see `fastfetch -h <module>-format`
See `fastfetch -h format` for information on basic usage. For module specific formattion, see `fastfetch -h <module>-format`

### Q: I have my own ascii-art / image file. How can I show it with fastfetch?

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)
If you just want to display distro name in [FIGlet text](https://github.com/pwaller/pyfiglet):

```bash
# install pyfiglet and jq first
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
fastfetch (2.17.1) jammy; urgency=medium

* Update to 2.17.1

-- Carter Li <[email protected]> Mon, 01 Jul 2024 08:56:29 +0800

fastfetch (2.17.0) jammy; urgency=medium

* Update to 2.17.0

-- Carter Li <[email protected]> Fri, 28 Jun 2024 13:43:18 +0800

fastfetch (2.16.0) jammy; urgency=medium

* Update to 2.16.0
Expand Down
2 changes: 1 addition & 1 deletion debian/files
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fastfetch_2.16.0_source.buildinfo universe/utils optional
fastfetch_2.17.1_source.buildinfo universe/utils optional
17 changes: 16 additions & 1 deletion doc/json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
},
"tsVersion": {
"type": "boolean",
"description": "Whether to detect and display the version of terminal and shell. Mainly for benchmarking",
"description": "Whether to detect and display the version of terminal, shell and editor. Mainly for benchmarking",
"default": true
}
}
Expand Down Expand Up @@ -1145,6 +1145,21 @@
"type": "boolean",
"description": "Display CPU usage per CPU logical core, instead of an average result",
"default": false
},
"key": {
"$ref": "#/$defs/key"
},
"keyColor": {
"$ref": "#/$defs/keyColor"
},
"outputColor": {
"$ref": "#/$defs/outputColor"
},
"keyWidth": {
"$ref": "#/$defs/keyWidth"
},
"format": {
"$ref": "#/$defs/format"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion presets/examples/19.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
{
"type": "font",
"key": "FONT",
"format": "{?1}{1} [QT]{?}{/1}Unknown", // Remove "[QT]" if not using Qt
"format": "{?1}{1} [Qt]{?}{/1}Unknown", // Remove "[Qt]" if not using Qt
"keyColor": "yellow"
},
{
Expand Down
8 changes: 8 additions & 0 deletions src/common/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ bool ffOptionParseBoolean(const char* str)

void ffOptionParseColorNoClear(const char* value, FFstrbuf* buffer)
{
// If value is already an ANSI escape code, use it
if (value[0] == '\e' && value[1] == '[')
{
ffStrbufAppendS(buffer, value + 2);
ffStrbufTrimRight(buffer, 'm');
return;
}

ffStrbufEnsureFree(buffer, 63);

while(*value != '\0')
Expand Down
6 changes: 3 additions & 3 deletions src/data/help.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
{
"short": "l",
"long": "logo",
"desc": "Set the logo source",
"desc": "Set the logo source. Use \"none\" to disable the logo",
"remark": "Should be the name of a builtin logo, or a path to an image file. See also https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options",
"arg": {
"type": "logo"
Expand Down Expand Up @@ -441,7 +441,7 @@
},
{
"long": "pipe",
"desc": "Disable logo and all escape sequences",
"desc": "Disable colors",
"remark": "Auto detection based on isatty(1)",
"arg": {
"type": "bool",
Expand Down Expand Up @@ -728,7 +728,7 @@
},
{
"long": "ts-version",
"desc": "Whether to detect and display the version of terminal and shell",
"desc": "Whether to detect and display the version of terminal, shell and editor",
"remark": "Mainly for benchmarking",
"arg": {
"type": "bool",
Expand Down
15 changes: 14 additions & 1 deletion src/detection/de/de_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,20 @@ static void getGnome(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)

static void getCinnamon(FFstrbuf* result, FF_MAYBE_UNUSED FFDEOptions* options)
{
ffParsePropFileData("applications/cinnamon.desktop", "X-GNOME-Bugzilla-Version =", result);
ffStrbufSetS(result, getenv("CINNAMON_VERSION"));

if (result->length == 0)
ffParsePropFileData("applications/cinnamon.desktop", "X-GNOME-Bugzilla-Version =", result);

if (result->length == 0 && options->slowVersionDetection)
{
if (ffProcessAppendStdOut(result, (char* const[]){
"cinnamon",
"--version",
NULL
}) == NULL) // Cinnamon 6.2.2
ffStrbufSubstrAfterLastC(result, ' ');
}
}

static void getMate(FFstrbuf* result, FFDEOptions* options)
Expand Down
2 changes: 1 addition & 1 deletion src/detection/displayserver/displayserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define FF_DE_PRETTY_CINNAMON "Cinnamon"
#define FF_DE_PRETTY_MATE "Mate"
#define FF_DE_PRETTY_LXDE "LXDE"
#define FF_DE_PRETTY_LXQT "LXQT"
#define FF_DE_PRETTY_LXQT "LXQt"
#define FF_DE_PRETTY_BUDGIE "Budgie"
#define FF_DE_PRETTY_CDE "CDE"
#define FF_DE_PRETTY_UNITY "Unity"
Expand Down
1 change: 0 additions & 1 deletion src/detection/displayserver/linux/wayland/wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ static void waylandDetectWM(int fd, FFDisplayServerResult* result)
FF_STRBUF_AUTO_DESTROY procPath = ffStrbufCreate();
ffStrbufAppendF(&procPath, "/proc/%d/cmdline", ucred.pid); //We check the cmdline for the process name, because it is not trimmed.
ffReadFileBuffer(procPath.chars, &result->wmProcessName);
ffStrbufTrimRightSpace(&result->wmProcessName);
ffStrbufSubstrBeforeFirstC(&result->wmProcessName, '\0'); //Trim the arguments
ffStrbufSubstrAfterLastC(&result->wmProcessName, '/'); //Trim the path
}
Expand Down
Loading

0 comments on commit cec38b9

Please sign in to comment.