From 820094c3c4306ce732553f0441b8a64703770206 Mon Sep 17 00:00:00 2001 From: Yauhen Kirylau Date: Mon, 17 Dec 2018 18:47:14 +0100 Subject: [PATCH] feat(awful: titlebar): expose fallback title (#2459) feat(awful: titlebar): expose fallback title --- lib/awful/titlebar.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/awful/titlebar.lua b/lib/awful/titlebar.lua index d6230f9b..ed7b3054 100644 --- a/lib/awful/titlebar.lua +++ b/lib/awful/titlebar.lua @@ -27,10 +27,22 @@ local base = require("wibox.widget.base") local capi = { client = client } + + local titlebar = { - widget = {} + widget = {}, + enable_tooltip = true, + fallback_name = '' } + +--- Show tooltips when hover on titlebar buttons. +-- @tfield[opt=true] boolean awful.titlebar.enable_tooltip + +--- Title to display if client name is not set. +-- @field[opt='\'] awful.titlebar.fallback_name + + --- The titlebar foreground (text) color. -- @beautiful beautiful.titlebar_fg_normal -- @param color @@ -422,8 +434,6 @@ local titlebar = { -- @name setup -- @class function ---- Show tooltips when hover on titlebar buttons (defaults to 'true') -titlebar.enable_tooltip = true local all_titlebars = setmetatable({}, { __mode = 'k' }) @@ -595,7 +605,7 @@ end function titlebar.widget.titlewidget(c) local ret = textbox() local function update() - ret:set_text(c.name or "") + ret:set_text(c.name or titlebar.fallback_name) end c:connect_signal("property::name", update) update()