Skip to content

Commit 3823528

Browse files
committed
rename project
1 parent ca91f3d commit 3823528

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Zigbar
1+
# ZSP
22

3-
Zigbar is my personal ZSH prompt written in [Zig](https://ziglang.org).
3+
ZSP is my personal ZSH prompt written in [Zig](https://ziglang.org).
44

5-
<img alt="screenshot of Zigbar prompt in a terminal" src=".github/screenshot.avif" width="640">
5+
<img alt="screenshot of ZSP prompt in a terminal" src=".github/screenshot.avif" width="640">
66

77
From the blog:
88

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const std = @import("std");
22
// const zon: struct { version: []const u8 } = @import("./build.zig.zon");
33

4-
const name = "zigbar";
5-
const version = std.SemanticVersion.parse("0.6.0") catch unreachable;
4+
const name = "zsp";
5+
const version = std.SemanticVersion.parse("0.7.0") catch unreachable;
66

77
const targets: []const std.Target.Query = &.{
88
.{ .cpu_arch = .aarch64, .os_tag = .macos },

build.zig.zon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
2-
.name = .zigbar,
3-
.version = "0.6.0",
4-
.fingerprint = 0xa016003a8035f03b,
2+
.name = .zsp,
3+
.version = "0.7.0",
4+
.fingerprint = 0xf2306f9dd50373c9,
55
.minimum_zig_version = "0.14.0",
66
.paths = .{
77
"build.zig",

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn main() !void {
3939
}
4040

4141
if (args.items.contains("version")) {
42-
tty.print("zigbar {} ({s})\n", .{
42+
tty.print("zsp {} ({s})\n", .{
4343
update.build_version,
4444
update.build_triple,
4545
});

src/shell/zsh.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414
zmodload zsh/datetime
1515
zmodload zsh/mathfunc
1616

17-
__zigbar_get_time() {
18-
(( ZIGBAR_CAPTURED_TIME = int(rint(EPOCHREALTIME * 1000)) ))
17+
__zsp_get_time() {
18+
(( ZSP_CAPTURED_TIME = int(rint(EPOCHREALTIME * 1000)) ))
1919
}
2020

21-
prompt_zigbar_precmd() {
22-
if (( ${+ZIGBAR_START_TIME} )); then
23-
__zigbar_get_time && (( ZIGBAR_DURATION = ZIGBAR_CAPTURED_TIME - ZIGBAR_START_TIME ))
24-
unset ZIGBAR_START_TIME
21+
prompt_zsp_precmd() {
22+
if (( ${+ZSP_START_TIME} )); then
23+
__zsp_get_time && (( ZSP_DURATION = ZSP_CAPTURED_TIME - ZSP_START_TIME ))
24+
unset ZSP_START_TIME
2525
else
26-
unset ZIGBAR_DURATION
26+
unset ZSP_DURATION
2727
fi
2828
}
2929

30-
prompt_zigbar_preexec() {
31-
__zigbar_get_time && ZIGBAR_START_TIME=$ZIGBAR_CAPTURED_TIME
30+
prompt_zsp_preexec() {
31+
__zsp_get_time && ZSP_START_TIME=$ZSP_CAPTURED_TIME
3232
}
3333

3434
autoload -Uz add-zsh-hook
35-
add-zsh-hook precmd prompt_zigbar_precmd
36-
add-zsh-hook preexec prompt_zigbar_preexec
35+
add-zsh-hook precmd prompt_zsp_precmd
36+
add-zsh-hook preexec prompt_zsp_preexec
3737

3838
setopt promptsubst
3939

40-
PROMPT='$(zigbar prompt --columns="$COLUMNS" --duration="${ZIGBAR_DURATION:-}")'
40+
PROMPT='$(zsp prompt --columns="$COLUMNS" --duration="${ZSP_DURATION:-}")'

src/update.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub const build_triple: []const u8 = config.triple;
2020
pub const build_version: Version = config.version;
2121

2222
// Should I be using path builder? (Windows is not supported)
23-
const tmp_path = "/tmp/zigbar";
23+
const tmp_path = "/tmp/zsp";
2424
const tar_prefix = build_name ++ "-" ++ build_triple;
2525
const tar_name = tar_prefix ++ ".tar.gz";
2626
const tar_path = tmp_path ++ "/" ++ tar_name;
@@ -57,7 +57,7 @@ pub fn download(allocator: Allocator, options: UpdateOptions) UpdateError!Versio
5757
"Accept: application/vnd.github+json",
5858
"-H",
5959
"X-GitHub-Api-Version: 2022-11-28",
60-
"https://api.github.com/repos/dbushell/zigbar/releases",
60+
"https://api.github.com/repos/dbushell/zsp/releases",
6161
},
6262
}) catch return error.ApiError;
6363
defer {
@@ -158,5 +158,5 @@ fn installBinary(allocator: Allocator, dir: fs.Dir) !void {
158158
const exe_path = try fs.selfExePathAlloc(allocator);
159159
defer allocator.free(exe_path);
160160
try fs.deleteFileAbsolute(exe_path);
161-
try fs.copyFileAbsolute(tmp_path ++ "/zigbar", exe_path, .{});
161+
try fs.copyFileAbsolute(tmp_path ++ "/zsp", exe_path, .{});
162162
}

0 commit comments

Comments
 (0)