Giter Club home page Giter Club logo

battery-widget's People

Contributors

akuskis avatar coldfix avatar dokthar avatar florianmuenchbach avatar informatic avatar ivankayukoff avatar jbarrett687 avatar lmanul avatar rovanion avatar scorfly avatar tamsanh avatar whwright avatar wucke13 avatar xarkes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

battery-widget's Issues

Widget only displays battery prefix

Title is self explainatory. Widget always displays battery_prefix regardless of whether the ac cord is plugged in or not.

> awesome --version
awesome v4.2-289-g98e59225 (Human after all)
 • Compiled against Lua 5.3.4 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.6
 • LGI version: 0.9.2


> lua -v
Lua 5.3.4  Copyright (C) 1994-2017 Lua.org, PUC-Rio

Nice work btw. Keep it up.

error on install

photo6239945620156691145

I cloned the repo into ./widgets/ and I imorted it using local battery_widget = pcall(require, "widgets.battery-widget") but as soon as I reload the wm I get this error and the the wm fall back to the default config

Font to small.

Using this widget in my wibar, I am not sure why, but the font of the widget is very small. I guess it is not respecting my bar config font & size. Here is my bar
image
Some stuff which might help

-- Battery
local battery_widget = require("battery-widget")
local BAT0 = battery_widget { adapter = "BAT0", ac = "AC" }

battery_widget {
    ac = "AC",
    adapter = "BAT0",
    ac_prefix = "AC: ",
    battery_prefix = "Bat: ",
    percent_colors = {
        { 25, "red"   },
        { 50, "orange"},
        {999, "green" },
    },
    listen = true,
    timeout = 10,
    widget_text = "${AC_BAT}${color_on}${percent}%${color_off}",
    widget_text = '<span font="Roboto Mono 10">${AC_BAT}</span>${color_on}${percent}%${color_off}',
    tooltip_text = "Battery ${state}${time_est}\nCapacity: ${capacity_percent}%",
    alert_threshold = 5,
    alert_timeout = 0,
    alert_title = "Low battery !",
    alert_text = "${AC_BAT}${time_est}"
}
    -- Add widgets to the wibox
    s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            layout = wibox.layout.fixed.horizontal,
            s.mytaglist,
            s.mypromptbox,
        },
        s.mytasklist, -- Middle widget
        { -- Right widgets
            layout = wibox.layout.fixed.horizontal,
            BAT0,
            mytextclock,
        },
    }
end)
-- }}}

Thanks in advance :)

Widget Fails on Battery Power (Pinebook Pro)

I am using a Pinebook Pro, which has a different battery device name than normal (/sys/class/power_supply/cw2015-battery/ instead of /sys/class/power_supply/BATx), which I adjusted for in my Awesome config. When running on AC power, the widget works perfectly. However, when just using the battery, the widget crashes with .config/awesome/battery-widget/init.lua:240: attempt to perform arithmetic on a nil value (field 'charge').

The relevant section of my config is

`local battery_widget = require("battery-widget")
local BAT0 = battery_widget { adapter = "cw2015-battery", ac = "dc-charger", timeout = 10, listen = true }

...

s.mywibox:setup {
...
( -- Right widgets
BAT0,
...`

Port to FreeBSD

I use your battery widget in Linux. I like it. I, however, need to maintain some machines running FreeBSD. FreeBSD doesn't have acpid (it has devd). It also doesn't use sysfs, it uses sysctls. The translations are relatively straightforward (well, acpid->devd is some work)

My lua sucks and I have no interest in improving it, but I can tell you how to accomplish most of what you need in FreeBSD if anyone is interested in porting this. Meanwhile I will try to find another battery monitor.

Error on init.lua:143

I follow the step to add the battery widget, but I get this error:

/home/user/.config/awesome/battery-widget/init.lua 143: bad argument # 1 to 'tolower' (string expected, got nil)

Unicode character support assistance

Hi, I am new to arch and I was wondering if there are any dependencies or unicode character support packages that work well with the widget. When I change the prefix "Bat:" to "U+1F50B" to display a battery icon, the widget renders "U+1F50B" instead of the icon. Any suggestion would be very much appreciated.

How to add this to the wibar?

Using right_layout:add(battery.widget) throws an error cause there is no object right_layout. How may I add it to the wibar, after initial setup?

Rename battery-widget.lua to init.lua

Hey.
Renaming battery-widget.lua to init.lua would make using Your module slightly cleaner in dotfiles-repository-like environments.
By default require('MODULE') will try to load MODULE.lua, and then MODULE/init.lua, thus this repo could be easily used as a submodule in git and such, without playing with symlinks.

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.