Skip to content

Commit

Permalink
Rebrand to mactop
Browse files Browse the repository at this point in the history
  • Loading branch information
metaspartan committed Apr 30, 2024
1 parent 088c9d8 commit 7531489
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/logs

goasitop
mactop
dist/
.DS_Store
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ changelog:

brews:
- name: "{{ .ProjectName }}"
homepage: "https://github.com/context-labs/goasitop"
homepage: "https://github.com/context-labs/mactop"
description: "Apple Silicon Monitor Top written in Go Lang"
url_template: "https://github.com/context-labs/goasitop/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
caveats: "goasitop requires macOS 12+, and runs only on Apple Silicon."
url_template: "https://github.com/context-labs/mactop/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
caveats: "mactop requires macOS 12+, and runs only on Apple Silicon."
install: |
bin.install "{{ .ProjectName }}"
repository:
owner: "context-labs"
name: "goasitop"
name: "mactop"
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# goasitop
# mactop

![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/context-labs/goasitop/total) ![GitHub Release](https://img.shields.io/github/v/release/context-labs/goasitop)
![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/context-labs/mactop/total) ![GitHub Release](https://img.shields.io/github/v/release/context-labs/mactop)

`goasitop` is a terminal-based monitoring tool "top" designed to display real-time metrics for Apple Silicon chips. It provides a simple and efficient way to monitor CPU and GPU usage, E-Cores and P-Cores, power consumption, and other system metrics directly from your terminal!
`mactop` is a terminal-based monitoring tool "top" designed to display real-time metrics for Apple Silicon chips. It provides a simple and efficient way to monitor CPU and GPU usage, E-Cores and P-Cores, power consumption, and other system metrics directly from your terminal!

![goasitop](screenshot2.png)
![mactop](screenshot2.png)

## Compatibility

Expand All @@ -25,30 +25,30 @@

## Install via Homebrew

Help get us on the official Homebrew formulas by giving us a star! [goasitop](https://github.com/context-labs/goasitop)
Help get us on the official Homebrew formulas by giving us a star! [mactop](https://github.com/context-labs/mactop)

```bash
brew tap context-labs/goasitop https://github.com/context-labs/goasitop
brew tap context-labs/mactop https://github.com/context-labs/mactop
```

```bash
brew install goasitop
brew install mactop
```

```bash
sudo goasitop
sudo mactop
```

## Installation

To install `goasitop`, follow these steps:
To install `mactop`, follow these steps:

1. Ensure you have Go installed on your machine. If not, you can install it by following the instructions here: [Go Installation Guide](https://go.dev/doc/install).

2. Clone the repository:
```bash
git clone https://github.com/context-labs/goasitop.git
cd goasitop
git clone https://github.com/context-labs/mactop.git
cd mactop
```

3. Build the application:
Expand All @@ -58,17 +58,17 @@ To install `goasitop`, follow these steps:

4. Run the application:
```bash
sudo ./goasitop
sudo ./mactop
```

## Usage

After installation, you can start `goasitop` by simply running:
After installation, you can start `mactop` by simply running:
```bash
sudo ./goasitop
sudo ./mactop
```

`sudo` is required to run `goasitop`
`sudo` is required to run `mactop`

Use the following keys to interact with the application:
- `q`: Quit the application.
Expand All @@ -79,13 +79,13 @@ Use the following keys to interact with the application:

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork goasitop
1. Fork mactop
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## What does goasitop use to get real-time data?
## What does mactop use to get real-time data?

- `sysctl`: For CPU model information
- `system_profiler`: For GPU Core Count
Expand All @@ -100,7 +100,7 @@ Distributed under the MIT License. See `LICENSE` for more information.

Carsen Klock - [@carsenklock](https://twitter.com/carsenklock)

Project Link: [https://github.com/context-labs/goasitop](https://github.com/context-labs/goasitop)
Project Link: [https://github.com/context-labs/mactop](https://github.com/context-labs/mactop)

## Acknowledgements

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/context-labs/goasitop/v2
module github.com/context-labs/mactop/v2

go 1.20

Expand Down
10 changes: 5 additions & 5 deletions goasitop.rb → mactop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Goasitop < Formula
class Mactop < Formula
desc "Apple Silicon Monitor Top written in Go Lang"
homepage "https://github.com/context-labs/goasitop"
homepage "https://github.com/context-labs/mactop"
version "0.1.2"
depends_on :macos

if Hardware::CPU.arm?
url "https://github.com/context-labs/goasitop/releases/download/v0.1.2/goasitop_0.1.2_darwin_arm64.tar.gz"
url "https://github.com/context-labs/mactop/releases/download/v0.1.2/mactop_0.1.2_darwin_arm64.tar.gz"
sha256 "4e3f2da4c7a20cf84abe618f105e8c8abbaa1279ec3924b4f55a0bd7d874ee0b"

def install
bin.install "goasitop"
bin.install "mactop"
end
end

def caveats
<<~EOS
goasitop requires macOS 12+, and runs only on Apple Silicon.
mactop requires macOS 12+, and runs only on Apple Silicon.
EOS
end
end
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2024 Carsen Klock under MIT License
// goasitop is a simple terminal based Apple Silicon power monitor written in Go Lang!
// mactop is a simple terminal based Apple Silicon power monitor written in Go Lang!

package main

Expand Down Expand Up @@ -245,14 +245,14 @@ func StderrToLogfile(logfile *os.File) {
syscall.Dup2(int(logfile.Fd()), 2)
}

// goasitop main function
// mactop main function

func main() {

// get version from git
version := "v0.1.2"
if len(os.Args) > 1 && os.Args[1] == "--version" {
fmt.Println("goasitop version:", version)
fmt.Println("mactop version:", version)
os.Exit(0)
}

Expand All @@ -263,8 +263,8 @@ func main() {
}

if os.Geteuid() != 0 {
fmt.Println("Welcome to goasitop! Please try again and run goasitop with sudo privileges!")
fmt.Println("Usage: sudo goasitop")
fmt.Println("Welcome to mactop! Please try again and run mactop with sudo privileges!")
fmt.Println("Usage: sudo mactop")
os.Exit(1)
}

Expand Down Expand Up @@ -368,7 +368,7 @@ func setupLogfile() (*os.File, error) {
return nil, fmt.Errorf("failed to make the log directory: %v", err)
}
// open the log file
logfile, err := os.OpenFile("logs/goasitop.log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0660)
logfile, err := os.OpenFile("logs/mactop.log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0660)
if err != nil {
return nil, fmt.Errorf("failed to open log file: %v", err)
}
Expand Down Expand Up @@ -515,7 +515,7 @@ func parseProcessMetrics(powermetricsOutput string, processMetrics []ProcessMetr
matches := dataRegex.FindStringSubmatch(line)
if len(matches) > 3 {
processName := matches[1]
if processName == "goasitop" || processName == "main" || processName == "powermetrics" {
if processName == "mactop" || processName == "main" || processName == "powermetrics" {
continue // Skip this process
}
id, _ := strconv.Atoi(matches[2])
Expand Down

0 comments on commit 7531489

Please sign in to comment.