doums / baru

A simple system monitor for WM statusbar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not display

yochananmarqos opened this issue · comments

I installed the AUR package on Manjaro GNOME and setup the config file as best I could. The output appears normal, but nothing is displayed.

cpu:  4%  -  -  -   -- -   -
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  4%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31
cpu:  7%  -  bri: 99%  -   wla:Ponde 100: 90%   13h31

baru.yaml

❯ inxi -CG
CPU:       Info: 8-Core model: AMD Ryzen 7 3700X bits: 64 type: MT MCP L2 cache: 4 MiB 
           Speed: 2132 MHz min/max: 2200/5091 MHz Core speeds (MHz): 1: 2132 2: 2180 
           3: 2184 4: 2196 5: 2279 6: 3103 7: 2180 8: 2197 9: 2207 10: 2081 11: 3440 
           12: 3796 13: 3183 14: 2827 15: 2195 16: 2124 
Graphics:  Device-1: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] driver: nvidia v: 460.39 
           Device-2: Chicony Chicony USB2.0 Camera type: USB driver: uvcvideo 
           Display: x11 server: X.Org 1.20.10 driver: loaded: nvidia resolution: 
           1: 1920x1080~60Hz 2: 1920x1080~144Hz 
           OpenGL: renderer: GeForce GTX 1660 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 460.39

I think you'll need to do some extra work yourself when you want to show baru's output in the GNOME Shell panel. A tool like argos can display...

... anything that a command line script can output in a convenient, unobtrusive place.

Something like the below might get you started:

#!/bin/sh
#
## Show `baru` (system monitor) output in GNOME Shell panel via `argos`
#+ https://github.com/doums/baru
#+ https://github.com/p-e-w/argos

## IMPORTANT #############################################
#+ This script assumes `baru` is already running, happily dropping its
#+ output into a file. That info will be tail'ed here to avoid starting
#+ `baru` processes on each invocation.
#+
#+ Start this script by placing a symlink to it in the argos config dir,
#+ e.g. `ln -sf "${HOME}/bin/quickie" "${HOME}/.config/argos/baru.l.1s.sh"`.
#+ The created panel item has a `Quit` menu item or you can stop
#+ showing output simply by removing the symlink. This will NOT
#+ stop `baru`. That needs to be taken care of by other means.
########################################################

### Variables
_app="baru"
## Show output on the left side in the GNOME Shell panel (.l) and
#+ refresh every second (.1s). These options are controlled by the
#+ `argos` filename format and can be changed accordingly.
#+ https://github.com/p-e-w/argos#filename-format
_argos_symlink="${HOME}/.config/argos/${_app}.l.1s.sh"

## Where can we find `baru`s output?
#+ Bare in mind that this file will be growing as long as baru is running.
#+ It might be wise to truncate it regularly so it doesn't fill up your disk.
_log="${HOME}/Downloads/${_app}.log"


### Logic
# Get the stats.
_stats="$(tail -n 1 "$_log")"

# Show GNOME Shell panel item (including a `quit` menu).
echo "<small><tt>${_stats}</tt></small>"
echo "---"
echo "Quit | bash='rm -f ${_argos_symlink} > /dev/null 2>&1' terminal=false"

exit 0

HTH

The Argos item appears on the top bar, but the log file is not being created. I see nothing telling Baru or Argos to create it.

The Argos item appears on the top bar, but the log file is not being created. I see nothing telling Baru or Argos to create it.

Indeed, that was intentionally left outside the scope of this example script because users might have different use-cases for baru. But it could be integrated easily. If you want to run baru only when using argos to show output in the GNOME Shell panel, and stop it when quitting the argos menu item, try this version instead.

Ah, I see. That works, thanks!

Hi,

Thanks @glitsj16 for the help.

This issue seems resolved, I close the issue.