You are not logged in.
Pages: 1
I wasn't sure whether to put this here or in the laptop section, but I figured that it was more conky-related than anything.
I'm running Arch on a macbook, and the ACPI readings on the battery are very sensitive. In other words, if I ask the system what the charge status is too often, it will eventually break and give me no reading. A reboot, or even a reinstall does not correct the issue. The one thing that does though, is a quick boot into OSX (via live CD, I have only Arch on this machine) and reboot into Linux. The readings are accurate once again.
When I was using GNOME I went two months without seeing this issue. Recently I switched to openbox, and use conky and conky's "battery" command to give the status via ACPI. After three hours of running this setup, the readings broke. I had heard that a frequent polling rate could affect the status. So I'm wondering if there is a way to tell conky to only get battery status via ACPI every few minutes, instead of every 30 seconds as it appears to be right now?
edit: fixed some grammar errors
Last edited by cry0x (2007-06-28 07:55:37)
Who is this doin' this synthetic type of alpha beta psychedelic funkin'?
Offline
I don't know if it's possible to do change the update interval inside a single config file on a per command basis. However you could create two conky files one for your normal stuff and another one which does only the battery and perhaps other stuff that doesnt change frequently and set the update rate in that file to 30 seconds or whatever turns out to work.
Offline
Yup, execi would do the trick. It'll run a given shell command at a specific interval (so you won't have to change the global refresh rate).
Something like the following in your conkyrc would print out the battery reading directly from acpi every 2 minutes:
${execi 120 acpi}
You can alway do some formatting with cut to get the desired look.
http://conky.sourceforge.net/variables.html
cheers,
Last edited by somedrew (2007-06-28 22:10:15)
Offline
Yup, execi would do the trick. It'll run a given shell command at a specific interval (so you won't have to change the global refresh rate).
Something like the following in your conkyrc would print out the battery reading directly from acpi every 2 minutes:${execi 120 acpi}
You can alway do some formatting with cut to get the desired look.
http://conky.sourceforge.net/variables.html
cheers,
I'm not familiar with the "cut" you are speaking of. Right now I'm just doing ${execi 45 acpi -b} which returns a fairly long string:
BATTERY1: DISCHARGING, 99%, 03:32:34 REMAINING
What I'd like to display is DISCHARGING, 99%
Who is this doin' this synthetic type of alpha beta psychedelic funkin'?
Offline
A mixture of awk and sed can do that for you. If you don't have them, then
pacman -S awk sed
Then place this in your .conkyrc
${execi 120 acpi -b | awk '{print $3, $4}' | sed -e s/,//2}
This would produce something like: "charging, 50%".
Edit: Fixed the code to only remove one comma.
Last edited by smurnjiff (2007-06-28 22:54:18)
Offline
I'm not familiar with the "cut" you are speaking of. Right now I'm just doing ${execi 45 acpi -b} which returns a fairly long string:
BATTERY1: DISCHARGING, 99%, 03:32:34 REMAINING
What I'd like to display is DISCHARGING, 99%
Something like the following should do it if you want to use cut to filter the output. You may need to play around with the characters a bit. 'man cut' will let ya know the what, why, and hows of cut.
It's not as nice as the awk and sed suggestion, but gets the job done for me.
${execi 45 acpi -b | cut -c17-100}
cheers,
Last edited by somedrew (2007-06-29 21:41:48)
Offline
Bookmarked .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Something like the following should do it if you want to use cut to filter the output. You may need to play around with the characters a bit. 'man cut' will let ya know the what, why, and hows of cut.
It's not as nice as the awk and sed suggestion, but gets the job done for me.${execi 45 acpi -b | cut -c17-100}
This doesn't work when the AC is unplugged. It produces discharging, 98%, 3:22:12 remaining
instead of: discharging, 98%
That's why I used sed and awk instead of cut.
Offline
You guys are fantastic. I need to read up on sed and awk... they appear to be very useful utilities.
Once again thankyou!
Last edited by cry0x (2007-06-30 02:57:57)
Who is this doin' this synthetic type of alpha beta psychedelic funkin'?
Offline
Something like the following should do it if you want to use cut to filter the output. You may need to play around with the characters a bit. 'man cut' will let ya know the what, why, and hows of cut.
It's not as nice as the awk and sed suggestion, but gets the job done for me.${execi 45 acpi -b | cut -c17-100}
This doesn't work when the AC is unplugged. It produces discharging, 98%, 3:22:12 remaining
instead of: discharging, 98%
That's why I used sed and awk instead of cut.
It's an easy fix: If you want to cut it off after the percentage, just count the characters until that point and add that to the cut pipe (or just use awk and sed). I like to see the time remaining and left that in the command.
cheers
Last edited by somedrew (2007-07-01 07:57:59)
Offline
Pages: 1