teleshoes / tpbattstat

ThinkPad Battery Status
GNU General Public License v3.0
12 stars 0 forks source link

tpbattstat in system tray (trayer) #1

Open tpapp opened 10 years ago

tpapp commented 10 years ago

Hi, I am trying to use tpbattstat with a desktop setup that relies on xmonad, xmobar, and trayer. Is there a way to get the applet to show up in the system tray (provided by trayer?)

teleshoes commented 10 years ago

nope, sorry. you could maybe write a widget for xmobar or trayer using the JSON output of tpbattstat. i wrote a widget for taffybar, which is what i use {along with xmonad}. it serves as my bar and as my system tray.

p.s.: ive never used trayer; if its really easy to stick a thingie in there, i could maybe add support for it.

wolke:~$ tpbattstat -j {"image": "/usr/share/pixmaps/tpbattstat-applet//png/36x36/idle/100.png", "label": "@@|X \n0.0W ", "click": "/home/wolke/bin/tpbattstat --prefs"}

tpapp commented 10 years ago

Can you please put the code for the taffybar widget in the repo (eg in a contrib directory)?

teleshoes commented 10 years ago

unfortunately, my taffybar widget is just something i wrote and use, not a package i maintain. i dont have the time to maintain it in a useful fashion.

anyway, here is the code for it:

my generic json-to-gtk taffybar widget: https://github.com/teleshoes/wolke-home-config/blob/master/.config/taffybar/lib/JsonWidget.hs

json-widget wrapper for tpbattstat: https://github.com/teleshoes/wolke-home-config/blob/master/.config/taffybar/lib/TPBattStat.hs

deps: https://github.com/teleshoes/wolke-home-config/blob/master/.config/taffybar/lib/Clickable.hs https://github.com/teleshoes/wolke-home-config/blob/master/.config/taffybar/lib/Utils.hs

it also may or may not depend on my own fork of taffybar, i forget. my fork of taffybar: https://github.com/teleshoes/taffybar

tpapp commented 10 years ago

Thanks. If I don't want the GUI, just the functionality (especially battery balancing), is it possible to run the application in the background, eg with a cron job? Which .py file should I use for this?

I just need battery balancing on my T430s. Am I correct in assuming that tpbattstat makes battery balancing possible on Ivy Bridge Thinkpads?

teleshoes commented 10 years ago

while you can run "tpbattstat.py -j > /dev/null &", it wont work on ivy bridge because tpbattstat still uses smapi for balancing. what should work is using tpacpi-bat directly {used to live in tpbattstat, now lives in its own repo}

take a look at the tpacpi-bat repo. note that T430s isnt a known-supported model; it would be great if you could test it out and add it to the list of models in tpacpi-bat and pull-request it.

teleshoes commented 10 years ago

i have now added tpacpi to tpbattstat. you need to install tpacpi-bat first, and run tpbattstat.py -j as root