dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
358 stars 6 forks source link

battery status #26

Closed aMyTimed closed 7 months ago

aMyTimed commented 7 months ago

is this possible

on my laptop it would be nice to have battery status

dj95 commented 7 months ago

Hey,

at this point it's just possible with the command widget. You could write a script or command that outputs the percentage and zjstatus will display it with the widget.

Another option is not possible, unfortunately, due to the WASM sandbox

aMyTimed commented 7 months ago

rip

benzwt commented 6 months ago

@aMySour @dj95

Thanks to the command widget, I managed to show system info with conky.

the info from left to right are:

the command is

conky -i1 -c ~/.conky/conky.conf

conky.conf is as follow:

conky.config = {
    units_spacer = '',
    short_units = true,
    out_to_console = true,
    total_run_times = 1,
};
conky.text = [[${uptime_short}${fs_used_perc}% ${fs_free}${loadavg 1}${memperc}% ${memmax} 󰁹${battery_percent}%]]

You guys will notice that I get several information in one shot, because it is fast. conky do support fg: bg: syntax, but it don't work with jzstatus out of the box. Thus, I have to write my raw color code explicitly in the conf. But It is worth to do so in terms of performance.

Besides, I modified the command widget in order to output the raw color code. I'm still working on integrating my code to zjstatus in a better way. @dj95 would you tell me how to run the benchmark ? I need this before summiting a PR. thanks!

Screenshot from 2023-12-22 16-11-35

dj95 commented 6 months ago

Hello @benzwt

thank you for your effort! I really appreciate your work and contribution.

In my last coding session I didn't implement a benchmark for the command widget because it only rendered the output and benchmarking the zellij part with run_command does not make sense IMO. However, I've added the benchmark for it right now, such that you can validate the performance impact of your implementation.

You can run just bench in case you have just installed. Otherwise you could directly run the command printed in the justfile (https://github.com/dj95/zjstatus/blob/main/justfile#L2).

In case you need any advice or review, feel free to open a draft pull request, so we can directly work on it together.

benzwt commented 6 months ago

@aMySour @dj95

Merry X'mas ! my PR is submitted https://github.com/dj95/zjstatus/pull/28