Skip to content

Commit

Permalink
Update color themes
Browse files Browse the repository at this point in the history
  • Loading branch information
metaspartan committed May 5, 2024
1 parent b2f82af commit a4403d0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ sudo ./mactop
## mactop Flags

- `--interval` or `-i`: Set the powermetrics update interval in milliseconds. Default is 1000. (For low-end M chips, you may want to increase this value)
- `--color` or `-c`: Set the UI color. Default is white. Options are 'green', 'red', 'blue', 'cyan', 'magenta', 'yellow', and 'white'. (-c green)
- `--color` or `-c`: Set the UI color. Default is white.
Options are 'green', 'red', 'blue', 'cyan', 'magenta', 'yellow', and 'white'. (-c green)
- `--version` or `-v`: Print the version of mactop.
- `--help` or `-h`: Show a help message about these flags and how to run mactop.

Expand Down
45 changes: 31 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,37 @@ func main() {
ui.Theme.Paragraph.Text.Fg = color
ui.Theme.BarChart.Bars = []ui.Color{color}
ui.Theme.Gauge.Label.Fg = color
ui.Theme.Gauge.Bar = color
logfile, err := setupLogfile()
if err != nil {
stderrLogger.Fatalf("failed to setup log file: %v", err)
}
defer logfile.Close()

if err := ui.Init(); err != nil {
stderrLogger.Fatalf("failed to initialize termui: %v", err)
}
defer ui.Close()
StderrToLogfile(logfile)
setupUI()
cpu1Gauge.BarColor = color
cpu2Gauge.BarColor = color
aneGauge.BarColor = color
gpuGauge.BarColor = color
memoryGauge.BarColor = color
} else {
logfile, err := setupLogfile()
if err != nil {
stderrLogger.Fatalf("failed to setup log file: %v", err)
}
defer logfile.Close()

if err := ui.Init(); err != nil {
stderrLogger.Fatalf("failed to initialize termui: %v", err)
}
defer ui.Close()
StderrToLogfile(logfile)
setupUI()
}

if len(os.Args) > 1 && os.Args[1] == "--interval" || len(os.Args) > 1 && os.Args[1] == "-i" {
Expand All @@ -325,20 +356,6 @@ func main() {
}
updateInterval = interval
}

logfile, err := setupLogfile()
if err != nil {
stderrLogger.Fatalf("failed to setup log file: %v", err)
}
defer logfile.Close()

if err := ui.Init(); err != nil {
stderrLogger.Fatalf("failed to initialize termui: %v", err)
}
defer ui.Close()

StderrToLogfile(logfile)
setupUI() // Initialize UI components and layout
setupGrid()

termWidth, termHeight := ui.TerminalDimensions()
Expand Down
Binary file modified screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4403d0

Please sign in to comment.