feat(awful: titlebar): expose fallback title (#2459)

feat(awful: titlebar): expose fallback title
This commit is contained in:
Yauhen Kirylau 2018-12-17 18:47:14 +01:00 committed by Emmanuel Lepage Vallée
parent de04cecf46
commit 820094c3c4
1 changed files with 14 additions and 4 deletions

View File

@ -27,10 +27,22 @@ local base = require("wibox.widget.base")
local capi = {
client = client
}
local titlebar = {
widget = {}
widget = {},
enable_tooltip = true,
fallback_name = '<unknown>'
}
--- 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='\<unknown\>'] 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 "<unknown>")
ret:set_text(c.name or titlebar.fallback_name)
end
c:connect_signal("property::name", update)
update()