From aa869a5c9e9d4b1270476791553570710a65f405 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Thu, 16 Dec 2021 21:28:17 +0400 Subject: [PATCH] Fixed the titlebar in presets --- core/layout.lua | 36 +++++--------------------- core/titlebar.lua | 33 ++++++----------------- core/vars.lua | 2 +- presets/ubuntu-11.10/core/titlebar.lua | 8 ++---- presets/ubuntu-20.04/core/titlebar.lua | 8 ++---- 5 files changed, 20 insertions(+), 67 deletions(-) diff --git a/core/layout.lua b/core/layout.lua index 191e1a0..f7c5231 100644 --- a/core/layout.lua +++ b/core/layout.lua @@ -75,38 +75,22 @@ awful.screen.connect_for_each_screen(function(s) 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), - }, + require("core.widgets.menu_launcher"), --require("widgets.polylauncher")({vertical = false}), --s.mytaglist, s.mypromptbox, - require("widgets.current_window")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), spacing = 3 }, -- Middle widget { - --[[require("widgets.polytasklist")({ - vertical = false, - stretch = false, - constraint = 180, - names = true, - margins = 5 - })(s),]] - layout = wibox.layout.fixed.horizontal + widget = wibox.container.background }, { -- Right widgets + wibox.widget.textclock(), + { + widget = wibox.container.background, + forced_width = (math.abs(s.geometry.width/2)-200) + }, layout = wibox.layout.fixed.horizontal, awful.widget.keyboardlayout(), require("widgets.wallpapers")({ @@ -135,12 +119,6 @@ awful.screen.connect_for_each_screen(function(s) icon_bg_normal = beautiful.topbar_bg } }), - wibox.widget.textclock(), - require("widgets.username")({ - style = { - icon_bg_normal = beautiful.topbar_bg - } - }), s.mylayoutbox, spacing = 4 }, diff --git a/core/titlebar.lua b/core/titlebar.lua index d7d7f2d..43c6c31 100644 --- a/core/titlebar.lua +++ b/core/titlebar.lua @@ -88,39 +88,22 @@ return function(c) return awful.titlebar(c) : setup { { -- Left c.menu_button, - { -- Title - align = "center", - widget = awful.titlebar.widget.titlewidget(c), - buttons = buttons - }, spacing = 10, layout = wibox.layout.fixed.horizontal }, { -- Middle + { + widget = awful.titlebar.widget.titlewidget(c), + align = "center" + }, buttons = buttons, layout = wibox.layout.flex.horizontal }, { -- Right - { - { - awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.minimizebutton (c), - awful.titlebar.widget.closebutton (c), - layout = wibox.layout.fixed.horizontal(), - widget = wibox.container.margin, - margins = 3 - }, - widget = wibox.container.background, - shape = gears.shape.rounded_bar, - bg = { - type = "linear", - from = { 0, 15 }, - to = { 0, 0}, - stops = { { 0, "#5d5d5955"} , {1, "39383555"} } - }, - }, - widget = wibox.container.margin, - margins = 2 + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.minimizebutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal(), }, layout = wibox.layout.align.horizontal, } diff --git a/core/vars.lua b/core/vars.lua index 9c6ef06..d7bc1cb 100644 --- a/core/vars.lua +++ b/core/vars.lua @@ -5,7 +5,7 @@ global = {} global.awesome_dir = os.getenv("HOME").."/.config/awesome/" global.config_dir = os.getenv("HOME").."/.awesome/" global.themes_dir = os.getenv("HOME").."/.config/awesome/themes/" -global.theme = global.awesome_dir .. "themes/unity/theme.lua" +global.theme = global.awesome_dir .. "themes/unity2/theme.lua" global.terminal = "xterm" global.editor = os.getenv("EDITOR") or "vim" global.editor_cmd = global.terminal .. " -e ".. global.editor diff --git a/presets/ubuntu-11.10/core/titlebar.lua b/presets/ubuntu-11.10/core/titlebar.lua index d7d7f2d..af98678 100644 --- a/presets/ubuntu-11.10/core/titlebar.lua +++ b/presets/ubuntu-11.10/core/titlebar.lua @@ -88,15 +88,10 @@ return function(c) return awful.titlebar(c) : setup { { -- Left c.menu_button, - { -- Title - align = "center", - widget = awful.titlebar.widget.titlewidget(c), - buttons = buttons - }, - spacing = 10, layout = wibox.layout.fixed.horizontal }, { -- Middle + awful.titlebar.widget.titlewidget(c), buttons = buttons, layout = wibox.layout.flex.horizontal }, @@ -122,6 +117,7 @@ return function(c) widget = wibox.container.margin, margins = 2 }, + spacing = 10, layout = wibox.layout.align.horizontal, } end diff --git a/presets/ubuntu-20.04/core/titlebar.lua b/presets/ubuntu-20.04/core/titlebar.lua index e1ec92c..6eb210c 100644 --- a/presets/ubuntu-20.04/core/titlebar.lua +++ b/presets/ubuntu-20.04/core/titlebar.lua @@ -88,15 +88,10 @@ return function(c) return awful.titlebar(c) : setup { { -- Left c.menu_button, - { -- Title - align = "center", - widget = awful.titlebar.widget.titlewidget(c), - buttons = buttons - }, - spacing = 10, layout = wibox.layout.fixed.horizontal }, { -- Middle + awful.titlebar.widget.titlewidget(c), buttons = buttons, layout = wibox.layout.flex.horizontal }, @@ -106,6 +101,7 @@ return function(c) awful.titlebar.widget.closebutton (c), layout = wibox.layout.fixed.horizontal(), }, + spacing = 10, layout = wibox.layout.align.horizontal, } end