Skip to content

Commit 3f622a6

Browse files
feat: add hyfetch (#24)
Co-authored-by: Spenser Black <[email protected]>
1 parent 7c9796a commit 3f622a6

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@ Fetch information about your `*fetch` tools.
99
```console
1010
$ fetchfetch
1111
______________________________________
12-
| | Fastfetch: 2.33.0
12+
| | Fastfetch: 2.55.0
1313
| >_ | fetchfetch: 1.1.0
14-
| | Neofetch: 7.1.0
15-
| | onefetch: 2.22.0
14+
| | hyfetch: 2.0.4
15+
| | Neofetch: Not installed
16+
| | onefetch: Not installed
1617
| | pfetch: Not installed
17-
| | UwUfetch: Not installed
18-
| | screenFetch: 3.9.1
18+
| | UwUfetch: 2.1
1919
| |
2020
|______________________________________|
2121
```
2222

2323
## Supported `*fetch` tools
2424

2525
* [Fastfetch][fastfetch]
26+
* [Hyfetch][hyfetch]
2627
* [Neofetch][neofetch]
2728
* [onefetch][onefetch]
2829
* [pfetch][pfetch]
2930
* [UwUfetch][uwufetch]
3031
* [screenFetch][screenfetch]
3132

3233
[fastfetch]: https://github.com/fastfetch-cli/fastfetch
34+
[hyfetch]: https://github.com/hykilpikonna/hyfetch
3335
[neofetch]: https://github.com/dylanaraps/neofetch
3436
[onefetch]: https://github.com/o2sh/onefetch
3537
[pfetch]: https://github.com/dylanaraps/pfetch

src/stats.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ char *fastfetch() {
9090
return extract_named_version(out, "fastfetch ");
9191
}
9292

93+
char *hyfetch() {
94+
// NOTE Version in the format "Version: x.x.x"
95+
char *out = app_version("hyfetch --version");
96+
return extract_named_version(out, "Version: ");
97+
}
98+
9399
char *neofetch() {
94100
// NOTE Version in the format "Neofetch x.x.x"
95101
char *out = app_version("neofetch --version");
@@ -125,14 +131,16 @@ void get_stats(FetchStat stats[STATS_SIZE]) {
125131
stats[0].version = fastfetch();
126132
stats[1].label = "fetchfetch";
127133
stats[1].version = version;
128-
stats[2].label = "Neofetch";
129-
stats[2].version = neofetch();
130-
stats[3].label = "onefetch";
131-
stats[3].version = onefetch();
132-
stats[4].label = "pfetch";
133-
stats[4].version = pfetch();
134-
stats[5].label = "UwUfetch";
135-
stats[5].version = uwufetch();
136-
stats[6].label = "screenFetch";
137-
stats[6].version = screenfetch();
134+
stats[2].label = "hyfetch";
135+
stats[2].version = hyfetch();
136+
stats[3].label = "Neofetch";
137+
stats[3].version = neofetch();
138+
stats[4].label = "onefetch";
139+
stats[4].version = onefetch();
140+
stats[5].label = "pfetch";
141+
stats[5].version = pfetch();
142+
stats[6].label = "UwUfetch";
143+
stats[6].version = uwufetch();
144+
stats[7].label = "screenFetch";
145+
stats[7].version = screenfetch();
138146
}

src/stats.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ typedef struct {
2626
*/
2727
char *fastfetch();
2828

29+
/**
30+
* Gets Hyfetch version information.
31+
*/
32+
char *hyfetch();
33+
2934
/**
3035
* Gets Neofetch version information.
3136
*/

0 commit comments

Comments
 (0)