17 Commits

Author SHA1 Message Date
utox39
3847bc247a build: bump version to 0.24.2 2025-10-15 21:39:58 +02:00
utox39
784d52eac4 Merge pull request #28 from utox39/build/add-more-paths
build(build.yml): add more paths
2025-10-15 21:38:25 +02:00
utox39
f78406448a build(build.yml): add more paths 2025-10-15 21:37:54 +02:00
utox39
50b592b125 Merge pull request #27 from utox39/build/fix-paths
build(build.yml): fix paths
2025-10-15 21:34:16 +02:00
utox39
7faff1e70d build(build.yml): fix paths 2025-10-15 21:33:29 +02:00
utox39
c17b97608c Merge pull request #26 from utox39/refactor/use-utils-read-file
refactor(linux-wm): use utils.readFile
2025-10-15 21:29:24 +02:00
utox39
1e1ad7be17 feat(linux-wm): use utils.readFile 2025-10-15 21:25:29 +02:00
utox39
429c0f89b9 Merge pull request #25 from utox39/build/workflow-paths
build(build.yml): add paths
2025-10-15 20:33:45 +02:00
utox39
ad0617a7e5 build(build.yml): add paths 2025-10-15 20:32:12 +02:00
utox39
df75b0fdb5 docs(README): update README 2025-10-15 20:26:40 +02:00
utox39
89f68fe674 chore: add CONTRIBUTING.md 2025-10-15 20:22:31 +02:00
utox39
89dfeca508 docs(README): update README 2025-10-15 15:00:45 +02:00
utox39
a72ede5259 build: bump minimum zig version to 0.15.2 2025-10-15 15:00:19 +02:00
utox39
7254bda609 build: bump version to 0.24.1 2025-10-15 14:59:31 +02:00
utox39
d8ddd4a18e Merge pull request #24 from kirillrdy/main
Use the new `std.fs.File.read` function.
2025-10-15 14:46:02 +02:00
Kirill Radzikhovskyy
948554d022 The std.fs.File.Reader.read function was removed in Zig v0.15.2. 2025-10-15 10:31:33 +11:00
utox39
a9bb9cdeaf docs(README): update README 2025-10-11 18:21:20 +02:00
6 changed files with 37 additions and 10 deletions

View File

@@ -3,6 +3,10 @@ name: Build
on: on:
push: push:
branches: [ "main" ] branches: [ "main" ]
paths:
- 'src/**'
- 'build.zig'
- 'build.zig.zon'
jobs: jobs:
build: build:

18
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,18 @@
# How to contribute to Zigfetch
## Did you find a bug?
- Do not open up a GitHub issue if the bug is a security vulnerability, refer to the [security policy](https://github.com/utox39/zigfetch/blob/main/SECURITY.md).
- Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/utox39/zigfetch/issues).
- If you're unable to find an open issue addressing the problem, open a new one.
## Do you want to make some changes to the code or documentation?
1. Fork the repo.
2. Create a new branch (because the `main` branch is protected).
3. Commit and push the changes to the new branch.
4. Open a pull request.
---
**Thank you for your contribution!**

View File

@@ -27,7 +27,7 @@ Zigfetch is a minimal [neofetch](https://github.com/dylanaraps/neofetch)/[fastfe
## Requirements ## Requirements
- \>= [zig v0.15.1](https://ziglang.org/) - \>= [zig v0.15.2](https://ziglang.org/)
### Linux only ### Linux only
@@ -35,6 +35,8 @@ Zigfetch is a minimal [neofetch](https://github.com/dylanaraps/neofetch)/[fastfe
## Installation ## Installation
### Build from source
```console ```console
# Clone the repo # Clone the repo
$ git clone https://github.com/utox39/zigfetch.git $ git clone https://github.com/utox39/zigfetch.git
@@ -49,6 +51,12 @@ $ zig build -Doptimize=ReleaseSafe
$ mv ./zig-out/zigfetch ~/bin/ $ mv ./zig-out/zigfetch ~/bin/
``` ```
### Via [Homebrew](https://brew.sh/)
```console
$ brew install utox39/tap/zigfetch
```
## Usage ## Usage
```console ```console
@@ -168,4 +176,4 @@ To change the Username and Hostname color (HEX colors only):
## Contributing ## Contributing
If you would like to contribute to this project just create a pull request which I will try to review as soon as possible. Please see [CONTIBUTING](https://github.com/utox39/zigfetch/blob/main/CONTRIBUTING.md). Thanks!

View File

@@ -10,7 +10,7 @@
// This is a [Semantic Version](https://semver.org/). // This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication. // In a future version of Zig it will be used for package deduplication.
.version = "0.24.0", .version = "0.24.2",
// Together with name, this represents a globally unique package // Together with name, this represents a globally unique package
// identifier. This field is generated by the Zig toolchain when the // identifier. This field is generated by the Zig toolchain when the
@@ -28,7 +28,7 @@
// Tracks the earliest Zig version that the package considers to be a // Tracks the earliest Zig version that the package considers to be a
// supported use case. // supported use case.
.minimum_zig_version = "0.15.1", .minimum_zig_version = "0.15.2",
// This field is optional. // This field is optional.
// Each dependency must either provide a `url` and `hash`, or a `path`. // Each dependency must either provide a `url` and `hash`, or a `path`.

View File

@@ -121,10 +121,8 @@ pub fn getWindowManagerInfo(allocator: std.mem.Allocator) ![]const u8 {
defer file.close(); defer file.close();
// NOTE: https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name // NOTE: https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name
var file_buf: [16]u8 = undefined; const proc_name = try utils.readFile(allocator, file, 16);
var reader = std.fs.File.Reader.init(file, &file_buf); defer allocator.free(proc_name);
const read = try reader.read(&file_buf);
const proc_name = file_buf[0..read];
const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n"); const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n");

View File

@@ -119,8 +119,7 @@ pub fn readFile(allocator: std.mem.Allocator, file: std.fs.File, size: usize) ![
var file_buf = try allocator.alloc(u8, size); var file_buf = try allocator.alloc(u8, size);
defer allocator.free(file_buf); defer allocator.free(file_buf);
var reader = std.fs.File.Reader.init(file, file_buf); const read = try file.read(file_buf);
const read = try reader.read(file_buf);
const data = file_buf[0..read]; const data = file_buf[0..read];