From 7cd97ec4b0660b762f245817223e38a0fbd1ed7f Mon Sep 17 00:00:00 2001 From: Yessiest Date: Mon, 18 Apr 2022 13:08:10 +0400 Subject: [PATCH] Made ubuntu-11.10 preset a little better --- core/layout.lua | 29 ++++--- presets/ubuntu-11.10/core/layout.lua | 125 ++++++++++++++------------- 2 files changed, 84 insertions(+), 70 deletions(-) diff --git a/core/layout.lua b/core/layout.lua index ea499c2..05b6468 100644 --- a/core/layout.lua +++ b/core/layout.lua @@ -96,20 +96,29 @@ awful.screen.connect_for_each_screen(function(s) s.mywibox:setup { expand = "outside", layout = wibox.layout.align.horizontal, - { -- Left widgets - start_button, - layout = wibox.layout.fixed.horizontal, - --require("widgets.polylauncher")({vertical = false}), - --s.mytaglist, - s.mypromptbox, - spacing = 3 + { + { + -- Left widgets + start_button, + --require("widgets.polylauncher")({vertical = false}), + --s.mytaglist, + s.mypromptbox, + layout = wibox.layout.fixed.horizontal, + spacing = 3 + }, + widget = wibox.container.place, + halign = "left", + fill_horizontal = false }, { layout = wibox.layout.fixed.horizontal }, - { -- Right widgets + { { - layout = wibox.layout.fixed.horizontal, + -- Right widgets + require("widgets.drawer")({ + wibox.widget.systray(), + }), require("widgets.wallpapers")({ screen = s, path = os.getenv("HOME").."/Pictures/Wallpapers/", @@ -124,10 +133,10 @@ awful.screen.connect_for_each_screen(function(s) require("widgets.battery")({ percentage = true, }), - --wibox.widget.systray(), awful.widget.keyboardlayout(), wibox.widget.textclock(), s.mylayoutbox, + layout = wibox.layout.fixed.horizontal, spacing = 4, }, widget = wibox.container.place, diff --git a/presets/ubuntu-11.10/core/layout.lua b/presets/ubuntu-11.10/core/layout.lua index 64e23a4..05b6468 100644 --- a/presets/ubuntu-11.10/core/layout.lua +++ b/presets/ubuntu-11.10/core/layout.lua @@ -67,76 +67,81 @@ awful.screen.connect_for_each_screen(function(s) }, bottom_widgets = { require("widgets.polylauncher")({vertical = true}) - } + }, + position="left" }) + -- Menu + require("core.widgets.menu") + -- Start button + local start_button = wibox.widget { + { + { + image = beautiful.awesome_icon, + widget = wibox.widget.imagebox + }, + widget = wibox.container.place, + halign = "center", + id = "menu" + }, + bg = "#26262633", + widget = wibox.container.background, + forced_width = require("beautiful.xresources").apply_dpi(61), + } + start_button:connect_signal("button::press",function(self,x,y,button) + if button == 1 then + menu:show() + end + end) -- Add widgets to the wibox s.mywibox:setup { + expand = "outside", layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, + { { - { - require("core.widgets.menu_launcher"), - widget = wibox.container.place, - halign = "center" - }, - bg = "#26262633", - widget = wibox.container.background, - forced_width = require("beautiful.xresources").apply_dpi(61), + -- Left widgets + start_button, + --require("widgets.polylauncher")({vertical = false}), + --s.mytaglist, + s.mypromptbox, + layout = wibox.layout.fixed.horizontal, + spacing = 3 }, - --require("widgets.polylauncher")({vertical = false}), - --s.mytaglist, - s.mypromptbox, - spacing = 3 + widget = wibox.container.place, + halign = "left", + fill_horizontal = false }, - -- Middle widget { - --[[require("widgets.polytasklist")({ - vertical = false, - stretch = false, - constraint = 180, - names = true, - margins = 5 - })(s),]] layout = wibox.layout.fixed.horizontal }, - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - awful.widget.keyboardlayout(), - require("widgets.wallpapers")({ - screen = s, - path = os.getenv("HOME").."/Pictures/Wallpapers/", - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), - require("widgets.mailbox")({ - screen = s, - style = { - rounding = 1, - icon_bg_normal = beautiful.topbar_bg - } - }), - --wibox.widget.systray(), - require("widgets.volume")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), - require("widgets.battery")({ - percentage = true, - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), - wibox.widget.textclock(), - require("widgets.username")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), - s.mylayoutbox, - spacing = 4 + { + { + -- Right widgets + require("widgets.drawer")({ + wibox.widget.systray(), + }), + require("widgets.wallpapers")({ + screen = s, + path = os.getenv("HOME").."/Pictures/Wallpapers/", + }), + require("widgets.mailbox")({ + screen = s, + style = { + rounding = 1, + } + }), + require("widgets.volume")({}), + require("widgets.battery")({ + percentage = true, + }), + awful.widget.keyboardlayout(), + wibox.widget.textclock(), + s.mylayoutbox, + layout = wibox.layout.fixed.horizontal, + spacing = 4, + }, + widget = wibox.container.place, + halign = "right", + fill_horizontal = false }, } end)