From 7ff58dbb8d90a3b5021af2fa156f126265a000bd Mon Sep 17 00:00:00 2001 From: elenapan Date: Tue, 7 Apr 2020 05:02:01 +0300 Subject: [PATCH] Simplify rules for placement and titlebars on/off In the past, using `titlebars_enabled = false` would make AwesomeWM create a hidden empty titlebar on the client. Now it correctly creates the titlebar and hides it. Also now we do not need to delay the client placement function to enforce correct placement since titlebars are correctly initialized before the client is moved. --- config/awesome/rc.lua | 58 +++++++++++++------------------------------ 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 46a6654..89f03b2 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -361,30 +361,11 @@ awful.rules.rules = { honor_workarea = true, honor_padding = true, maximized = false, + titlebars_enabled = beautiful.titlebars_enabled, maximized_horizontal = false, maximized_vertical = false, - -- placement = floating_client_placement + placement = floating_client_placement }, - callback = function (c) - -- Hide titlebars if required by the theme - if not beautiful.titlebars_enabled then - decorations.hide(c) - end - - -- Apply placement function here instead of in - -- properties above so that clients are placed - -- accurately if and after titlebars have been - -- hidden - gears.timer.delayed_call(function () - floating_client_placement(c) - end) - end - }, - - -- Add titlebars to normal clients and dialogs - { - rule_any = { type = { "normal", "dialog" } }, - properties = { titlebars_enabled = true } }, -- Floating clients @@ -489,6 +470,20 @@ awful.rules.rules = { end }, + -- Titlebars ON (explicitly) + { + rule_any = { + type = { + "dialog", + "normal", + }, + role = { + "conversation", + } + }, + properties = { titlebars_enabled = true }, + }, + -- Titlebars OFF (explicitly) { rule_any = { @@ -515,26 +510,7 @@ awful.rules.rules = { -- "Thunderbird", }, }, - properties = {}, - callback = function (c) - decorations.hide(c) - end - }, - - -- Titlebars ON (explicitly) - { - rule_any = { - type = { - "dialog", - }, - role = { - "conversation", - } - }, - properties = {}, - callback = function (c) - decorations.show(c) - end + properties = { titlebars_enabled = false }, }, -- Fixed terminal geometry