Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have recently been trying out xmonad and xmobar and it has been working well so far.
However, when I try to add the battery information to xmobar I get this error:
Code:
xmobar: /sys/class/power_supply/BAT0/current_now: hGetBufSome: unsupported operation (No such device)
Here is my .xmobarrc config:
Code:
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, lowerOnStart = True
, commands = [ Run Weather "EGPF" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Battery ["Bat0"] 600
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Date "%a %b %_d %l:%M" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% * %swap% %battery% <fc=#ee9a00>%date%</fc> | %EGPF%"
}
Could just be that xmobar has stupidly hard-coded the path to the battery. At least on Slackware that would be the incorrect path. For my small script relating to my battery level, the absolute path is /proc/acpi/battery/.
Unfortunately the path is correct. After looking around on the internet it seems that it is a problem with the bios on my hp laptop. What I need is for Xmobar to launch without the current_now seeing as that only gives information to work out how much longer the battery will last for. I only want a percentage of the capacity left.
There is a way to hardcode a location for battery left
I found that by using "BatteryP", you can specify a location to look if your battery has a strange name that is not "BAT0".. my battery is named "CMB0" and was able to get it to work by doing this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.