kid_goth
kid_goth

Reputation: 99

AwesomeWM Remove wibar's space

I have 3 wibar for topbar and looks fine:

enter image description here

but when i open any app it have a margin top how if the 3 wibar was in column, same for notifications and popups.

enter image description here

Then i want remove that space, how could i make it, it's my rc.lua:

...

awful.screen.connect_for_each_screen(function(s)
    awful.tag(
        -- { " files ", " code ", " web ", " shell ", " media " },
        { "  ", "", "", "", " " },
        s, {
        awful.layout.layouts[1],
        awful.layout.layouts[1],
        awful.layout.layouts[1],
        awful.layout.layouts[4],
        awful.layout.layouts[3]
    })

    -- Create a promptbox for each screen
    s.mypromptbox = awful.widget.prompt()

    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    s.mylayoutbox = awful.widget.layoutbox(s)
    s.mylayoutbox:buttons(gears.table.join(
        awful.button({ }, 1, function () awful.layout.inc( 1) end),
        awful.button({ }, 2, function () awful.layout.inc( 1) end),
        awful.button({ }, 3, function () awful.layout.inc(-1) end),
        awful.button({ }, 4, function () awful.layout.inc( 1) end),
        awful.button({ }, 5, function () awful.layout.inc(-1) end),
        awful.button({ }, 6, function () awful.layout.inc( 1) end)
    ))
    
    -- Create a taglist widget
    s.mytaglist = awful.widget.taglist {
        screen  = s, 
        filter  = awful.widget.taglist.filter.all, 
        buttons = taglist_buttons
    }

    -- Create a tasklist widget
    s.mytasklist  = awful.widget.tasklist {
        screen  = s, 
        filter  = awful.widget.tasklist.filter.currenttags, 
        buttons = tasklist_buttons
    }

    -- Create a systray widget
    s.systray = wibox.widget.systray()
    s.systray.visible = false

    -- Create the wibox
    function custom_shape(cr, width, height)
        gears.shape.rounded_rect(cr, width, height, 5)
    end
    
    -- Create the top wiboxs
    s.mywibox = awful.wibar({
        position = "top",
        screen = s, 
        -- shape = custom_shape, 
        input_passthrough = true,
        width = 100, 
        height = 28,
        bg = "#000000AA",
        border_color = "00000000",
    })
    s.mywiboxmiddle = awful.wibar({
        position = "top",
        screen = s, 
        -- shape = custom_shape, 
        input_passthrough = true,
        width = 1000, 
        height = 28,
        bg = "#000000AA", 
        border_color = "00000000"
    })
    s.mywiboxright = awful.wibar({
        position = "top",
        screen = s, 
        -- shape = custom_shape, 
        width = 240,
        input_passthrough = true,
        height = 28,
        bg = "#000000AA", 
        border_color = "#00000000"
    })

    -- Create the bottom wibox
    s.mywiboxbottom = awful.wibar({ 
        position = "bottom", 
        screen = s, 
        -- shape = custom_shape, 
        width = 1358,
        height = 28,
        bg = "#000000AA",
        border_color = "00000000"
    })


    s.mywibox.x = 4
    s.mywibox.y = 4
    
    s.mywiboxmiddle.x = 112
    s.mywiboxmiddle.y = 4

    s.mywiboxright.x = 1120
    s.mywiboxright.y = 4

    s.mywiboxbottom.x = 4
    s.mywiboxbottom.y = 768 - s.mywiboxbottom.height - 4

    local function ellipsize(text, length)
        return (text:len() > length and length > 0)
            and text:sub(0, length - 3) .. '...'
            or text
    end

    -- local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
    -- local BAT0 = battery_widget { adapter = "BAT0", ac = "AC" }
    local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
    local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")

    s.padding = {
        top = s.mywibox.height + 10 - 84, 
        left = 4, 
        right = 4, 
        bottom = 8, 
    }

    -- Add widgets to the wibox
    s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            layout = wibox.layout.fixed.horizontal,
            mylauncher,
            s.mytaglist,
            -- s.mypromptbox,
        }
    }

    s.mywiboxmiddle:setup {
        layout = wibox.layout.align.horizontal,
        {
            layout = wibox.layout.fixed.horizontal,
            wibox.widget {
                widget = wibox.widget.separator,
                forced_width = 8,
                opacity = 0
            },
            s.mypromptbox, -- Middle widget
        },
    }
    
    s.mywiboxright:setup {
        layout = wibox.layout.align.horizontal,
        -- Right widgets
        layout = wibox.layout.fixed.horizontal,
        wibox.widget {
            widget = wibox.widget.separator,
            forced_width = 2,
            opacity = 0
        },

        mytextclock,

        wibox.widget {
            widget = wibox.widget.separator,
            forced_width = 4,
            opacity = 0
        },

        brightness_widget{
            type = 'icon_and_text',
            program = 'xbacklight',
            font = 'JetBrains Mono Bold 9',
            step = 2,        
        },

        wibox.widget {
            widget = wibox.widget.separator,
            forced_width = 6,
            opacity = 0
        },

        volume_widget{
            type = 'icon_and_text',
            font = 'JetBrains Mono Bold 9'
        },

        -- wibox.widget {
        --  widget = wibox.widget.separator,
        --  forced_width = 4,
        --  opacity = 0
        -- },

        -- BAT0,

        wibox.widget {
            widget = wibox.widget.separator,
            forced_width = 4,
            opacity = 0
        },
    }

    -- Add widgets to the bottom wibox
    s.mywiboxbottom:setup {
        layout = wibox.layout.align.horizontal,
        nil,
        s.mytasklist, -- Middle widget
        { -- Right widgets
            layout = wibox.layout.fixed.horizontal,
            s.systray,
            wibox.widget {
                widget = wibox.widget.separator,
                forced_width = 12,
                opacity = 0
            },
            s.mylayoutbox
        },
    }

end)
-- }}}
...

i'am triying with padding, position, different types and nothing works.

thanks in advance.

Upvotes: 1

Views: 2733

Answers (1)

Emmanuel Lepage Vallee
Emmanuel Lepage Vallee

Reputation: 2762

I suggest you use a wibox rather than an awful.wibar. The difference is that a wibox doesn't affect the worksare while a wibar does. You might also consider an awful.popup, which is "in the middle" between a normal wibox and an awful.wibar. The awful.popup is auto-resized to the widget size.

See "The different type of widget boxes (Wibox)" section of https://awesomewm.org/apidoc/documentation/03-declarative-layout.md.html

Also, that's a nice desktop! Please post to https://github.com/awesomeWM/awesome/issues/1395 !

Upvotes: 1

Related Questions