gopsuinfo

command module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: BSD-2-Clause, BSD-3-Clause Imports: 11 Imported by: 0

README

gopsuinfo

This application is a part of the nwg-shell project.

This project is a Go version of my psuinfo python script, written for educational purposes, and also for better performance. The code only implements these psuinfo features that I actually use.

The program uses the gopsutil module, Copyright (c) 2014, WAKAYAMA Shirou.

For use with bars like Waybar or polybar, the gopsuinfo -c <components_string> is suitable. It prints system information in a single line:

gopsuinfo -c gatmnu

image

For panels capable of displaying an icon and text, like tint2 or nwg-panel, you need to define an executor for each component. For instance gopsuinfo -i m will return a path to the memory icon, and the current memory usage:

/usr/share/gopsuinfo/icons_light/mem.svg
2103/22008 MiB

Add all the components you need to this way. Sample output with monochrome icons in nwg-panel:

image

$ gopsuinfo -h
Use gopsuinfo list_mountpoints to see available mount points.
Usage of bin/gopsuinfo:
  -c string
    	Output (c)omponents: (a)vg CPU load, (g)rahical CPU bar,
    			disk usage by mou(n)tpoints, (t)emperatures,
    			networ(k) traffic, (m)emory, (u)ptime (default "gatmnu")
  -d string
    	CPU measurement (d)elay [timeout] (default "900ms")
  -dark
    	use (dark) icon set
  -i string
    	returns (i)con path and a single component (a, n, t, m, u) value
  -p string
    	quotation-delimited, space-separated list of mount(p)oints (default "/")
  -t	Just (t)ext, no glyphs
  -v	display (v)ersion information

Installation

Install from yoor Linux distribution repository, if possible.

Packaging status

Otherwise, clone the repository:

git clone https://github.com/nwg-piotr/gopsuinfo.git
cd gopsuinfo

Get the gopsutil library:

make get

Build binary:

make build

Install files:

sudo make install

To uninstall

sudo make uninstall

Documentation

Overview

A gopsutil-based command to display customizable system usage info in a single line

Copyright (c) 2020-2021 Piotr Miller
e-mail: nwg.piotr@gmail.com
Project: https://github.com/nwg-piotr/gopsuinfo
License: GPL3
gopsutil Copyright (c) 2014, WAKAYAMA Shirou, https://github.com/shirou/gopsutil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL