DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default conky

Hello,

Anybody knows how to view battery status and loading % in conky?

Thanks
Reply With Quote
  #2   (View Single Post)  
Old 17th January 2011
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

Have you checked the man page or the examples on their official page, such as this one?
__________________
May the source be with you!
Reply With Quote
  #3   (View Single Post)  
Old 17th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

Yes, I tried the following:

${color grey}Battery:$color ${apm_battery_time} ${battery} ${acpiacadapter}

All I get in output is
Battery: ${apm_battery_time} ${battery} ${acpiacadapter}
Reply With Quote
  #4   (View Single Post)  
Old 17th January 2011
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

It works here. You must be missing something. Post your .conkyrc file (inside code tags).
__________________
May the source be with you!
Reply With Quote
  #5   (View Single Post)  
Old 17th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

Code:
double_buffer yes
alignment bottom_right
background no
border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=9
gap_x 5
gap_y 60
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
own_window no
own_window_class Conky
own_window_type desktop
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no

TEXT
SYSTEM $hr
$sysname $kernel on $machine
${color grey}Uptime:$color $uptime
${color grey}Frequency (in MHz):$color $freq
${color grey}Frequency (in GHz):$color $freq_g
${color grey}RAM Usage:$color $mem/$memmax - $memperc%
${color grey}Swap Usage:$color $swap/$swapmax - $swapperc%
${color grey}CPU Usage:$color $cpu%
${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes
${color grey}Battery:$color ${apm_battery_time} ${battery} ${acpiacadapter}
File systems $hr
${color grey}Usage: / $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
Networking $hr
${color grey}Up:$color ${upspeed eth0} ${color grey} - Down:$color ${downspeed eth0}
Reply With Quote
  #6   (View Single Post)  
Old 18th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

Oh I am using OpenBSD 4.8 amd64.
Perhaps this changes something?
Reply With Quote
  #7   (View Single Post)  
Old 18th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

Maybe there is daemon not running that should be running? Or perhaps it something about having the correct privileges?
Reply With Quote
  #8   (View Single Post)  
Old 18th January 2011
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

I'm sorry I can't help. Your configuration looks just fine. I don't know of any daemon that should be running for Conky to work. And you (unprivileged user) should be able to run it without problem.
__________________
May the source be with you!
Reply With Quote
  #9   (View Single Post)  
Old 18th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

Thanks anyway.

I could also be a bug in 4.8 ...
Reply With Quote
Old 18th January 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

How does conky determine the battery usage? does this system use apm(4) or acpi(4)? do you use apmd(8)? what's the output of apm?

If you're using ACPI, look in your dmesg and see if acpibat* attaches.. if so, the sysctl members hw.sensors.acpibat0.* should exist.

It's difficult to get battery usage information portability across operating systems, but with a little scripting you can probably pull something off that can display battery usage.
Reply With Quote
Old 19th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

I don't realy know what conky uses... depends on the variables you use I think. If I run the following I can see battery usage (I had to start apmd manually for it to work).
Code:
apm -l
However even after starting apmd conky won't display a thing.

I am sure it once worked on 4.7.
Reply With Quote
Old 19th January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

I can see the entries correctly in sysctl and dmesg. So ACPI is used I guess.
Reply With Quote
Old 21st January 2011
phill phill is offline
Real Name: Philippe
Port Guard
 
Join Date: Oct 2009
Location: Belgium
Posts: 30
Default

For those who want to know it, I think I found the cause. I went and checked the source code of conky (version 1.7.2).

Among other things I found the following:

Code:
#if defined(i386) || defined(__i386__)
typedef struct apm_power_info *apm_info_t;
#endif
So it looks like APM support is deliberately disabled for other architectures than i386. In my case I use OpenBSD 4.8 amd64. I think it is because of this.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick