You are not logged in.

#1 2011-12-29 22:04:20

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

[SOLVED]ACPI Battery not showing in Conky

I have been trying to add my battery status to my conky setup.  Nothing shows up (i.e., no battery state).  Conky lines of interest:

${color}ACPI Battery: ${color DeepSkyBlue}$battery
${battery_bar 11,0}

I installed the acpi package to be able to see the acpi data from the terminal as shown here with some lsmod and dmesg outputs.

┌─[mike]──[archbang]:~$
└──>>acpi -bi
Battery 0: Charging, 98%, 00:08:25 until charged
Battery 0: design capacity 4514 mAh, last full capacity 4514 mAh = 100%
┌─[mike]──[archbang]:~$
└──>>dmesg|grep battery
[    3.740644] ACPI: Battery Slot [C23B] (battery present)
[    3.740715] ACPI: Battery Slot [C23A] (battery absent)
┌─[mike]──[archbang]:~$
└──>>lsmod|grep battery
battery                 6453  0

I also tried the battery monitor in tint2 and lxpanel.  They both work.  Any ideas what could be the problem with conky?

Last edited by mike4ca (2012-01-07 19:35:09)


Free Software Foundation member 10865

Offline

#2 2011-12-30 03:53:26

ArchVortex
Retired
From: Ts’elxweyeqw, Canada
Registered: 2011-04-01
Posts: 1,465

Re: [SOLVED]ACPI Battery not showing in Conky

Your config works for me although it gives me a maximum reading of 'unknown 96%' . It says 'discharging 96%' when running on battery and 'charging 96%' when charging.


You have the capacity to learn from mistakes. You'll learn a lot today.
FP:E5F8 7DBA 8128 9ACB 75F7 7279 BE34 AB66 76D9 16DE
KEY ID:76D916DE
Currently running ArchBang / LFS / OpenSUSE Tumbleweed

Offline

#3 2012-01-06 20:05:36

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: [SOLVED]ACPI Battery not showing in Conky

I thought I had violated pablokal's 1st rule in getting help, I forgot to include a printout of lspci -vnn for my hardware related question!  Upon running the command I don't think it includes any info on my battery, but here it is...

┌─[mike]──[archbang]:~$
└──>>lspci -vnn
00:00.0 Host bridge [0600]: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub [8086:2a00] (rev 0c)
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, fast devsel, latency 0
	Capabilities: <access denied>
	Kernel driver in use: agpgart-intel
	Kernel modules: intel-agp

00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) [8086:2a02] (rev 0c) (prog-if 00 [VGA controller])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, fast devsel, latency 0, IRQ 46
	Memory at e4600000 (64-bit, non-prefetchable) [size=1M]
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 4000 [size=8]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

00:02.1 Display controller [0380]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) [8086:2a03] (rev 0c)
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, fast devsel, latency 0
	Memory at e4700000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: <access denied>

00:1a.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 [8086:2834] (rev 03) (prog-if 00 [UHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 16
	I/O ports at 4020 [size=32]
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd

00:1a.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 [8086:2835] (rev 03) (prog-if 00 [UHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 17
	I/O ports at 4040 [size=32]
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd

00:1a.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 [8086:283a] (rev 03) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 18
	Memory at e4800000 (32-bit, non-prefetchable) [size=1K]
	Capabilities: <access denied>
	Kernel driver in use: ehci_hcd
	Kernel modules: ehci-hcd

00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03)
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, fast devsel, latency 0, IRQ 47
	Memory at e4804000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd-hda-intel

00:1c.0 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 [8086:283f] (rev 03) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=08, subordinate=08, sec-latency=0
	Capabilities: <access denied>
	Kernel driver in use: pcieport
	Kernel modules: shpchp

00:1c.1 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 [8086:2841] (rev 03) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=10, subordinate=10, sec-latency=0
	I/O behind bridge: 00007000-00007fff
	Memory behind bridge: e4100000-e41fffff
	Prefetchable memory behind bridge: 0000000084400000-00000000845fffff
	Capabilities: <access denied>
	Kernel driver in use: pcieport
	Kernel modules: shpchp

00:1c.2 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 [8086:2843] (rev 03) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=18, subordinate=18, sec-latency=0
	I/O behind bridge: 00006000-00006fff
	Memory behind bridge: e4000000-e40fffff
	Prefetchable memory behind bridge: 0000000084200000-00000000843fffff
	Capabilities: <access denied>
	Kernel driver in use: pcieport
	Kernel modules: shpchp

00:1c.4 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 [8086:2847] (rev 03) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=28, subordinate=28, sec-latency=0
	I/O behind bridge: 00002000-00003fff
	Memory behind bridge: e0000000-e3ffffff
	Prefetchable memory behind bridge: 0000000084000000-00000000841fffff
	Capabilities: <access denied>
	Kernel driver in use: pcieport
	Kernel modules: shpchp

00:1d.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 [8086:2830] (rev 03) (prog-if 00 [UHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 20
	I/O ports at 4060 [size=32]
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd

00:1d.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 [8086:2831] (rev 03) (prog-if 00 [UHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 21
	I/O ports at 4080 [size=32]
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd

00:1d.2 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 [8086:2832] (rev 03) (prog-if 00 [UHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 18
	I/O ports at 40a0 [size=32]
	Kernel driver in use: uhci_hcd
	Kernel modules: uhci-hcd

00:1d.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 [8086:2836] (rev 03) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 20
	Memory at e4808000 (32-bit, non-prefetchable) [size=1K]
	Capabilities: <access denied>
	Kernel driver in use: ehci_hcd
	Kernel modules: ehci-hcd

00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev f3) (prog-if 01 [Subtractive decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=02, subordinate=06, sec-latency=32
	I/O behind bridge: 00005000-00005fff
	Memory behind bridge: e4200000-e45fffff
	Prefetchable memory behind bridge: 0000000080000000-0000000083ffffff
	Capabilities: <access denied>

00:1f.0 ISA bridge [0601]: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller [8086:2815] (rev 03)
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0
	Capabilities: <access denied>
	Kernel modules: iTCO_wdt

00:1f.1 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller [8086:2850] (rev 03) (prog-if 8a [Master SecP PriP])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 0, IRQ 16
	I/O ports at 01f0 [size=8]
	I/O ports at 03f4 [size=1]
	I/O ports at 0170 [size=8]
	I/O ports at 0374 [size=1]
	I/O ports at 40c0 [size=16]
	Kernel driver in use: ata_piix
	Kernel modules: ata_piix, pata_acpi, ata_generic

00:1f.2 SATA controller [0106]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller [8086:2829] (rev 03) (prog-if 01 [AHCI 1.0])
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 44
	I/O ports at 13f0 [size=8]
	I/O ports at 15f4 [size=4]
	I/O ports at 1370 [size=8]
	I/O ports at 1574 [size=4]
	I/O ports at 4100 [size=32]
	Memory at e4809000 (32-bit, non-prefetchable) [size=2K]
	Capabilities: <access denied>
	Kernel driver in use: ahci
	Kernel modules: ahci

02:04.0 CardBus bridge [0607]: Ricoh Co Ltd RL5c476 II [1180:0476] (rev b6)
	Subsystem: Hewlett-Packard Company Compaq 6710b [103c:30c0]
	Flags: bus master, medium devsel, latency 168, IRQ 16
	Memory at e4200000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=02, secondary=03, subordinate=06, sec-latency=176
	Memory window 0: 80000000-83fff000 (prefetchable)
	Memory window 1: 88000000-8bfff000
	I/O window 0: 00005400-000054ff
	I/O window 1: 00005000-000050ff
	16-bit legacy interface ports at 0001
	Kernel driver in use: yenta_cardbus
	Kernel modules: yenta_socket

02:04.1 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 02) (prog-if 10 [OHCI])
	Subsystem: Hewlett-Packard Company Device [103c:30c0]
	Flags: bus master, medium devsel, latency 64, IRQ 17
	Memory at e4201000 (32-bit, non-prefetchable) [size=2K]
	Capabilities: <access denied>
	Kernel driver in use: firewire_ohci
	Kernel modules: firewire-ohci

10:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection [8086:4229] (rev 61)
	Subsystem: Intel Corporation Device [8086:1000]
	Flags: bus master, fast devsel, latency 0, IRQ 45
	Memory at e4100000 (64-bit, non-prefetchable) [size=8K]
	Capabilities: <access denied>
	Kernel driver in use: iwl4965
	Kernel modules: iwl4965

18:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM5787M Gigabit Ethernet PCI Express [14e4:1693] (rev 02)
	Subsystem: Hewlett-Packard Company Device [103c:30c2]
	Flags: bus master, fast devsel, latency 0, IRQ 48
	Memory at e4000000 (64-bit, non-prefetchable) [size=64K]
	Expansion ROM at <ignored> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: tg3
	Kernel modules: tg3

As an update, I have tried other conky configs like the one here (http://bbs.archbang.org/viewtopic.php?id=3&p=4), see Badener's screen shot and conky config further down.  Still nothing for me. 

I stopped using conky and went back to a panel (I was panelless for a while).  I added lxpanel.  The lxpanel's battery indicator and Batti both display the status correctly.  Do you think this could be a problem with conky itself and deserving a bug report? 

I would like the community's opinion on this.  I usually don't report bugs because most of the time the reason something does not work is my lack of knowledge and doing something wrong.


Free Software Foundation member 10865

Offline

#4 2012-01-07 05:09:56

Badener
Member
Registered: 2011-12-31
Posts: 43

Re: [SOLVED]ACPI Battery not showing in Conky

mike4ca wrote:

┌─[mike]──[archbang]:~$
└──>>dmesg|grep battery
[    3.740644] ACPI: Battery Slot [C23B] (battery present)
[    3.740715] ACPIdmesg|grep battery: Battery Slot [C23A] (battery absent)

Hi,sorry for my bad english.
My output of dmesg|grep battery is

[   15.821398] ACPI: Battery Slot [BAT0] (battery present)

I search a bit and found this

ACPI battery number is given as argument, at 'funtions' battery, battery_bar and battery_percent. By default the argument is BAT0. But if it doen't work, let's find out the correct argument:

http://linuxinside.blogspot.com/2008/03 … ectly.html

Hope this helps.

Offline

#5 2012-01-07 06:25:08

ArchVortex
Retired
From: Ts’elxweyeqw, Canada
Registered: 2011-04-01
Posts: 1,465

Re: [SOLVED]ACPI Battery not showing in Conky

Mike, I just added your conky lines to my conky in my Arch Testing and it works fine. There is nothing wrong with conky. Can you post your whole .conkyrc and an image of what yours looks like? Do you have acpid installed?

2012-01-07--1325912716_226x502_scrot.png

Here's my conky with your lines in it

own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
background yes
font Trebuchet MS:size=9
xftfont Trebuchet MS:size=9
use_xft yes
xftalpha 0.5
update_interval 1.0
total_run_times 0
double_buffer yes
draw_shades yes
draw_outline yes
draw_borders no
draw_graph_borders yes
minimum_size 250 5
maximum_width 200
border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment top_left
gap_x 5
gap_y 0
no_buffers yes
cpu_avg_samples 2
override_utf8_locale yes
uppercase no # set to yes if you want all text to be in uppercase
use_spacer right

#Headercolor
color0 85ADF5

#Logocolor
color1 85ADF5 

#Text Systeminfo/IP
color2 darkgrey

#Variable Text
color3 85ADF5

#Graphen
color4 white

#Running
color5 85ADF5

TEXT

${image ~/alogo.png -p 0,0 -s 190x45}


${font Trebuchet MS:size=9}${color0}SYSTEM ${hr 1}${color}${font}

Hostname: $alignr${color1}$nodename${color}
Kernel: $alignr${color1}$kernel${color}
Arch:${alignr}${color1}$machine${color}
Processes: ${alignr}${color1}$processes ($running_processes running)${color}
Uptime: ${alignr}${color1}$uptime${color}
Load: ${alignr}${color1}$loadavg${color}

${font Trebuchet MS:size=9}${color0}CPU ${hr 1}${color}${font}

${color4}CPU:1${color }   ${cpu cpu0}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:2${color }   ${cpu cpu1}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:3${color }   ${cpu cpu2}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:4${color }   ${cpu cpu3}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${cpugraph 25,195 000000 85ADF5}
${color}ACPI Battery: ${color DeepSkyBlue}$battery 
${battery_bar 11,0}

${font Trebuchet MS:size=9}${color0}PARTITIONS ${hr 1}${color}${font}

RAM ${color3}${alignr}$mem/$memmax${color}
${color4}${membar 10}${color}
SWAP ${color3}${alignr}$swap/$swapmax${color}
${color4}${swapbar 10}${color}
ROOT   ${color3}${alignr}${fs_used /}/${fs_size /}
${color4}${fs_bar 10 /}${color}
HOME   ${color3}${alignr}${fs_used /home}/${fs_size /home}
${color4}${fs_bar 10 /home}${color}

and here matching my conky script

own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
background yes
font Trebuchet MS:size=9
xftfont Trebuchet MS:size=9
use_xft yes
xftalpha 0.5
update_interval 1.0
total_run_times 0
double_buffer yes
draw_shades yes
draw_outline yes
draw_borders no
draw_graph_borders yes
minimum_size 250 5
maximum_width 200
border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment top_left
gap_x 5
gap_y 0
no_buffers yes
cpu_avg_samples 2
override_utf8_locale yes
uppercase no # set to yes if you want all text to be in uppercase
use_spacer right

#Headercolor
color0 85ADF5

#Logocolor
color1 85ADF5 

#Text Systeminfo/IP
color2 darkgrey

#Variable Text
color3 85ADF5

#Graphen
color4 white

#Running
color5 85ADF5

TEXT

${image ~/alogo.png -p 0,0 -s 190x45}


${font Trebuchet MS:size=9}${color0}SYSTEM ${hr 1}${color}${font}

Hostname: $alignr${color1}$nodename${color}
Kernel: $alignr${color1}$kernel${color}
Arch:${alignr}${color1}$machine${color}
Processes: ${alignr}${color1}$processes ($running_processes running)${color}
Uptime: ${alignr}${color1}$uptime${color}
Load: ${alignr}${color1}$loadavg${color}

${font Trebuchet MS:size=9}${color0}CPU ${hr 1}${color}${font}

${color4}CPU:1${color }   ${cpu cpu0}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:2${color }   ${cpu cpu1}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:3${color }   ${cpu cpu2}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${color4}CPU:4${color }   ${cpu cpu3}%${alignr}${freq}MHz / ${execi 10 sensors | grep  'Core 0' | awk '{print $3}'}${acpitemp}C
${cpugraph 25,195 000000 85ADF5}

${font Trebuchet MS:size=9}${color0}BATTERY ${hr 1}${color}${font}

${color4}ACPI Battery: ${color1}$battery
${battery_bar 11,0}

${font Trebuchet MS:size=9}${color0}PARTITIONS ${hr 1}${color}${font}

RAM ${color3}${alignr}$mem/$memmax${color}
${color4}${membar 10}${color}
SWAP ${color3}${alignr}$swap/$swapmax${color}
${color4}${swapbar 10}${color}
ROOT   ${color3}${alignr}${fs_used /}/${fs_size /}
${color4}${fs_bar 10 /}${color}
HOME   ${color3}${alignr}${fs_used /home}/${fs_size /home}
${color4}${fs_bar 10 /home}${color}

and the image

2012-01-07--1325913724_227x532_scrot.png


You have the capacity to learn from mistakes. You'll learn a lot today.
FP:E5F8 7DBA 8128 9ACB 75F7 7279 BE34 AB66 76D9 16DE
KEY ID:76D916DE
Currently running ArchBang / LFS / OpenSUSE Tumbleweed

Offline

#6 2012-01-07 06:55:52

Badener
Member
Registered: 2011-12-31
Posts: 43

Re: [SOLVED]ACPI Battery not showing in Conky

He must specify the batteryslot,the default is bat0.
From the conky man page:

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

battery_bar (height),(width) (num)
    Battery percentage remaining of ACPI battery in a bar. ACPI battery number can be given as argument (default is BAT0).

battery_percent (num)
    Battery percentage remaining for ACPI battery. ACPI battery number can be given as argument (default is BAT0).

Try this mike

${battery C23B}${alignr}${battery_time C23B}
${battery_bar C23B}

Last edited by Badener (2012-01-07 07:01:32)

Offline

#7 2012-01-07 19:34:17

mike4ca
Happy (Arch|Manjaro)[B,b]ang User
From: Iowa, USA
Registered: 2011-10-17
Posts: 435

Re: [SOLVED]ACPI Battery not showing in Conky

Thanks, I knew it was (as I call it) "probable user error".  Badener your solution worked.  I had seen the portion on specifying the battery, but never connected that with my own output of dmesg.  I was looking for something similar to BAT#.  The C23B just looked like some hex number.

Thanks for the help.


Free Software Foundation member 10865

Offline

Board footer

Powered by FluxBB