You are not logged in.

#1 2009-10-11 22:25:24

sDoky
Member
From: Brno, Czech Republic
Registered: 2008-09-24
Posts: 183

[Solved] Conky power rate

Hi, I am trying to get power rate to conky. I have found many scripts, none were working though. I have an Dell Latitude D610, Two batteries, I use only BATT1, BATT0 is unused.

[sdoky@sdoky-laptop BAT1]$ cat /proc/acpi/battery/BAT1/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            1301 mA
remaining capacity:      648 mAh
present voltage:         10956 mV

Thank you

Last edited by sDoky (2009-10-12 09:10:16)


Linux!

Offline

#2 2009-10-12 00:59:24

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: [Solved] Conky power rate

grep + sed


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2009-10-12 06:10:22

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] Conky power rate

From the conky manual:

battery    (num)    Battery status and remaining percentage capacity of ACPI or APM battery. ACPI battery number can be given as argument (default is BAT0).

Look, it takes arguments! Why try the hard way if you can let conky do the dirty work? wink


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2009-10-12 07:53:53

sDoky
Member
From: Brno, Czech Republic
Registered: 2008-09-24
Posts: 183

Re: [Solved] Conky power rate

Yeah, I am trying to get there actual power consumption in Watts. I want to know how much my laptop consumes, especially on battery and it is not there


Linux!

Offline

#5 2009-10-12 09:10:00

sDoky
Member
From: Brno, Czech Republic
Registered: 2008-09-24
Posts: 183

Re: [Solved] Conky power rate

Solved myself.

${execi 2 sudo powertop -d --time=0 | grep 'Power usage (ACPI estimate):' | cut -c30-33}W

Linux!

Offline

#6 2010-12-09 04:39:59

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: [Solved] Conky power rate

You need to remove sudo from that command.

${execi 2 powertop -d --time=0 | grep 'Power usage (ACPI estimate):' | cut -c 30-33}W

Unless, system will hang upon xinit, waiting for sudo password.
That powertop command will work without sudo.

Last edited by ammon (2010-12-09 04:40:16)

Offline

#7 2010-12-09 09:49:16

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [Solved] Conky power rate

And if you need sudo, you could tell it to not require a password for powertop. Add sth like this to your sudoers file

USERNAME localhost=NOPASSWD: /usr/bin/powertop

Offline

#8 2010-12-09 13:53:50

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [Solved] Conky power rate

For security reasons, I recommend that you change that to

USERNAME localhost=NOPASSWD: /usr/bin/powertop -d .*

This forces powertop to run in dump mode only.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

Board footer

Powered by FluxBB