joncrangle / sketchybar-system-stats

A simple CPU, memory and disk usage event provider for Sketchybar
GNU General Public License v3.0
1 stars 0 forks source link

install doesn't work on mac #8

Open hemna opened 1 week ago

hemna commented 1 week ago

I followed the instructions in the README and it doesn't work.

  stable-aarch64-apple-darwin installed - rustc 1.81.0 (eeb90cda1 2024-09-04)

Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish

╭─~ ❯
└─> . ~/.cargo/env

└─> git clone https://github.com/joncrangle/sketchybar-system-stats.git
cd sketchybar-system-stats
cargo build --release
Cloning into 'sketchybar-system-stats'...
warning: templates not found in /Users/i530566/.git-template
remote: Enumerating objects: 251, done.
remote: Counting objects: 100% (73/73), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 251 (delta 39), reused 42 (delta 14), pack-reused 178 (from 1)
Receiving objects: 100% (251/251), 111.18 KiB | 6.95 MiB/s, done.
Resolving deltas: 100% (136/136), done.
    Updating crates.io index
  Downloaded utf8parse v0.2.2
  Downloaded shlex v1.3.0
  Downloaded anstyle-parse v0.2.5
  Downloaded strsim v0.11.1
  Downloaded is_terminal_polyfill v1.70.1
  Downloaded unicode-ident v1.0.12
  Downloaded quote v1.0.37
  Downloaded clap v4.5.18
  Downloaded memchr v2.7.4
  Downloaded proc-macro2 v1.0.86
  Downloaded sysinfo v0.31.4
  Downloaded clap_builder v4.5.18
  Downloaded core-foundation-sys v0.8.7
  Downloaded syn v2.0.76
  Downloaded clap_derive v4.5.18
  Downloaded cc v1.1.15
  Downloaded anstream v0.6.15
  Downloaded clap_lex v0.7.2
  Downloaded anstyle-query v1.1.1
  Downloaded anstyle v1.0.8
  Downloaded sketchybar-rs v0.2.0
  Downloaded heck v0.5.0
  Downloaded colorchoice v1.0.2
  Downloaded libc v0.2.158
  Downloaded 24 crates (2.0 MB) in 0.68s
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.12
   Compiling shlex v1.3.0
   Compiling utf8parse v0.2.2
   Compiling libc v0.2.158
   Compiling colorchoice v1.0.2
   Compiling anstyle v1.0.8
   Compiling is_terminal_polyfill v1.70.1
   Compiling anstyle-query v1.1.1
   Compiling strsim v0.11.1
   Compiling clap_lex v0.7.2
   Compiling heck v0.5.0
   Compiling anstyle-parse v0.2.5
   Compiling cc v1.1.15
   Compiling memchr v2.7.4
   Compiling core-foundation-sys v0.8.7
   Compiling anstream v0.6.15
   Compiling clap_builder v4.5.18
   Compiling sketchybar-rs v0.2.0
   Compiling sysinfo v0.31.4
   Compiling quote v1.0.37
   Compiling syn v2.0.76
   Compiling clap_derive v4.5.18
   Compiling clap v4.5.18
   Compiling stats_provider v0.5.4 (/Users/I530566/utils/sketchybar-system-stats)
    Finished `release` profile [optimized] target(s) in 5.77s

╭─sketchybar-system-stats/assets on  main ❯
└─> stats_provider --help
zsh: command not found: stats_provider
╭─sketchybar-system-stats/assets on  main ❯
└─> ls -al ~/.cargo/bin
drwxr-xr-x I530566 staff 608 B  Mon Oct 14 15:22:45 2024  .
drwxr-xr-x I530566 staff 288 B  Mon Oct 14 15:24:01 2024  ..
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  cargo
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  cargo-clippy
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  cargo-fmt
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  cargo-miri
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  clippy-driver
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rls
.rwxr-xr-x I530566 staff  20 MB Fri Jul  5 09:18:39 2024  ruff
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rust-analyzer
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rust-gdb
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rust-gdbgui
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rust-lldb
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rustc
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rustdoc
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rustfmt
.rwxr-xr-x I530566 staff 7.2 MB Mon Oct 14 15:22:41 2024  rustup
.rwxr-xr-x I530566 staff  22 MB Fri Sep 13 13:54:52 2024  uv
.rwxr-xr-x I530566 staff 328 KB Fri Sep 13 13:54:52 2024  uvx
hemna commented 1 week ago

Looks like I had to run an install command. I know nothing about rust or cargo.

cd sketchybar-system-stats
╭─sketchybar-system-stats on  main is 📦 v0.5.4 via 🦀 v1.81.0 ❯
└─> cargo install --path .
  Installing stats_provider v0.5.4 (/Users/I530566/utils/sketchybar-system-stats)
    Updating crates.io index
     Locking 45 packages to latest compatible versions
      Adding sysinfo v0.31.4 (latest: v0.32.0)
      Adding windows v0.57.0 (latest: v0.58.0)
      Adding windows-core v0.57.0 (latest: v0.58.0)
      Adding windows-implement v0.57.0 (latest: v0.58.0)
      Adding windows-interface v0.57.0 (latest: v0.58.0)
      Adding windows-result v0.1.2 (latest: v0.2.0)
      Adding windows-sys v0.52.0 (latest: v0.59.0)
  Downloaded unicode-ident v1.0.13
  Downloaded proc-macro2 v1.0.87
  Downloaded clap v4.5.20
  Downloaded clap_builder v4.5.20
  Downloaded cc v1.1.30
  Downloaded syn v2.0.79
  Downloaded libc v0.2.159
  Downloaded 7 crates (1.4 MB) in 0.38s
   Compiling proc-macro2 v1.0.87
   Compiling unicode-ident v1.0.13
   Compiling libc v0.2.159
   Compiling cc v1.1.30
   Compiling clap_builder v4.5.20
   Compiling sketchybar-rs v0.2.0
   Compiling sysinfo v0.31.4
   Compiling quote v1.0.37
   Compiling syn v2.0.79
   Compiling clap_derive v4.5.18
   Compiling clap v4.5.20
   Compiling stats_provider v0.5.4 (/Users/I530566/utils/sketchybar-system-stats)
    Finished `release` profile [optimized] target(s) in 4.35s
  Installing /Users/I530566/.cargo/bin/stats_provider
   Installed package `stats_provider v0.5.4 (/Users/I530566/utils/sketchybar-system-stats)` (executable `stats_provider`)
joncrangle commented 1 week ago

Glad you were able to get it working.

I just pushed a new release that I would encourage you to upgrade to (v.0.6.0). I discovered a memory leak in one of the underlying dependencies that I fixed and plan to report. The new version fixes the memory leak and is much more minimal in terms of memory and port usage.

If you don't want to build yourself, you can download a prebuilt binary from Latest release. In the "Assets", the aarch64 is for Mac Silicon, while the x86_64 is for older Intel Macs.

Alternatively, if you would like to continue building yourself, you can do a git pull from your sketchybar-system-stats directory, and then do cargo build --release. By default, the Rust compiler puts the compiled binary in the target/release subdirectory. When you use cargo install, it installs it wherever you specify.