Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.49k stars 52 forks source link

Modifying keys does nothing on macOS #260

Closed MichaelMMeskhi closed 2 years ago

MichaelMMeskhi commented 2 years ago

Using a custom theme or default, when removing/adding keys, nothing changes. I still see the same default keys on macOS

Screen Shot 2022-08-02 at 1 11 10 PM Screen Shot 2022-08-02 at 1 11 47 PM
grtcdr commented 2 years ago

Can you try to reproduce this with the following configuration?

touch ~/.config/macchina/themes/example.toml and add the following:

[keys]
os = "<Operating System>"

temporarily move the configuration file, as to disable it:

mv ~/.config/macchina/macchina.toml

in your shell:

macchina -t example

If you're not seeing <Operating System> in place of the OS readout, then I'll begin to look deeper.

MichaelMMeskhi commented 2 years ago

Resulting output:

Screen Shot 2022-08-02 at 1 32 09 PM
grtcdr commented 2 years ago

Then something else might be wrong with your configuration, or the theme you've created, can I have a look at both, in textual form?

MichaelMMeskhi commented 2 years ago

Hydrogen.toml

# Hydrogen

spacing         = 2
padding         = 0
hide_ascii      = true
separator       = ">"
key_color       = "Yellow"
separator_color = "White"

[palette]
type = "Dark"
visible = false

[bar]
glyph           = "ߋ"
symbol_open     = '['
symbol_close    = ']'
hide_delimiters = true
visible         = true

[box]
title           = "MacBook λ"
border          = "plain"
visible         = true

[box.inner_margin]
x               = 1
y               = 0

[randomize]
key_color       = false
separator_color = false

[keys]
host            = "Host"
battery         = "Battery"
os              = "OS"
terminal        = "Terminal"
uptime          = "Uptime"
memory          = "Memory"
machine         = "Machine"
resolution      = "Resolution"
cpu_load        = "CPU Load"
cpu             = "CPU"

Config file:

# Specifies the network interface to use for the LocalIP readout
interface = "wlan0"

# Lengthen uptime output
long_uptime = true

# Lengthen shell output
long_shell = false

# Lengthen kernel output
long_kernel = false

# Toggle between displaying the current shell or your user's default one.
current_shell = true

# Toggle between displaying the number of physical or logical cores of your
# processor.
physical_cores = true

# Themes need to be placed in "$XDG_CONFIG_DIR/macchina/themes" beforehand.
# e.g.:
#  if theme path is /home/foo/.config/macchina/themes/Sodium.toml
#  theme should be uncommented and set to "Sodium"
#
theme = "Hydrogen"

# Displays only the specified readouts.
# Accepted values (case-sensitive):
#   - Host
#   - Machine
#   - Kernel
#   - Distribution
#   - OperatingSystem
#   - DesktopEnvironment
#   - WindowManager
#   - Resolution
#   - Backlight
#   - Packages
#   - LocalIP
#   - Terminal
#   - Shell
#   - Uptime
#   - Processor
#   - ProcessorLoad
#   - Memory
#   - Battery
# Example:
# show = ["Battery", "Memory"]
grtcdr commented 2 years ago

Your theme and configuration are both working as they should, on my machine.

Example:

Is this not what you are experiencing?

MichaelMMeskhi commented 2 years ago

Okay so I figured it out. I was removing keys in the theme and they were still showing up but I realized I have to edit the show option in the config file now it works well. Thank you. Side question, is there a way to include the ASCII logo into the box?

grtcdr commented 2 years ago

Side question, is there a way to include the ASCII logo into the box?

I don't think so, but it has been a long time since I've seriously worked with macchina's codebase. I don't personally recall ever adding this in. Also, if something is neither mentioned in the manpages nor the wiki, then it's not a feature.

Okay so I figured it out. I was removing keys in the theme and they were still showing up but > I realized I have to edit the show option in the config file now it works well.

Awesome, glad you were able to fix it. Always keep in mind that themes have no effect on macchina's behavior, it's only macchina.toml that can do that.