Giter Club home page Giter Club logo

Comments (7)

dyfrgi avatar dyfrgi commented on July 22, 2024 1

Should this issue be closed since the issue was in configuration, not in this repo?

from awesome-wm-widgets.

streetturtle avatar streetturtle commented on July 22, 2024

Thanks for raising an issue 👍 I am on 4.2 now and haven't tested on 4.3 yet. AFAIR there are some breaking changes with awful.spawn. I'll upgrade my awesome this week and will fix the issues. I'll post here when I'm done.

from awesome-wm-widgets.

streetturtle avatar streetturtle commented on July 22, 2024

I was wrong, there are no breaking changes in 4.3 for awful.spawn. And I just upgraded to 4.3 and batteryarc works as expected, at least updates the arcchart. Could you please try master again.
BTW, where did you get the error log from?

from awesome-wm-widgets.

teranex avatar teranex commented on July 22, 2024

I'm now using master (commit 54924ef), but the result is still the same.
Looking in the logs I found another error which seems to be real culprit:

2019-04-25 12:21:10 E: awesome: Error during a protected call: ...some/awesome-wm-widgets/batteryarc-widget/batteryarc.lua:103: bad argument #2 to 'format' (number has no integer representation)
stack traceback:
	[C]: in function 'string.format'
	...some/awesome-wm-widgets/batteryarc-widget/batteryarc.lua:103: in upvalue 'callback'
	/usr/share/awesome/lib/awful/widget/watch.lua:77: in function </usr/share/awesome/lib/awful/widget/watch.lua:76>
	(...tail calls...)
	/usr/share/awesome/lib/awful/spawn.lua:481: in function </usr/share/awesome/lib/awful/spawn.lua:475>
	[C]: in function 'xpcall'
	/usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
	(...tail calls...)
	/usr/share/awesome/lib/awful/spawn.lua:577: in upvalue 'done'
	/usr/share/awesome/lib/awful/spawn.lua:592: in function </usr/share/awesome/lib/awful/spawn.lua:584>

In batteryarc.lua if I change line 103 to:

                    -- or string.format('%d', charge)
                    or charge

The widget works, although without a textual percentage (it always shows three dots as the text).
With the original line, the arc-ring is also always white, while with the change it shows the correct colors (usually a green ring and yellow when below 30% (?))*.

I did upgrade from Ubuntu 18.04 to 19.04 (which brought Awesome 4.3 with it), but I don't think this changed anything in the acpi -i output. As far as I see the regexes all still match the expected output. I do have a Bluetooth keyboard which has no (useful) battery info available, but that should be filtered out as well. When I disable my Bluetooth keyboad it does not make any difference for the widget.

Output of acpi -i:

Battery 0: Charging, 55%, 00:37:31 until charged
Battery 0: design capacity 3598 mAh, last full capacity 2919 mAh = 81%
Battery 1: Discharging, 0%, rate information unavailable
Battery 2: Unknown, 5%
Battery 2: design capacity 2097 mAh, last full capacity 1516 mAh = 72%

I obtained the logs by running awesome from bash: awesome -r &

from awesome-wm-widgets.

teranex avatar teranex commented on July 22, 2024

Adding a debug line before line 101 shows me that charge is a float:

            print("----- Charge: " .. charge)
----- Charge: 46.099518459069

changing line 103 to:

                    or string.format('%2.0f', charge)

seems to fix the issue

from awesome-wm-widgets.

syhe avatar syhe commented on July 22, 2024

@teranex It looks like the first error you described was caused by the leftover set_value function in the widget declaration. When I removed it, the error disappeared.

from awesome-wm-widgets.

streetturtle avatar streetturtle commented on July 22, 2024

@dyfrgi yep, you right, thanks!

from awesome-wm-widgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.