Giter VIP home page Giter VIP logo

macchina's Introduction

macchina

Fast, minimal and customizable system information frontend.

Linux • macOS • Windows • NetBSD • FreeBSD • OpenWrt • Android

Preview

About

macchina lets you view system information, like your kernel version, uptime, memory usage, processor load and much more. macchina is basic by default and extensible by design.

If you're interested in the library macchina uses to fetch system information, have a look at libmacchina; fetching-related issues should be filed on that repository.

Status

macchina is currently in maintenance mode, meaning bug fixes and little optimizations are much more prioritized over the addition of new features. This is due to the fact that we (the authors) do not have the time to focus on moving the project forward, or expanding on what is currently offered while keeping up with the demanding nature of our lives. macchina will at some point (although I can't say when) leave this stage and implement all the bells and whistles the community has been requesting.

We hope you understand our situation and continue to support macchina.

Benchmarks

Check out the benchmarks wiki page.

Features

Themes

macchina has a theming system which you can use to customize pretty much any visual aspect of the program. Themes live outside the configuration file, so you can create a bunch of them and switch between them at any time.

Why are they separate?

  • Modularity — themes are an engine of their own, and their sole purpose is to provide an interface that allows for the modification of macchina's visual components. It makes sense to separate them from the main configuration file.

  • Portability — sure, the configuration file is shareable, but what if you wanted to share the look of your macchina and not its behavior? What if you wanted to switch between dozens of themes that you very carefully designed? The way we handle customization answers this need.

Learn how to make your own.

Doctor

In the event of fetching failures, which can occur for various reasons, the --doctor flag that can tell you why that might be happening.

Configuration

See the configuration wiki page.

Customization

Have a look at the customization wiki page.

Installation

Check out the installation wiki page. We also provide prebuilt binaries with every release.

Contributors

macchina like many other open source projects, would not be where it is right now without the help of its contributors. Whether you've helped drive it forward by contributing to the codebase, packaged it so we didn't have to, or recommended it to someone you know — we truly appreciate your support!

The following is a list of awesome people that have truly shaped macchina:

  • pin: Provided massive amounts of help, feedback and testing, and is currently packaging macchina on NetBSD.
  • 123marvin123: Co-author of (lib)macchina and author of countless high-quality contributions and primarily, support for macOS and Windows.
  • uttarayan21: Co-author of (lib)macchina and author of numerous shipshape contributions and primarily, support for Android and OpenWrt.

Looking to help? Read this first.

macchina's People

Contributors

123marvin123 avatar 414owen avatar codelongandprosper90 avatar curiouslycurious avatar fantasyteddy avatar gobidev avatar grtcdr avatar laurentlbm avatar liushuyu avatar rashil2000 avatar rolv-apneseth avatar sak96 avatar signed-log avatar sped0n avatar uttarayan21 avatar varlad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macchina's Issues

[BUG] Macchina crashes on --theme def

Describe the bug
Using

macchina -t def

causes

memory allocation of 18446744073709551613 bytes failed
[1]    22666 abort (core dumped)  macchina -t def

To Reproduce
Steps to reproduce the behavior:

  1. macchina -t def

Expected behavior
Run normally

Screenshots
macchina bug

System Information

  • Distribution: Arch Linux
  • Desktop Environment: bspwm
  • Terminal: Alacritty 0.7.2-1
  • Macchina's version: v0.5.5

Additional context
Add any other context about the problem here.

[Idea] Get GPU info

First question, where to get the information from?

I found in the pciutils repository the following:

In runs on the following systems:

Linux (via /sys/bus/pci, /proc/bus/pci or i386 ports)
FreeBSD (via /dev/pci)
NetBSD (via libpci)
OpenBSD (via /dev/pci)
GNU/kFreeBSD (via /dev/pci)
Solaris/i386 (direct port access)
Aix (via /dev/pci and odmget)
GNU Hurd (direct port access)
Windows (direct port access, see README.Windows for caveats)
CYGWIN (direct port access)
BeOS (via syscalls)
Haiku (via /dev/misc/poke)
Darwin (via IOKit)
DOS/DJGPP (via i386 ports)
SylixOS (via /proc/pci)

There are many possible places to search, depending on the kernel (or operating system). But in some cases it's a matter of reading a plain text file. In order not to make the issue too long, I recommend the first part of this article. As you can see in the article, it is possible to read the vendor identifier, device identifier and class identifier.

Step two: mapping identifiers to GPUs

I quote again the previous repository, the following:

The database of PCI IDs (the pci.ids file) gets out of date much faster
than I release new versions of this package, so it is maintained separately.

It lives at https://pci-ids.ucw.cz/, where you can browse the database,
download the most recent pci.ids file (e.g., by running the update-ids utility)
and also submit new entries.

If we go through that website, we can corroborate that the GPU information (in addition to other devices that are not relevant) can be obtained from these ID's.

At first I thought that the pci.ids file should be downloaded regularly to keep it updated but, at least in Arch Linux, I found it in /usr/share/hwdata/pci.ids.

I'm not sure this is the best way to solve it, but I think it can work, without relying on system commands or external crates.

What do we want to display?

In it's current state, Macchina is limited in the amount of displayed data. We should display more information and this issue is here to collect some ideas:

  • Disk Usage (implemented by libmacchina, needs to be included in macchina)
  • CPU / GPU Temp
  • GPU (feature implemented in aparato, and will soon integrate with libmacchina)
    • Linux
    • NetBSD
    • macOS
    • Windows
    • Android
  • Screens and their resolution
    • Linux
    • NetBSD
    • macOS
    • Windows
    • Android
  • CPU Usage
  • Local IP address

Text To Speech Support

This post has made me aware of the difficulties blind people can come across when using programs.

This will of course be a feature one can enable on their own. It's time fetchers started targeting a wider audience. 😄

If any of you lovely people has any expertise in accessibility features and can help implement this one or can help provide us with ideas, we'd really appreciate it! ❤️

[question] raspberry slow on cargo (rust?!)

When trying to install on my Raspberry, my pi is throttling the cargo installation. All 4 core go on 100% load and becomes very slow on installing. is there any easier way? im thinking "pkg install macchina".

Would you like to see this feature implemented?

Macchina, in its current state, prints basic system information.
Would you like to see me implement different pages containing different information, for example:

  • A page containing all power (display, battery) related information.
  • A page containing all usage (memory, swap) related information.

image

Add macOS benchmarks to README files

Benchmarks

In order to showcase Macchina's performance across the different platforms it supports, we need to add a macOS specific benchmark, in comparison to Neofetch under the "Benchmarks" section of bothREADME.md and README_CARGO.md

Use winfetch for comparison

Comparison on Windows shouldn't be done with neofetch. Neofetch on Windows runs with MSys2/Cygwin, which use a POSIX emulation layer. Since it is emulating bash, it will always be slower, no matter what. Bash is not a native shell in Windows.

For a fairer comparison, please use winfetch. Macchina is still faster, but only by 2x (compared to 250x with neofetch 😅)

Add an AUR package.

Not necessarily for you to do, but someone who's familiar with creating AUR packages from rust binaries could do this very easily.

Display Ubuntu nickname

(Or whatever they call it).
This is something I find myself constantly looking after: Ubuntu releases have a version number (20.04 in my case), and a "nickname" (Focal). In many cases I need the latter, and I'm always doubting about which is right.

Granted, I could just cat /etc/os-release (which is the now standard way of doing it), but I still need to ponder whether I should lsb_release, or cat /etc/lsb-release or whatever, and it distracts me from the problem at hand.

Would you add this piece of info to Macchina, I'd adopt it. Deal ?

Cheers, and thanks for your work !

[BUG] panic on an old mac

Describe the bug

> macchina
thread 'main' panicked at 'No entry found for key 0x7fe6c5600ba0', /Users/fdncred/.cargo/registry/src/github.com-1ecc6299db9ec823/core-foundation-0.9.1/src/dictionary.rs:233:43
stack backtrace:
   0:        0x1080a8d29 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h34f76b2ca42fab41
   1:        0x108080fad - core::fmt::write::h8f13d857463c51c1
   2:        0x1080a8476 - std::io::Write::write_fmt::h0a6214ccb1a8468b
   3:        0x1080a7ba4 - std::panicking::rust_panic_with_hook::h28bf9d6c3916221e
   4:        0x1080cb54a - std::panicking::begin_panic_handler::{{closure}}::h99569328be4adae9
   5:        0x1080cb4b8 - std::sys_common::backtrace::__rust_end_short_backtrace::h9a7e5cc6475b496b
   6:        0x1080cb460 - _rust_begin_unwind
   7:        0x1080cb42f - std::panicking::begin_panic_fmt::hc364d6defd6a88b8
   8:        0x108095862 - core_foundation::dictionary::CFMutableDictionary<K,V>::get::{{closure}}::h1ef14b3201e41ad6
   9:        0x108026032 - macchina::data::get_all_readouts::h822a64d8592cec98
  10:        0x1080281dc - macchina::main::hbb20e545ea1f7921
  11:        0x10800a84a - std::sys_common::backtrace::__rust_begin_short_backtrace::h41354b2dac9becba
  12:        0x10800ac46 - std::rt::lang_start::{{closure}}::hb43fe7bf99502281
  13:        0x108033dfb - _main

To Reproduce
Steps to reproduce the behavior:

  1. cargo install macchina
  2. macchina

Expected behavior
not panic

Screenshots
If applicable, add screenshots to help explain your problem.

macchina --doctor output

macchina --doctor
thread 'main' panicked at 'No entry found for key 0x7f800a501240', /Users/fdncred/.cargo/registry/src/github.com-1ecc6299db9ec823/core-foundation-0.9.1/src/dictionary.rs:233:43
stack backtrace:
   0:        0x10ff35d29 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h34f76b2ca42fab41
   1:        0x10ff0dfad - core::fmt::write::h8f13d857463c51c1
   2:        0x10ff35476 - std::io::Write::write_fmt::h0a6214ccb1a8468b
   3:        0x10ff34ba4 - std::panicking::rust_panic_with_hook::h28bf9d6c3916221e
   4:        0x10ff5854a - std::panicking::begin_panic_handler::{{closure}}::h99569328be4adae9
   5:        0x10ff584b8 - std::sys_common::backtrace::__rust_end_short_backtrace::h9a7e5cc6475b496b
   6:        0x10ff58460 - _rust_begin_unwind
   7:        0x10ff5842f - std::panicking::begin_panic_fmt::hc364d6defd6a88b8
   8:        0x10ff22862 - core_foundation::dictionary::CFMutableDictionary<K,V>::get::{{closure}}::h1ef14b3201e41ad6
   9:        0x10feb3032 - macchina::data::get_all_readouts::h822a64d8592cec98
  10:        0x10feb51dc - macchina::main::hbb20e545ea1f7921
  11:        0x10fe9784a - std::sys_common::backtrace::__rust_begin_short_backtrace::h41354b2dac9becba
  12:        0x10fe97c46 - std::rt::lang_start::{{closure}}::hb43fe7bf99502281
  13:        0x10fec0dfb - _main

System Information
You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Desktop Environment : Aqua
  • Operating System: macOS High Sierra 10.13.6
  • Terminal : iterm2
  • Macchina's version: 0.6.9

[BUG] macchina 0.7.3 test failed

Describe the bug

👋 trying to build the latest release, but run into some build issue. The error log is as below:

test failure
$ RUST_BACKTRACE=full /usr/local/Cellar/macchina/0.7.3/bin/macchina --doctor
thread 'main' panicked at 'Could not get vm page size.', /Users/rchen/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/libmacchina-0.3.1/src/macos/mod.rs:335:18
stack backtrace:
   0:        0x10772b02f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h04abbaabf148650a
   1:        0x1076ff51e - core::fmt::write::h14dac7cadec1cc70
   2:        0x107727e3a - std::io::Write::write_fmt::hfaf2e10dfdcc61d8
   3:        0x10774a313 - std::panicking::rust_panic_with_hook::h8cdc0a575f4a5a7b
   4:        0x10770c8dd - std::panicking::begin_panic::{{closure}}::h1cb5e31eebf53a0a
   5:        0x10770c8a8 - std::sys_common::backtrace::__rust_end_short_backtrace::h5289044154439ad3
   6:        0x10775d93d - std::panicking::begin_panic::ha9aa3db83f8d0fab
   7:        0x10768baf1 - macchina::data::get_all_readouts::h7f00e763b2b7f7aa
   8:        0x10769198e - macchina::main::h3272ae73cea80bf8
   9:        0x10767b3ca - std::sys_common::backtrace::__rust_begin_short_backtrace::h0fecb7c939f513a5
  10:        0x10767bb96 - std::rt::lang_start::{{closure}}::h0cc748e43438e7c3
  11:        0x1076a9819 - _main

Full build log is in here, https://github.com/Homebrew/homebrew-core/runs/2488142444
relates to Homebrew/homebrew-core#76473

[BUG] Text output overflows prematurely when window width decreases

Opening a Terminal Large enough to fit the prompt works fine.
However, when the width of the terminal window is reduced enough...
The text overflows to the next line even though it appears as it should fit.

Steps to reproduce the behavior:

  1. Open a Terminal
  2. Reduce width by about half, or as necessary
  3. Watch the text overflow

Expected behavior:
Terminal Content should have not changed

Screenshots
image

macchina --doctor output
Correct

System Information

  • Distribution: Manjaro
  • Desktop Environment: Plasma (with i3 WM)
  • Operating System: Linux
  • Terminal: Kitty
  • Macchina's version: 0.9.2

[BUG] Misinformations in macOS version.

Describe the bug
There are some false information when running macchina on macOS:

  1. "OS — macOS 10.16.0 Big Sur" - Big Sur is actually version 11.
  2. "Packages — 7" - I don't know how it's getting this info, but for me it's false - I have 6 packages installed from brew. I did a very simple test and installed one more, so now macchina shows 8. So, there is +1 difference.
  3. "Terminal — xterm-256color" - it's not a bug, more like feature request: it would be better to see terminal emulator (built-in Terminal, iTerm2, Alacritty and so on), as now it shows the value of $TERM.

To Reproduce
Steps to reproduce the behavior:

  1. run macchina.

Expected behavior
Proper info.

System Information

  • Distribution: macOS 11.2.3
  • Desktop Environment: Aqua
  • Terminal: iTerm2
  • Macchina's version: 0.6.0

[BUG] macchina doctor output not colors in windows.

Describe the bug
macchina on windows has no colors in doctor output.

Also the ascii art is really hard to see in default PowerShell

I honestly have no clue how windows handles it color codes so I don't know how to fix it.

To Reproduce
Steps to reproduce the behavior:

  1. .\macchina-windows.exe

Expected behavior
Colored output like in linux/mac

Screenshots
windows

System Information
You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Distribution: Windows 10 Pro
  • Desktop Environment: null
  • Operating System: Windows 10 Pro
  • Terminal: PowerShell
  • Macchina's version: 0.8.0

toml config ignored

Describe the bug
macchina.toml settings are being ignored

To Reproduce

export XDG_CONFIG_HOME="$HOME/.config"
cd $XDG_CONFIG_HOME && mkdir macchina && cd macchina
wget macchina.toml https://raw.githubusercontent.com/Macchina-CLI/macchina/main/macchina.toml

I have restarted the terminal, re-sourced my shell configurations and so forth, but no changes occur. Must one specify explicitly that macchina must be reading the config via a flag or so?

Expected behavior
The configuration .toml changes the appearence of macchina.

System Information

Screenshot 2021-05-19 at 01 19 00

Use console_engine for terminal control

I discovered console_engine today, which always a rich control of the terminal and how text / graphics are displayed:
https://crates.io/crates/console_engine

This would allow us to create complex images by using absolute / relative positions instead of printing spacers. Here is an example gif of what is possible (runs on macOS, Windows, Linux, haven't tried netBSD but should work on all UNIX terminals):

[BUG] no_separator is not producing written out information (macchina.toml config file)

Describe the bug
I would like to display some information with macchina. These should be without a separator and the categories should be written out (for example, "machine" should be written instead of "mac", etc.).

no_separator = true gives the error message "conflicting keys in config file: separator_color and no_separator".
So I commented out separator_color. Which in itself also works without an error message, but now the information is all abbreviated (Host = Hos, Machine = Mac, etc.). The short_shell parameter doesn't solve the problem either, regardless of whether the flag is true or false, the output remains the same.

Long story short: I only get some written out information together with a "conflict" error message but never with no_separator = true.

To Reproduce
Steps to reproduce the behavior:

  1. create macchina.toml file with macchina.toml example
  2. edit config file: no_separator = true (line 7 )#separator_color (line 63)
  3. run macchina

Expected behavior
Display some information without separator and with written out categories ("machine" instead of "mac", etc.)

Screenshots
screen1
screen2

macchina --doctor output
doctor

System Information
You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Distribution: Parrot 4.11
  • Desktop: Environment i3
  • Terminal: Kitty
  • Macchina's version: 0.8.1

[Themes] Do not allow custom themes to use built-in theme names

Macchina will probably get confused when your custom theme has the same name as the built-in theme and choose one over the other, so to avoid this, a conflict warning message needs to be printed to the screen notifying the user that their custom theme name isn't valid as it's already in use by a built-in theme.

EDIT: Currently, Macchina defaults back to the default theme when this issue is encountered, but the error message isn't helpful.

MacOS Support

As it says on the readme - macos support isn't currently implemented. I also get this when building this package via cargo:

error[E0425]: cannot find function `percentage` in module `battery`
 --> /Users/theoparis/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-0.5.4/src/bars.rs:7:20
  |
7 |     match battery::percentage(fail)
  |                    ^^^^^^^^^^ not found in `battery`

and a ton of other very similar errors.

[Info] Macchina in Termux

I have added Macchina as a package in Termux, so it can now be installed on Android through Termux with the apt package manager:

apt install macchina

photo-2021-05-05-19-19-14

If you wish I can edit the Wiki to add the Termux installation option.

Edit: You can close the issue when you see it, it is for information purposes only.

[BUG] Macchina doesn't report battery stats

Describe the bug
machina doesn't report battery status from laptop
It seems that macchina reads battery stats from hardcoded /sys/class/power_supply/BAT0/ folder
But In my system the battery is in /sys/class/power_supply/BAT1/ folder.
The acpi command seems to correctly report the battery status in my system.

To Reproduce
Steps to reproduce the behavior:

  1. machina --debug

Expected behavior
macchina reports battery stats

Screenshots
macchina_batter

System Information

  • Distribution: Arch Linux
  • Desktop Environment: bspwm
  • Terminal: Alacritty 0.7.2-1
  • Macchina's version: v0.5.5
    Additional context
    Add any other context about the problem here.

Home directory (~) is not understood in the config file

I'm pretty sure it is not specific to my machine (arch linux).

I added this line in my .config/macchina/macchina.toml config:

custom_ascii = "~/.config/macchina/arco-theme"

But I get an error:

Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

And this file exists: when I use the absolute path

custom_ascii = "/home/rambi/macchina/arco-theme"

This works.

If this is not a bug, this is clearly a usefull feature that is missing !

[BUG] macchina CPU% bar is empty when CPU usage is above 100%

Describe the bug
When the cpu usage is above 100%
macchina --bar
Shows cpu% as empty

To Reproduce
Steps to reproduce the behavior:

  1. Run some cpu intensive task
  2. Run maccina --bar

Expected behavior
I'd hope to see a full bar instead of an empty bar

Screenshots
macchina

macchina-bar

macchina --doctor output
Add a screenshot or copy and paste the output of --doctor if an element you're supposed to be seeing isn't showing up.

System Information
You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Distribution: [e.g. Pop!_OS]
  • Desktop Environment [e.g. Plasma]
  • Operating System [e.g. macOS]
  • Terminal [e.g. Alacritty]
  • Macchina's version [e.g. 0.5.9]

[Question] About the creation of a configuration file

By default macchina displays all system information in a default format. To change this, one must make use of the many options available (and there seem to be more and more of them). And this can sometimes result in a rather long command.

I'm not sure what the future plans of the project are, but it occurs to me that creating a configuration file from which to read the macchina defaults might be a good idea. Of course this is not the only way to solve the above problem; on Linux systems you could create an alias that runs macchina with the desired options.

I have also tried the different themes offered by the application. My question is, are there any plans to add custom themes? It could be an alternative to the configuration file.

Of course, whichever way you go, it's not something that will be done overnight. But whatever I can do to help, I'm willing.

[BUG] shell output starts with hyphen in some rare cases

Reporting an issue that a user raised

I'm not sure if this bug still persists as it was raised before the newer shell implementation that was recently merged into main.

Describe the bug
Most of the time, shell output is printed just fine. But in some rare cases, shell output can begin with a hyphen, e.g.
Shell — -zsh

To Reproduce
Steps to reproduce the behavior:

  1. Run macchina
  2. Observe terminal value

Expected behavior
Shell value should never start with a hyphen.

Screenshots
No screenshot provided

System Information

  • Distribution: N/A
  • Desktop Environment: N/A
  • Terminal: Tmux: server
  • Macchina's version: N/A (=0.5.4?)

Unefficient way to count pkgs

Title.
IMO using rust to count output lines it's less efficient than having the count done with pacman -Qq | wc -l. I've done a test with hyperfine only taking the chunk of code that counts packages and comparing it with that line and ofc the shell command is faster.
Just letting you know, great job btw!
(Also, remember to update the AUR pkg on the releases :D)

EDIT: I have found an alternative implementation, maybe you can import it and use it; https://github.com/alex/line-counter/blob/master/src/main.rs

structural change: rework themes

🎨 Themes

Macchina's theming implementation is very simple, but it is not modular, extensible or clean in any way.
Elements is currently stuffed with miscellaneous fields, that should be grouped together and put under a new theme structure.

[Feature request] Custom informations

I would like to be able to wrap some custom commands to display information I chose.
Like

# Show available upgrade in Voidlinux
custom_info:
  - name: XBPS
    command: xbps-query -Mnu | wc -l

I would use your fetcher on remote hosts, and run it at each login to get some useful informations, and display it prettily.

Machine name not present in /sys/class/dmi/id/product_version

Hello, it's me again.
As the title says, not every machine name is contained in "/sys/class/dmi/id/product_version". In fact, my Dell XPS 15 shows no model name in it.
There is, however, a more generalized command that works on every Linux pc: to find my model I usually do cat /sys/devices/virtual/dmi/id/product_name (this excluding btw the Manufacturer, that is contained in /sys/devices/virtual/dmi/id/sys_vendor).

So, in the end, to print out the whole line in this way I usually do (on the fish shell): echo (cat /sys/devices/virtual/dmi/id/sys_vendor) (cat /sys/devices/virtual/dmi/id/product_ name) (or, on bash, echo $(cat /sys/devices/virtual/dmi/id/sys_vendor) $(cat /sys/devices/virtual/dmi/id/product_name))

Tell me if this works for you because the current implementation doesn't.

EDIT: I just realized that it IS present in /sys/class/dmi/id/product_version, but macchina simply doesn't want it to print out on my terminal.

[BUG] Gentoo package count prints incorrect value

Describe the bug
Package count prints an incorrect value for Gentoo.
The current implentation fetches the output of ls /var/db/pkg | wc -l but this does not provide the user with the correct amount of installed packages.

The correct way fetch the package count, is to print the output of ls -d /var/db/pkg/*/* | wc -l. However, Rust doesn't support passing glob patterns to a command's args(), as the documentation states:
"Note that the argument is not passed through a shell, but given literally to the program. This means that shell syntax like quotes, escaped characters, word splitting, glob patterns, substitution, etc. have no effect."

Trying to use glob patterns returns the following error:
ls: cannot access '/var/db/pkg/*/*': No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. Run macchina

Expected behavior
Print the correct amount of installed packages in a Gentoo system.

[BUG] Palette should respect padding

Describe the bug
The palette isn't aligned with readouts when padding is adjusted.

To Reproduce

  • Run:
macchina -P 4 -p

Expected behavior
Padding should use the same padding as the readouts.

Screenshots
image

[BUG] macchina takes long time to ( ~ 2 seconds ) on hyperfine / piped commands

Describe the bug
hyperfine reports execution time at like 2 seconds.

Benchmark #1: macchina
  Time (mean ± σ):      2.284 s ±  0.623 s    [User: 28.7 ms, System: 28.1 ms]
  Range (min … max):    2.045 s …  4.055 s    10 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the
 '--warmup' or '--prepare' options.

This also occurs in some piped commands.

time macchina | xclip -sel clip
________________________________________________________
Executed in    2.07 secs      fish           external
   usr time   22.48 millis    0.00 millis   22.48 millis
   sys time   31.98 millis    2.15 millis   29.82 millis

But not in others

time macchina | tee log
________________________________________________________
Executed in   41.62 millis    fish           external
   usr time   11.07 millis  351.00 micros   10.72 millis
   sys time   12.55 millis  131.00 micros   12.42 millis

This also happens in openwrt.

To Reproduce
Steps to reproduce the behavior:

  1. hyperfine macchina

Expected behavior
Should be as fast as printing to terminal

Screenshots
hyperfine

macchina --doctor output
Add a screenshot or copy and paste the output of --doctor if an element you're supposed to be seeing isn't showing up.

System Information

  • Distribution: Arch Linux
  • Desktop Environment : bspwm
  • Operating System GNU/Linux
  • Terminal : Alacritty
  • Macchina's version : v0.6.7, v0.6.9. and also built from main branch

[BUG] `wmctrl` displays an error when running from `ssh`

Describe the bug
When running macchina in ssh (or et), the error Cannot open display is shown multiple times and the WM data row is still displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to your machine through ssh.
  2. Run macchina.

Expected behavior
No error displayed and WM - row hidden.

Screenshots
Screenshot_20210316-135745_Termux

System Information

  • Distribution: Arch Linux, Fedora
  • Desktop Environment: None
  • Terminal: ssh
  • Macchina's version: v0.5.9

But do you support custom image?

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. But do you support custom image?
  2. But do you support custom image?
  3. I'm using Alacritty and Neofetch == nnononofetch, so do you support custom image?

image

Random separator color!

Extending customization

To further extend the capabilities of Macchina, a new argument: --random-sep-color will be introduced to let Macchina pick a random separator color for you, it can be used in conjunction with --random-color.

Why?

I can never settle on what color to use, and always find myself changing the color every now and then, so I made --random-color.
But now I've noticed that it's the same case with the separator.

Make clippy happy

Enhancement
Cargo clippy reports a lot of warnings.

error: aborting due to 3 previous errors; 41 warnings emitted
error: could not compile `macchina`

To Reproduce
Steps to reproduce the behavior:

  • Clone
  • run cargo clippy

This could be fixed to improve code quality and avoid errors.

[Discussion] Manually writing completions

I made the auto complete for custom themes work with the fish shell completions.
It needed a little bit on manual tweaking.

As long as there are no breaking changes this can probably be automated.
I can probably make a patch that would apply to the macchina.fish generated from clap but I have no clue where to apply it.
The best way to apply it would probably be in the PKGBUILD or whatever packaging system is being used.

complete

Memory usage bar bug

Memory usage bar never exceeds 2 blocks, I'm working to fix this issue.

Update: latest commit fixes this issue.

Extra whitespace in the battery bar

Status

Resolved: commit 6246d63 seems to have fixed this bug.
EDIT: Nevermind that, the bug still persists.
EDIT 2: commit 805c0b8 should fix this issue.
EDIT 3: the bug still persits, but the reason this bug happens is now clear.
EDIT 4: The bug is gone! (e871ae8)

Description

macchina --bar shows an extra whitespace at the end of the battery bar before the closing bracket.

Reproducible

Yes

Reason

/// Return the correct amount of colored blocks: colored blocks are used blocks
pub fn colored_blocks(elems: &Elements, block_count: usize) -> ColoredString {
    let colored_blocks = elems.format.bar_glyph.repeat(block_count);
    colored_blocks
        .chars()
        .collect::<Vec<char>>()
        .chunks(1)
        .map(|c| c.iter().collect::<String>())
        .collect::<Vec<String>>()
        .join(" ")
        .color(elems.format.color)
}

This function is meant to split up the amount of blocks into chunks, add a space between them, color and return them. but, whenever the block_count is equal to 10, it adds an extra space!

[BUG] Formatting changed in version 0.6.3

Describe the bug
In the machine field there are no longer spaces
To Reproduce

  1. run macchina

Expected behavior
Formatting like 0.6.2
Screenshots
macchina

System Information
You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Distribution: Arch
  • Desktop Environment bspwm
  • Operating System Linux
  • Terminal Alacritty
  • Macchina's version 0.6.3

[BUG] incorrect terminal info on macOS

Describe the bug
Macchina on macOS reports "Login" as terminal, because of a possibly wrong argument being used to fetch the terminal in shared::terminal()

To Reproduce
Steps to reproduce the behavior:

  1. run macchina
  2. inspect terminal element

Expected behavior
Terminal should print the running terminal's name.

System Information

  • Operating System: macOS
  • Macchina's version: 0.6.1

Display number of packages from other package managers

It would be interesting to show the number of global packages from:

  • snap
  • flatpak
  • brew (macOS and Linux)
  • npm
  • cargo
  • choco (Windows)
  • scoop (Windows)
  • others?

Important consideration: How do we avoid a performance hit?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.