From 5c469b1ca762dddd356540ac5f931d4dfa66e2b0 Mon Sep 17 00:00:00 2001 From: Surferlul Date: Tue, 7 Sep 2021 00:02:03 +0200 Subject: [PATCH] added automatic menubar height on show --- menubar/init.lua | 5 +++++ rc.lua | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/menubar/init.lua b/menubar/init.lua index c7e241a..b8811a6 100644 --- a/menubar/init.lua +++ b/menubar/init.lua @@ -113,6 +113,10 @@ menubar.geometry = { width = nil, x = nil, y = nil } +menubar.geometry_override = { width = nil, + height = nil, + x = nil, + y = nil } --- Width of blank space left in the right side. -- @tfield number right_margin menubar.right_margin = theme.xresources.apply_dpi(8) @@ -538,6 +542,7 @@ function menubar.show(scr) -- Set position and size local scrgeom = scr.workarea + menubar.geometry = { height = menubar.geometry_override.height or awful.screen.focused().geometry.height, width = menubar.geometry_override.width or 200, x = (menubar.geometry_override.x or 0) + awful.screen.focused().geometry.x , y = menubar.geometry_override.y} local geometry = menubar.geometry instance.geometry = {x = geometry.x or scrgeom.x, y = geometry.y or scrgeom.y, diff --git a/rc.lua b/rc.lua index ab56fc6..6c79627 100644 --- a/rc.lua +++ b/rc.lua @@ -14,10 +14,7 @@ local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") -local menu_width = 200 -local tmp_screen = { 1080, 1920 } -menubar.geometry = { height = tmp_screen[1], width = menu_width, x = 20 } - +menubar.geometry_override = { width = 200, x = 20 } --local hotkeys_popup = require("awful.hotkeys_popup") local hotkeys = require("awful.hotkeys_popup");