# I need some help from someone with a FreeBSD laptop



## ckester (Nov 13, 2010)

I'm currently working on an update of the FreeBSD port of x11/fbpanel, which I maintain.   The latest 6.x version includes new plugins for cpu, memory and battery status (among other things).  I've completed patches to get  all of these working on FreeBSD, but since I don't have a laptop I'm not sure I've got the battery status right.

Will someone with a laptop please run the following command and post the results?


```
sysctl hw.acpi.battery
```

I need to see the values reported both when running on batteries and on AC.  It would also be good to see the values when the battery is less than fully charged.

Thanks in advance!


----------



## DutchDaemon (Nov 13, 2010)

This is on AC, with the battery pack removed. I always use the laptop that way, so that's all I got 


```
$ sysctl hw.acpi.battery                                                                                                 
hw.acpi.battery.life: -1
hw.acpi.battery.time: -1
hw.acpi.battery.state: 7
hw.acpi.battery.units: 2
hw.acpi.battery.info_expire: 5
```


----------



## aragon (Nov 14, 2010)

For battery monitoring I recommend dipping into the source of acpiconf(8).


----------



## wblock@ (Nov 14, 2010)

ckester said:
			
		

> I need to see the values reported both when running on batteries and on AC.  It would also be good to see the values when the battery is less than fully charged.



Acer netbook on battery (nearly fully charged):

```
aa1% sysctl hw.acpi.battery
hw.acpi.battery.life: 93
hw.acpi.battery.time: 107
hw.acpi.battery.state: 1
hw.acpi.battery.units: 1
hw.acpi.battery.info_expire: 5
```

On AC:

```
aa1% sysctl hw.acpi.battery
hw.acpi.battery.life: 93
hw.acpi.battery.time: -1
hw.acpi.battery.state: 2
hw.acpi.battery.units: 1
hw.acpi.battery.info_expire: 5
```


----------



## ckester (Nov 14, 2010)

Thanks Warren!  That answers one question I had after studying the sourcecode for various apps that do battery monitoring: some of them seemed to suggest that the "life" value (% charged) would go to -1 when state=charging.  That didn't make sense to me. How's a user to know when the charging is complete and it's OK to unplug the AC?

So I should be able to submit the update sometime this week, after some final cleanup and a tinderbox run.   You can mark this thread "solved".


----------



## vermaden (Nov 14, 2010)

@ckester

I will gladly help, but later, do not have time now.


----------



## ckester (Nov 14, 2010)

No problem, vermaden.  I think I have what I need for now.


----------



## wblock@ (Nov 14, 2010)

ckester said:
			
		

> Thanks Warren!  That answers one question I had after studying the sourcecode for various apps that do battery monitoring: some of them seemed to suggest that the "life" value (% charged) would go to -1 when state=charging.  That didn't make sense to me. How's a user to know when the charging is complete and it's OK to unplug the AC?



sysutils/xfce4-battery-plugin works on a different Acer netbook.  Might be a source for reference.


----------



## vermaden (Nov 15, 2010)

ckester said:
			
		

> No problem, vermaden.  I think I have what I need for now.



Ok, feel free to sent me PM for next needed testing.

BTW, from some version, I have the following problem with FBPANEL, how to make these 1px spaces to be 0px spaces as in older versions?







In older version it looked like that with the same config:


----------



## ckester (Nov 15, 2010)

Looks like OS X, Vermaden.  That's Finder's icon on the left end.   What theme are you using?

We might need to patch the sourcecode for the taskbar plugin to get rid of that 1px border.  If you're interested, I'll look into it after I get the update to 6.1 submitted.


----------



## ckester (Nov 15, 2010)

... or is that a launchbar?  With fbpanel 6.1, I'm not seeing any borders between the launchbar items. 

Taskbar items, otoh, are drawn more like buttons on a dialog box.


----------



## lme@ (Nov 15, 2010)

ckester: you can also take a look at the patches for x11/lxpanel and the sysutils/nbosd


----------



## ckester (Nov 15, 2010)

Yep.  I leaned heavily on the lxpanel patches, and even "borrowed" some of the code because it's so similar to what fbpanel needs.  But the battery plugin is different enough that I rolled my own.

It's been a fun project, but I'm glad it's almost done. I'm seeing *sysctlnametomib( )* calls scrolling on the back of my eyelids when I go to bed at night.


----------



## lme@ (Nov 15, 2010)

What did you need sysctltomib() for? sysctlbyname() is much easier to handle.


----------



## vermaden (Nov 15, 2010)

ckester said:
			
		

> Looks like OS X, Vermaden.  That's Finder's icon on the left end.   What theme are you using?
> 
> We might need to patch the sourcecode for the taskbar plugin to get rid of that 1px border.  If you're interested, I'll look into it after I get the update to 6.1 submitted.



This is the whole profile/config, I am using this as: fbpanel --profile osx: http://pastebin.com/jbiCDcFM

I would be interested in what needs to be changed/patched to bring back the old behaviour (0px spaces).


----------



## ckester (Nov 15, 2010)

Ah, I was right.  It's a launchbar, not a taskbar.  You might not need to do anything at all.  

I'd like to see what you get with 6.1.  I'll PM you as soon as I submit the PR with my patches, so you can try them yourself.


----------



## ckester (Nov 15, 2010)

I'm using sysctlnametomib( ) because these monitors run every two seconds or so, and I don't want the overhead of looking up the integer name vectors every time.   The manpage recommends it for this kind of use.


----------



## vermaden (Nov 15, 2010)

@ckester

Ok, thank You mate.


----------



## lme@ (Nov 16, 2010)

ckester said:
			
		

> I'm using sysctlnametomib( ) because these monitors run every two seconds or so, and I don't want the overhead of looking up the integer name vectors every time.   The manpage recommends it for this kind of use.



Good point!


----------

