Awesome Wibar module off center

Sorry if this is the wrong category, but there is no Awesome category. Anyway, I’ve been trying to center my date widget. I’ve gotten it pretty close but it’s slightly shifted to the right. Here is my wibar config:

local awful = require("awful")
local vicious = require("vicious")

local wibar = {}

function wibar.setup(s)

    -- Each screen has its own tag table.
    awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])

    for i = 6, 9 do
        awful.tag.gettags(s)[i].layout = awful.layout.suit.floating
    end

    -- Create a taglist widget
    s.mytaglist = awful.widget.taglist {
        screen  = s,
        filter  = awful.widget.taglist.filter.all,
        buttons = taglist_buttons
    }

    -- Battery widget
    local battery_widget = wibox.widget.textbox()

    vicious.register(battery_widget, vicious.widgets.bat, function(_, args)
        local charge_percentage = args[2]

        local color = "#b8bb26"  -- Default color (green)

        if charge_percentage <= 25 then
            color = "#fb4934"
        elseif charge_percentage <= 59 then
            color = "#fabd2f"
        end

        return "<span color='" .. color .. "'>Battery: " .. charge_percentage .. "%</span>"
    end, 61, "BAT0")

    -- Padding widget
    local padding_widget = wibox.widget {
        widget = wibox.widget.separator,
        forced_width = 5,
        opacity = 0,
    }

    -- Create the wibox
    s.mywibox = awful.wibar({ position = "top", screen = s })

    -- Add widgets to the wibox
    s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        expand = "none",
        {
            layout = wibox.layout.fixed.horizontal,
            s.mytaglist,
        },
            mytextclock,
        {
            layout = wibox.layout.fixed.horizontal,
            battery_widget,
            padding_widget,
        },
    }
end

return wibar

Anyone know how to fix this, the Awesome docs are kind of going over my head.

Hello @Shadjo, All depends on your preferences ( I failed improving wibar.lua ) I replaced eos_default theme with an old one named vertex from here
https://github.com/lcpz/awesome-copycats
Plus downloaded this font
yay -Qi awesome
Name : awesome-git
Version : 4.3.1602.g485661b70-1

1 Like

I’m not exactly sure what the issue was, but I ended up creating my own date widget and the centering is now correct somehow.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.