Re: [dev] How to monitor battery status

2011-07-04 Thread Ethan Grammatikidis
On Mon, 20 Jun 2011 06:47:35 -0400 Kurt H Maier wrote: > On Mon, Jun 20, 2011 at 5:59 AM, ilf wrote: > > I have done this the /proc/acpi/battery/BAT0/state | shell way for years and > > found it to be way more resource intense then calling acpi -b. > > > > Let's face it, the Shell/Perl/Python/wh

Re: [dev] How to monitor battery status

2011-06-21 Thread Stefan Mark
On 20.06.2011 12:17, Stefan Mark wrote: > Just two Days ago i found a nice and relatively complete one in this > Mailinglist. Since then, im tinkering around with it, with the intention > to make it more or less a replacement for my old perl project. It has > some monitors and libnotify support. If

Re: [dev] How to monitor battery status

2011-06-20 Thread Hiltjo Posthuma
On Mon, Jun 20, 2011 at 7:15 PM, Connor Lane Smith wrote: > > My point was that this is unnecessary: is your screen able to display > more than, say, 8192 characters (a common value for BUFSIZ) on a > single line? And even if so, why are you piping an essay into your > status bar anyway? > Hah, t

Re: [dev] How to monitor battery status

2011-06-20 Thread Rafa Garcia Gallego
A while back I put together a crappy C monitor, which I still use to the day. Find the .c attached, compile with -lX11 as normal, peruse at will. Cheers, Rafa. #include #include #include #include #include #include #include #include #include #include #define BATTERY "BAT1" #define BATT_

Re: [dev] How to monitor battery status

2011-06-20 Thread Christoph Lohmann
Good evening, ilf wrote: On 06-20 10:43, Stefan Mark wrote: But i think think this is a better solution: http://dwm.suckless.org/dwmstatus/ Unfortunately, this promise is not kept: This page will give you a barebone dwmstatus project and show examples on how to extend it to your needs. ac

Re: [dev] How to monitor battery status

2011-06-20 Thread Connor Lane Smith
On 20 June 2011 18:05, Hiltjo Posthuma wrote: > getline / getdelim (re)allocates buffers though. But yes a custom > function with fgets would be more compatible. My point was that this is unnecessary: is your screen able to display more than, say, 8192 characters (a common value for BUFSIZ) on a

Re: [dev] How to monitor battery status

2011-06-20 Thread Hiltjo Posthuma
On Mon, Jun 20, 2011 at 6:06 PM, Connor Lane Smith wrote: > > Please don't encourage things like this. getline() is available in > POSIX 2008; though I suspect the far more portable fgets() would > suffice. > getline / getdelim (re)allocates buffers though. But yes a custom function with fgets wo

Re: [dev] How to monitor battery status

2011-06-20 Thread Connor Lane Smith
Hey, On 20 June 2011 12:25, Kurt Van Dijck wrote: > #ifndef _GNU_SOURCE > #define _GNU_SOURCE > #endif Please don't encourage things like this. getline() is available in POSIX 2008; though I suspect the far more portable fgets() would suffice. Thanks, cls

Re: [dev] How to monitor battery status

2011-06-20 Thread Kurt Van Dijck
On Mon, Jun 20, 2011 at 09:24:25AM -0400, Andrew Hills wrote: > On Mon, Jun 20, 2011 at 8:40 AM, Kurt Van Dijck wrote: > > I missed (and still do not see) > > how to make xsetroot(1) read from stdin, line by line. > > xsetroot -name "`my_commands_that_write_to_stdout`" > > > That's why (I though

Re: [dev] How to monitor battery status

2011-06-20 Thread Bartosz Nitkiewicz
Thx to all for hints. I put acpi -b |tr -d ','|awk '{print $4}' onto my old script and everythig works fine. Maby i'll be usefull for somebody git://github.com/dziq/configs.git 2011/6/20 Kurt Van Dijck > On Mon, Jun 20, 2011 at 01:59:57PM +0200, ilf wrote: > > On 06-20 13:25, Kurt Van Dijck wro

Re: [dev] How to monitor battery status

2011-06-20 Thread Andrew Hills
On Mon, Jun 20, 2011 at 8:40 AM, Kurt Van Dijck wrote: > I missed (and still do not see) > how to make xsetroot(1) read from stdin, line by line. xsetroot -name "`my_commands_that_write_to_stdout`" > That's why (I thought) that scripts spawn xsetroot(1) each time. They wouldn't need to run your

Re: [dev] How to monitor battery status

2011-06-20 Thread Kurt Van Dijck
On Mon, Jun 20, 2011 at 01:59:57PM +0200, ilf wrote: > On 06-20 13:25, Kurt Van Dijck wrote: > >This program allows me to put 'whatever I can create on stdout' to the > >statusbar > > Euh yeah, that's what we use xsetroot(1) for. I missed (and still do not see) how to make xsetroot(1) read from

Re: [dev] How to monitor battery status

2011-06-20 Thread ilf
On 06-20 13:25, Kurt Van Dijck wrote: This program allows me to put 'whatever I can create on stdout' to the statusbar Euh yeah, that's what we use xsetroot(1) for. The problem is the scripting before that setp, aquiring the "whatever I can create on stdout". -- ilf Über 80 Millionen Deuts

Re: [dev] How to monitor battery status

2011-06-20 Thread Kurt Van Dijck
On Mon, Jun 20, 2011 at 12:17:58PM +0200, Stefan Mark wrote: > On 20.06.2011 11:59, ilf wrote: > > On 06-19 22:55, Erik Hahn wrote: > >> http://dwm.suckless.org/scripts/simple_monitors > > > > I have done this the /proc/acpi/battery/BAT0/state | shell way for years > > and found it to be way more

Re: [dev] How to monitor battery status

2011-06-20 Thread Stefan Mark
On 20.06.2011 12:47, Kurt H Maier wrote: > On Mon, Jun 20, 2011 at 5:59 AM, ilf wrote: >> I have done this the /proc/acpi/battery/BAT0/state | shell way for years and >> found it to be way more resource intense then calling acpi -b. >> >> Let's face it, the Shell/Perl/Python/whatever scripting is

Re: [dev] How to monitor battery status

2011-06-20 Thread Kurt H Maier
On Mon, Jun 20, 2011 at 5:59 AM, ilf wrote: > I have done this the /proc/acpi/battery/BAT0/state | shell way for years and > found it to be way more resource intense then calling acpi -b. > > Let's face it, the Shell/Perl/Python/whatever scripting is relatively easy, > but very inefficient. I upd

Re: [dev] How to monitor battery status

2011-06-20 Thread Jukka Ruohonen
On Sun, Jun 19, 2011 at 10:51:46PM +0200, Bartosz Nitkiewicz wrote: > I'm looking for a best way to monitor battery status in dwm. Any hints? xbattbar, http://iplab.naist.jp/member/suguru/xbattbar.html But no idea whether it is suckless (i.e. haven't looked beyond the surface, which I like). -

Re: [dev] How to monitor battery status

2011-06-20 Thread Stefan Mark
On 20.06.2011 11:59, ilf wrote: > On 06-19 22:55, Erik Hahn wrote: >> http://dwm.suckless.org/scripts/simple_monitors > > I have done this the /proc/acpi/battery/BAT0/state | shell way for years > and found it to be way more resource intense then calling acpi -b. > > Let's face it, the Shell/Perl

Re: [dev] How to monitor battery status

2011-06-20 Thread ilf
On 06-19 22:55, Erik Hahn wrote: http://dwm.suckless.org/scripts/simple_monitors I have done this the /proc/acpi/battery/BAT0/state | shell way for years and found it to be way more resource intense then calling acpi -b. Let's face it, the Shell/Perl/Python/whatever scripting is relatively

Re: [dev] How to monitor battery status

2011-06-20 Thread Hadrian Węgrzynowski
On Mon, 20 Jun 2011 11:27:10 +0200 pancake wrote: >On 06/20/11 10:24, Hadrian Węgrzynowski wrote: >> It's maybe not the best way, but I written small utility that uses >> Linux /proc and /sys to take stats. Original source outputs cpu >> usage, cpu freq, cpu temp, mem usage, battery status and gp

Re: [dev] How to monitor battery status

2011-06-20 Thread pancake
On 06/20/11 10:24, Hadrian Węgrzynowski wrote: On Sun, 19 Jun 2011 22:51:46 +0200 Bartosz Nitkiewicz wrote: Hello, I'm looking for a best way to monitor battery status in dwm. Any hints? It's maybe not the best way, but I written small utility that uses Linux /proc and /sys to take stats. Or

Re: [dev] How to monitor battery status

2011-06-20 Thread Stefan Mark
On 19.06.2011 22:51, Bartosz Nitkiewicz wrote: > Hello, > I'm looking for a best way to monitor battery status in dwm. Any hints? > I use a extensible perl script (https://svn.0mark.unserver.de/dwmd/branches/experimental/). Not perfect, but easy to maintain and extend. The script features Monitor

Re: [dev] How to monitor battery status

2011-06-20 Thread Hadrian Węgrzynowski
On Sun, 19 Jun 2011 22:51:46 +0200 Bartosz Nitkiewicz wrote: >Hello, >I'm looking for a best way to monitor battery status in dwm. Any hints? > It's maybe not the best way, but I written small utility that uses Linux /proc and /sys to take stats. Original source outputs cpu usage, cpu freq, cpu

Re: [dev] How to monitor battery status

2011-06-19 Thread Kurt H Maier
you can also do this by hand if you don't have acpi userspace installed http://git.remotehost.co/web?p=USER/kurt/xorgstuff.git;a=blob;f=scripts/status.sh -- # Kurt H Maier

Re: [dev] How to monitor battery status

2011-06-19 Thread Erik Hahn
On 19.06.2011 22:51, Bartosz Nitkiewicz wrote: Hello, I'm looking for a best way to monitor battery status in dwm. Any hints? -- Bartosz Nitkiewicz http://dwm.suckless.org/scripts/simple_monitors

Re: [dev] How to monitor battery status

2011-06-19 Thread J Thigpen (cdarwin)
On Sun, Jun 19, 2011 at 4:51 PM, Bartosz Nitkiewicz wrote: > Hello, > I'm looking for a best way to monitor battery status in dwm. Any hints? > > -- > Bartosz Nitkiewicz > xsetroot -name "`acpi -b |tr -d ','|awk '{print $4}'`" I have something like this is a while loop in my .xinitrc

[dev] How to monitor battery status

2011-06-19 Thread Bartosz Nitkiewicz
Hello, I'm looking for a best way to monitor battery status in dwm. Any hints? -- Bartosz Nitkiewicz