|
1 | 1 | # TerminalSystemMonitor.jl
|
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +This Julia package displays CPU and RAM memory usage information on your computer. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +### Step 1. Install Julia |
| 10 | + |
| 11 | +#### macOS or Linux |
| 12 | + |
| 13 | +```sh |
| 14 | +$ curl -fsSL https://install.julialang.org | sh |
| 15 | +``` |
| 16 | + |
| 17 | +#### |
| 18 | + |
| 19 | +```powershell |
| 20 | +PS> winget install julia -s msstore |
| 21 | +``` |
| 22 | + |
| 23 | +You can run `julia --version` to confirm Julia is installed on your computer. |
| 24 | + |
| 25 | + |
| 26 | +### Step 2. Download source code |
| 27 | + |
| 28 | +```sh |
| 29 | +$ git clone https://github.com/AtelierArith/TerminalSystemMonitor.jl.git |
| 30 | +$ cd TerminalSystemMonitor.jl |
| 31 | +``` |
| 32 | + |
| 33 | +### Step 3. Resolve dependencies |
| 34 | + |
| 35 | +``` |
| 36 | +$ pwd |
| 37 | +path/to/TerminalSystemMonitor.jl |
| 38 | +$ ls |
| 39 | +Project.toml README.md main.jl src |
| 40 | +$ julia -q |
| 41 | +julia> using Pkg; Pkg.activate("."); Pkg.instantiate() |
| 42 | +``` |
| 43 | + |
| 44 | +## Usage |
| 45 | + |
| 46 | +```sh |
| 47 | +$ ls |
| 48 | +Project.toml README.md main.jl src |
| 49 | +$ julia main.jl |
| 50 | +``` |
| 51 | + |
| 52 | +You will get the following output like this: |
| 53 | + |
| 54 | +``` |
| 55 | +──────────────────────╮╭──────────────────────╮ |
| 56 | +│ ┌ ┐││ ┌ ┐│ |
| 57 | +│id: 0┤■■■■ 37 ││id: 4┤■■ 23.2 │ |
| 58 | +│id: 1┤ 0 ││id: 5┤ 0 │ |
| 59 | +│id: 2┤■■■ 29 ││id: 6┤■ 15.2 │ |
| 60 | +│id: 3┤ 0 ││id: 7┤ 1 │ |
| 61 | +│ └ ┘││ └ ┘│ |
| 62 | +╰──────────────────────╯╰──────────────────────╯ |
| 63 | +╭───────────────────────╮╭───────────────────────╮ |
| 64 | +│ ┌ ┐││ ┌ ┐│ |
| 65 | +│ id: 8┤■ 10.9 ││id: 12┤ 3 │ |
| 66 | +│ id: 9┤ 0 ││id: 13┤ 0 │ |
| 67 | +│id: 10┤■ 5.9 ││id: 14┤ 2 │ |
| 68 | +│id: 11┤ 0 ││id: 15┤ 0 │ |
| 69 | +│ └ ┘││ └ ┘│ |
| 70 | +╰───────────────────────╯╰───────────────────────╯ |
| 71 | +╭──────────────────────╮ |
| 72 | +│ ┌ ┐│ |
| 73 | +│Mem: ┤■■■■■■■■ 29.4 │ |
| 74 | +│ └ ┘│ |
| 75 | +╰──────────────────────╯ |
| 76 | +``` |
| 77 | + |
| 78 | +Ofcourse, you can launch the functionality in your terminal. |
| 79 | + |
| 80 | +```julia |
| 81 | +julia> using TerminalSystemMonitor: main; main() |
| 82 | +``` |
| 83 | + |
| 84 | +## Why not htop? |
| 85 | + |
| 86 | +You might think of the `htop' command. Yes, you can: |
| 87 | + |
| 88 | +```julia |
| 89 | +julia> using Htop_jll; run(Htop_jll.htop()) |
| 90 | +``` |
| 91 | + |
| 92 | +However, [Htop_jll](https://github.com/JuliaBinaryWrappers/Htop_jll.jl?tab=readme-ov-file#platforms) only supports Unix systems. Our Julia package runs on Windows as long as Term.jl and UnicodePlots.jl support Windows. |
| 93 | + |
| 94 | +## Why not bottom? |
| 95 | + |
| 96 | +It's possible. We could use [bottom](https://github.com/ClementTsang/bottom) a.k.a `btm` command. |
| 97 | + |
| 98 | +```sh |
| 99 | +btm -b |
| 100 | +``` |
0 commit comments