Giter Club home page Giter Club logo

Comments (4)

coldfix avatar coldfix commented on June 19, 2024

depends how your rc.lua looks like. The current default contains a section which looks like:

    awful.titlebar(c) : setup {
        { -- Left
            ...
        },
        { -- Middle
            ...
        },
        { -- Right
            ...
        },
        layout = wibox.layout.align.horizontal
}

you can insert battery.widget there as you like it.

The usage example from the README is from a time where the default looked different, I believe.

from battery-widget.

coldfix avatar coldfix commented on June 19, 2024

Oh, forget what I said! This is for the client titlebars, not the wibox.

Instead, look for:

s.mywibox:setup {

        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            ...
        },
        s.mytasklist, -- Middle widget
        { -- Right widgets
            ...
        },
}

from battery-widget.

wucke13 avatar wucke13 commented on June 19, 2024

I know that I can add it this way, however I would like to add it after the initial run of s.mywibox:setup. Is that still possible? The reason is that I use the same rc.lua for both desktop and laptop. I wrote a little lua snippet which finds out on which device I am, now I would like to add it to the wibox.

from battery-widget.

coldfix avatar coldfix commented on June 19, 2024

Oh. Well, you can restructure your init code like this:

  local right_layout = {
      ...
  }
  if laptop then table.insert(right_layout, battery.widget) end
  s.mywibox:setup {
      layout = wibox.layout.align.horizontal,
      left_layout,
      nil,
      right_layout,
  }

Or just look into the awesome documentation.

from battery-widget.

Related Issues (10)

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.