Skip to content

Commit 70df34c

Browse files
Merge pull request #370 from LinusDierheimer/dev
Release 1.8.2
2 parents 6f92524 + c04b421 commit 70df34c

File tree

8 files changed

+86
-47
lines changed

8 files changed

+86
-47
lines changed

.github/workflows/push.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,16 @@ jobs:
189189
run: ctest
190190

191191
- name: create zip archive
192-
run: zip fastfetch-windows.zip *.dll fastfetch.exe flashfetch.exe
192+
run: zip fastfetch-$(./fastfetch --version-raw)-Windows.zip *.dll fastfetch.exe flashfetch.exe
193193

194194
- name: upload artifacts
195195
uses: actions/upload-artifact@v3
196196
with:
197197
name: fastfetch-windows
198-
path: ./fastfetch-windows.zip
198+
path: ./fastfetch-*-Windows.zip
199199

200-
windows-old:
201-
name: Windows-old
200+
win7:
201+
name: Win7
202202
runs-on: windows-latest
203203
permissions:
204204
security-events: write
@@ -263,13 +263,13 @@ jobs:
263263
run: ctest
264264

265265
- name: create zip archive
266-
run: zip fastfetch-windows-old.zip *.dll fastfetch.exe flashfetch.exe
266+
run: zip fastfetch-$(./fastfetch --version-raw)-Win7.zip *.dll fastfetch.exe flashfetch.exe
267267

268268
- name: upload artifacts
269269
uses: actions/upload-artifact@v3
270270
with:
271-
name: fastfetch-windows-old
272-
path: ./fastfetch-windows-old.zip
271+
name: fastfetch-win7
272+
path: ./fastfetch-*-Win7.zip
273273

274274
release:
275275
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'LinusDierheimer/fastfetch'
@@ -280,6 +280,7 @@ jobs:
280280
- macos
281281
- freebsd
282282
- windows
283+
- win7
283284
permissions:
284285
contents: write
285286
steps:
@@ -299,4 +300,4 @@ jobs:
299300
tag: ${{ needs.linux.outputs.ffversion }}
300301
commit: ${{ github.sha }}
301302
artifactErrorsFailBuild: true
302-
artifacts: fastfetch-linux/*,fastfetch-macos/*,fastfetch-freebsd/*,fastfetch-windows/*
303+
artifacts: fastfetch-linux/*,fastfetch-macos/*,fastfetch-freebsd/*,fastfetch-windows/*,fastfetch-win7/*

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 1.8.2
2+
3+
Bugfixes:
4+
5+
* Fix memleaks Users module (Windows)
6+
* Fix shell detection when installed with scoop (Windows)
7+
* Don't use libcJSON as wlanapi's dll name (Windows)
8+
* Align artifact names to other platforms (Windows)
9+
110
# 1.8.1
211

312
Notable Changes:
@@ -61,7 +70,7 @@ Logos:
6170

6271
Bugfixes:
6372
* Fixes disk size detection on 32bit Linux (#337)
64-
* Fixes cpu freq detection in WSL
73+
* Fixes cpu freq detection in WSL
6574
* Fixes internal bug of FFstrbuf
6675
* Fixes some memory leaks
6776
* Fixes segfault if 0 is given as argument index
@@ -137,12 +146,12 @@ Other:
137146

138147
# 1.7.0
139148

140-
This release brings support for MacOS!
149+
This release brings support for MacOS!
141150
The basics things are working, but it is far from feature parity with Linux.
142151
I developed this in a VM, so bugs on real hardware are likely.
143152
If you have a Mac and no idea what to do with your free time, i am very happy to accept pull requests / work on issues.
144153

145-
A lot of things were changed under the hood to make this possible, which should bring better performance and stability on all platforms.
154+
A lot of things were changed under the hood to make this possible, which should bring better performance and stability on all platforms.
146155

147156
Besides that, the following things have changed:
148157

@@ -208,7 +217,7 @@ Features:
208217
* Load `/etc/fastfetch/config.conf` before user config
209218
* Disk: print one decimal point if size < 100GB
210219
* `--title-fqdn` option, to print fully qualified domain name instead of host name in title
211-
220+
212221
Logos:
213222
* updated old NixOS logo
214223

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
22

33
project(fastfetch
4-
VERSION 1.8.1
4+
VERSION 1.8.2
55
LANGUAGES C
66
DESCRIPTION "Fast system information tool"
77
HOMEPAGE_URL "https://github.com/LinusDierheimer/fastfetch"
@@ -654,6 +654,7 @@ if(APPLE)
654654
PRIVATE "-weak_framework MediaRemote -F /System/Library/PrivateFrameworks"
655655
)
656656
elseif(WIN32)
657+
target_compile_definitions(libfastfetch PRIVATE -D_WIN32_WINNT=0x0601)
657658
target_link_libraries(libfastfetch
658659
PRIVATE "dwmapi"
659660
PRIVATE "gdi32"

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for
1212

1313
## Customization
1414

15-
With customization and speed being two competing goals, this project actually builds two executables.
16-
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`.
17-
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).
18-
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.
15+
With customization and speed being two competing goals, this project actually builds two executables.
16+
17+
* 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`.
18+
* 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).
19+
20+
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.
1921

2022
There are some premade config files in [`presets`](presets), including the ones used for the screenshots above. You can load them using `--load-config <filename>`. They may also serve as a good example for format arguments.
2123

2224
## Dependencies
2325

24-
Fastfetch dynamically loads needed libraries if they are available. On Linux, its only hard dependencies are `libc` (any implementation of the c standard library), `libdl` and [`libpthread`](https://man7.org/linux/man-pages/man7/pthreads.7.html) (if built with multithreading support). They are all shipped with [`glibc`](https://www.gnu.org/software/libc/), which is already installed on most linux distributions.
25-
26+
Fastfetch dynamically loads needed libraries if they are available. On Linux, its only hard dependencies are `libc` (any implementation of the c standard library), `libdl` and [`libpthread`](https://man7.org/linux/man-pages/man7/pthreads.7.html) (if built with multithreading support). They are all shipped with [`glibc`](https://www.gnu.org/software/libc/), which is already installed on most linux distributions.
2627

2728
The following libraries are used if present at runtime:
2829

@@ -66,9 +67,9 @@ For the image logo, iTerm with iterm image protocol should work. Apple Terminal
6667
* [`libvulkan`](https://www.vulkan.org/): Vulkan module. Usually has been provided by GPU drivers. [`vulkan-loader`](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-vulkan-loader) [`vulkan-headers`](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-vulkan-headers)
6768
* [`libOpenCL`](https://www.khronos.org/opencl/): OpenCL module. [`opencl-icd`](https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-opencl-icd)
6869

69-
Note: In Windows 7, 8 and 8.1, [ConEmu](https://conemu.github.io/en/AnsiEscapeCodes.html) is required to run fastfetch due to [the lack of ASCII escape code native support](https://en.wikipedia.org/wiki/ANSI_escape_code#DOS,_OS/2,_and_Windows). In addition, special build `fastfetch-windows-old` in [Github Actions](https://github.com/LinusDierheimer/fastfetch/actions) is provided to support these old systems, which
70+
Note: In Windows 7, 8 and 8.1, [ConEmu](https://conemu.github.io/en/AnsiEscapeCodes.html) is required to run fastfetch due to [the lack of ASCII escape code native support](https://en.wikipedia.org/wiki/ANSI_escape_code#DOS,_OS/2,_and_Windows). In addition, special build `fastfetch-win7` is provided to support these old systems, which
7071

71-
1. Build with the ancient MSVCRT C runtime library, instead of the modern [UCRT](https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment) C runtime library
72+
1. Build with the ancient [MSVCRT](https://en.wikipedia.org/wiki/Microsoft_Windows_library_files#MSVCRT.DLL,_MSVCP*.DLL_and_CRTDLL.DLL) C runtime library, instead of the modern [UCRT](https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment) C runtime library
7273
2. Disable stdout application buffer, which seems to problematic for ConEmu.
7374

7475
For the image logo, only chafa is supported due to [the design flaw of ConPTY](https://github.com/microsoft/terminal/issues/1173). In addition, chafa support is not built by default due to the massive dependencies of imagemagick. You must built it yourself.
@@ -118,7 +119,7 @@ Konsole, Gnome Terminal, Tilix, XFCE4 Terminal, Alacritty, Kitty, LXTerminal, De
118119

119120
## Building
120121

121-
fastfetch uses [`cmake`](https://cmake.org/) for building. [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/) is recommended for better library detection. The simplest steps to build the fastfetch and flashfetch binaries are:
122+
fastfetch uses [`cmake`](https://cmake.org/) for building. [`pkg-config`](https://www.freedesktop.org/wiki/Software/pkg-config/) is recommended for better library detection. The simplest steps to build the fastfetch and flashfetch binaries are:
122123
```bash
123124
mkdir -p build
124125
cd build
@@ -134,7 +135,7 @@ Currently GCC or clang is required (MSVC is not supported). MSYS2 with CLANG64 s
134135

135136
1. Install [MSYS2](https://www.msys2.org/#installation)
136137
1. Open `MSYS2 CLANG64` (not `MSYS2 / MSYS`, which targets cygwin C runtime)
137-
1. Install dependencies
138+
1. Install dependencies
138139
```bash
139140
pacman -Syu mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-pkgconf mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-cjson mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-opencl-icd
140141
```

src/detection/terminalshell/terminalshell_windows.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ static uint32_t getShellInfo(FFTerminalShellResult* result, uint32_t pid)
120120
ffStrbufIgnCaseEqualS(&result->shellPrettyName, "gdb") ||
121121
ffStrbufIgnCaseEqualS(&result->shellPrettyName, "lldb") ||
122122
ffStrbufIgnCaseEqualS(&result->shellPrettyName, "guake-wrapped") ||
123+
ffStrbufIgnCaseEqualS(&result->shellPrettyName, "fastfetch") || //scoop warps the real binaries with a "shim" exe
124+
ffStrbufIgnCaseEqualS(&result->shellPrettyName, "flashfetch") ||
123125
ffStrbufContainIgnCaseS(&result->shellPrettyName, "debug")
124126
) {
125127
ffStrbufClear(&result->shellProcessName);

src/detection/users/users_windows.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@
22
#include "util/windows/unicode.h"
33

44
#include <wtsapi32.h>
5-
6-
//at the time of writing, <wtsapi32.h> of MinGW doesn't have the definition of WTSEnumerateSessionsExW
7-
typedef struct _WTS_SESSION_INFO_1W {
8-
DWORD ExecEnvId;
9-
WTS_CONNECTSTATE_CLASS State;
10-
DWORD SessionId;
11-
LPWSTR pSessionName;
12-
LPWSTR pHostName;
13-
LPWSTR pUserName;
14-
LPWSTR pDomainName;
15-
LPWSTR pFarmName;
16-
} WTS_SESSION_INFO_1W, * PWTS_SESSION_INFO_1W;
17-
18-
BOOL
19-
WINAPI
20-
WTSEnumerateSessionsExW(
21-
HANDLE hServer,
22-
DWORD* pLevel,
23-
DWORD Filter,
24-
PWTS_SESSION_INFO_1W* ppSessionInfo,
25-
DWORD* pCount);
5+
#include "wtsapi32_extend.h"
266

277
void ffDetectUsers(FFlist* users, FFstrbuf* error)
288
{
@@ -48,7 +28,7 @@ void ffDetectUsers(FFlist* users, FFstrbuf* error)
4828
ffStrbufInitF((FFstrbuf*)ffListAdd(users), "%s\\%s", domainName.chars, userName.chars);
4929
}
5030

51-
WTSFreeMemory(sessionInfo);
31+
WTSFreeMemoryExW(WTSTypeSessionInfoLevel1, sessionInfo, 1);
5232

5333
if(users->length == 0)
5434
ffStrbufAppendS(error, "Unable to detect users");
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#pragma once
2+
3+
//at the time of writing, <wtsapi32.h> of MinGW doesn't have the definition of WTSEnumerateSessionsExW and friends
4+
5+
#if (_WIN32_WINNT >= 0x0601)
6+
7+
typedef struct _WTS_SESSION_INFO_1A {
8+
DWORD ExecEnvId;
9+
WTS_CONNECTSTATE_CLASS State;
10+
DWORD SessionId;
11+
LPSTR pSessionName;
12+
LPSTR pHostName;
13+
LPSTR pUserName;
14+
LPSTR pDomainName;
15+
LPSTR pFarmName;
16+
} WTS_SESSION_INFO_1A, *PWTS_SESSION_INFO_1A;
17+
18+
typedef struct _WTS_SESSION_INFO_1W {
19+
DWORD ExecEnvId;
20+
WTS_CONNECTSTATE_CLASS State;
21+
DWORD SessionId;
22+
LPWSTR pSessionName;
23+
LPWSTR pHostName;
24+
LPWSTR pUserName;
25+
LPWSTR pDomainName;
26+
LPWSTR pFarmName;
27+
} WTS_SESSION_INFO_1W, * PWTS_SESSION_INFO_1W;
28+
29+
#define WTS_SESSION_INFO_1 __MINGW_NAME_AW(WTS_SESSION_INFO_1)
30+
#define PWTS_SESSION_INFO_1 __MINGW_NAME_AW(PWTS_SESSION_INFO_1)
31+
32+
WINBOOL WINAPI WTSEnumerateSessionsExA(HANDLE hServer,DWORD* pLevel,DWORD Filter,PWTS_SESSION_INFO_1A* ppSessionInfo,DWORD* pCount);
33+
WINBOOL WINAPI WTSEnumerateSessionsExW(HANDLE hServer,DWORD* pLevel,DWORD Filter,PWTS_SESSION_INFO_1W* ppSessionInfo,DWORD* pCount);
34+
#define WTSEnumerateSessionsEx __MINGW_NAME_AW(WTSEnumerateSessionsEx)
35+
36+
typedef enum _WTS_TYPE_CLASS {
37+
WTSTypeProcessInfoLevel0,
38+
WTSTypeProcessInfoLevel1,
39+
WTSTypeSessionInfoLevel1
40+
} WTS_TYPE_CLASS;
41+
BOOL WTSFreeMemoryExA(WTS_TYPE_CLASS WTSTypeClass,PVOID pMemory,ULONG NumberOfEntries);
42+
BOOL WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass,PVOID pMemory,ULONG NumberOfEntries);
43+
#define WTSFreeMemoryEx __MINGW_NAME_AW(WTSFreeMemoryEx)
44+
45+
#endif /*(_WIN32_WINNT >= 0x0601)*/

src/detection/wifi/wifi_windows.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ static void convertIfStateToString(WLAN_INTERFACE_STATE state, FFstrbuf* result)
4040
}
4141
}
4242

43-
const char* ffDetectWifi(const FFinstance* instance, FFlist* result)
43+
const char* ffDetectWifi(FF_UNUSED_PARAM const FFinstance* instance, FFlist* result)
4444
{
45-
FF_LIBRARY_LOAD(wlanapi, &instance->config.libcJSON, "dlopen wlanapi"FF_LIBRARY_EXTENSION" failed", "wlanapi"FF_LIBRARY_EXTENSION, 1)
45+
FF_LIBRARY_LOAD(wlanapi, NULL, "dlopen wlanapi"FF_LIBRARY_EXTENSION" failed", "wlanapi"FF_LIBRARY_EXTENSION, 1)
4646
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wlanapi, WlanOpenHandle)
4747
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wlanapi, WlanEnumInterfaces)
4848
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(wlanapi, WlanQueryInterface)

0 commit comments

Comments
 (0)