awesome/widgets/wintitle.lua

23 lines
706 B
Lua
Raw Permalink Normal View History

2021-11-20 21:33:18 +00:00
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local awmtk = require("awmtk")
return function(args)
local style = awmtk.style(awmtk.defaults, args.style or {},"wintitle_")
2021-11-20 21:33:18 +00:00
local icon = style.icon({
{
widget = wibox.widget.textbox,
2021-11-29 07:40:09 +00:00
markup = "<b></b>",
2021-11-20 21:33:18 +00:00
id = "widget_text"
},
layout = wibox.layout.fixed.horizontal,
spacing = style.wintitle_container_spacing_horizontal or 4
2021-11-20 21:33:18 +00:00
})
local text = icon:get_children_by_id("widget_text")[1]
client.connect_signal("focus", function()
2021-11-29 07:40:09 +00:00
text.markup = "<b>"..tostring(client.focus.icon_name).."</b>"
2021-11-20 21:33:18 +00:00
end)
return icon
end