Skip to content

Commit 482b15c

Browse files
committed
Packages (Linux): try detecting pkgtool
fix #486
1 parent 1f5da27 commit 482b15c

File tree

7 files changed

+13
-5
lines changed

7 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
# 1.12.2
2+
3+
Features:
4+
* Support `pkgtool` package manager detection (Linux, Packages)
5+
16
# 1.12.1
27

38
Bugfixes:
4-
59
* Fix compiling error on Apple Slicon (Bios, macOS)
610

711
# 1.12.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ AlmaLinux, Alpine, Android, Arch, Arco, Artix, Bedrock, CachyOS, CentOS, CRUX, C
102102

103103
##### Package managers
104104
```
105-
apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, rpm, scoop, Snap, xbps
105+
apk, brew, Chocolatey, dpkg, emerge, eopkg, Flatpak, MacPorts, nix, Pacman, pkg, pkgtool, rpm, scoop, Snap, xbps
106106
```
107107

108108
##### WM themes

presets/verbose

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--kernel-format Sysname: {}; Release: {}; Version: {}
44
--uptime-format Days: {}; Hours: {}; Minutes: {}; Seconds: {}
55
--processes-format Count: {}
6-
--packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {}
6+
--packages-format All: {}; pacman: {}; pacman branch: {}; dpkg: {}; rpm: {}; emerge: {}; eopkg: {}; xbps: {}; apk: {}; flatpak-system: {}; flatpak-user: {}; snap: {}; brew: {}; brew-cask: {}; port: {}; scoop: {}; choco: {}; pkgtool: {}
77
--shell-format Process name: {}; Process path: {}; Process exe: {}; Process version: {}; User path: {}; User exe: {}; User version: {}
88
--display-format Width: {}; Height: {}; Refresh rate: {}; ScaledWith: {}; ScaledHeight: {}
99
--de-format Process name: {}; Pretty name: {}; Version: {}

src/detection/packages/packages.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ typedef struct FFPackagesResult
2121
uint32_t nixUser;
2222
uint32_t pacman;
2323
uint32_t pkg;
24+
uint32_t pkgtool;
2425
uint32_t port;
2526
uint32_t rpm;
2627
uint32_t scoop;

src/detection/packages/packages_linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ static void getPackageCounts(const FFinstance* instance, FFstrbuf* baseDir, FFPa
276276
packageCounts->nixSystem += getNixPackages(baseDir, "/run/current-system");
277277
packageCounts->pacman += getNumElements(baseDir, "/var/lib/pacman/local", DT_DIR);
278278
packageCounts->pkg += getSQLite3Int(instance, baseDir, "/var/db/pkg/local.sqlite", "SELECT count(id) FROM packages");
279+
packageCounts->pkgtool += getNumElements(baseDir, "/var/log/packages", DT_REG);
279280
packageCounts->rpm += getSQLite3Int(instance, baseDir, "/var/lib/rpm/rpmdb.sqlite", "SELECT count(blob) FROM Packages");
280281
packageCounts->snap += getSnap(baseDir);
281282
packageCounts->xbps += getXBPS(baseDir, "/var/db/xbps");

src/fastfetch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static inline void printCommandHelp(const char* command)
139139
}
140140
else if(strcasecmp(command, "packages-format") == 0)
141141
{
142-
constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco)", 21,
142+
constructAndPrintCommandHelpFormat("packages", "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (eopkg), {8} (xbps), {9} (nix-system), {10} (nix-user), {11} (nix-default), {12} (apk), {13} (pkg), {14} (flatpak-system), {15} (flatpack-user), {16} (snap), {17} (brew), {18} (brew-cask), {19} (port), {20} (scoop), {21} (choco), {22} (pkgtool)", 22,
143143
"Number of all packages",
144144
"Number of pacman packages",
145145
"Pacman branch on manjaro",
@@ -160,7 +160,8 @@ static inline void printCommandHelp(const char* command)
160160
"Number of brew-cask packages",
161161
"Number of macports packages",
162162
"Number of scoop packages",
163-
"Number of choco packages"
163+
"Number of choco packages",
164+
"Number of pkgtool packages"
164165
);
165166
}
166167
else if(strcasecmp(command, "shell-format") == 0)

src/modules/packages.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ void ffPrintPackages(FFinstance* instance)
5757
FF_PRINT_PACKAGE(port)
5858
FF_PRINT_PACKAGE(scoop)
5959
FF_PRINT_PACKAGE(choco)
60+
FF_PRINT_PACKAGE(pkgtool)
6061

6162
//Fix linter warning of unused value of all
6263
(void) all;

0 commit comments

Comments
 (0)