Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89dfeca508 | ||
|
|
a72ede5259 | ||
|
|
7254bda609 | ||
|
|
d8ddd4a18e | ||
|
|
948554d022 | ||
|
|
a9bb9cdeaf |
10
README.md
10
README.md
@@ -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
|
||||||
|
|||||||
@@ -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.1",
|
||||||
|
|
||||||
// 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`.
|
||||||
|
|||||||
@@ -122,8 +122,7 @@ pub fn getWindowManagerInfo(allocator: std.mem.Allocator) ![]const u8 {
|
|||||||
|
|
||||||
// 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;
|
var file_buf: [16]u8 = undefined;
|
||||||
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 proc_name = file_buf[0..read];
|
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");
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user