su8 / pinky-bar

Gather some system information and show it in this program
GNU General Public License v3.0
14 stars 5 forks source link

Use pinkybar with more than one format #24

Open lasers opened 6 years ago

lasers commented 6 years ago

Hi, it is not possible to use both tmux and py3status as I would get this on my py3status.

#CPU #4% #Pkgs #1807 #ZERO_AGAIN! #Time #09:33 PM

This goes same for tmux and any other new option (eg, window manager).

I'm thinking maybe if we can supply pinkybar with format or something.

# ~/.tmux.conf
set -g status-right '#(~/.cache/bin/pinkybar)'  # OLD
set -g status-right '#(~/.cache/bin/pinkybar --format tmux)'  # NEW

Same for py3status and others. If we don't address this and add more color support such as shell then we may still have same problem so having --format shell or such could solve this particular issue... or force users to make && make install with a different pinkybar format which could be messy.

su8 commented 6 years ago

It shouldn't be difficult to make it happen. 4 static vars, several STREQ in parse_opts and we are done.

Can you open up another issue to remind me to remove the labels from RAM and drive options ? Thanks in advance.

su8 commented 6 years ago

Support for --fmt is added in the latest commit, and also for different configuration file. Thanks for the suggestion.

lasers commented 6 years ago

I test first with py3status. Came out malformed.

# Uncommented lines

--fmt=py3status
--color1='[\?color=blue&show '
--color2='[\?color=violet&show '
--color3='[\?color=yellow&show '

--title=CPU
--cpu-percent

--title=TEMP
--cputemp

--title=RAM
--ramused
--title=(
--ramperc
--title=)

--title=HDD
--driveperc

--title=Pkgs
--packages

--kernel
--time

PUCPU] cent4%] EMPTEMP] 50C] AMRAM] 6275MB] (] 72%] )] DDHDD] rc141%] kgsPkgs] s1827] sLinux 4.9.0-6-amd64] s08:31 PM]

su8 commented 6 years ago

Funny enough, when I type the colors in their variables the code works, otherwise it's malformed

2018-04-23-100807_1920x1080_scrot

su8 commented 6 years ago

I just rollback the old formatting system, but preserved the option to use different location for the configuration file. Whatever I did, the CLR1, CLR2, CLR3 keys get overwritten by the passed options, as shown in the picture above the code works with pre-filled color strings, but not when it enters the parse_opt switch :(