diff options
-rw-r--r-- | pager.lua | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -2,6 +2,7 @@ local M = {} local awful = require("awful") local beautiful = require("beautiful") +local gstring = require("gears.string") local wibox = require("wibox") local Page = {} @@ -39,16 +40,32 @@ function Page:client_add(c) local bg_urgent = beautiful.bg_urgent or "#ffffff" local fg_urgent = beautiful.fg_urgent or "#d00000" - local tb = wibox.widget.textbox("", true) + local tb = wibox.widget.textbox("", false) local bg = wibox.container.background(tb, bg) tb:set_font(font) local function update_text(c) - tb:set_text(c.name or "") + local text = gstring.xml_escape(c.name) or "" + + -- add markers for window state (maximized, floating) + if c.maximized then + text = '<b>+</b>' .. text + else + if c.maximized_horizontal then text = '⬌' .. text end + if c.maximized_vertical then text = '⬍' .. text end + if c.floating then text = '✈' .. text end + end + + tb:set_markup(text) end - c:connect_signal("property::name", update_text) + c:connect_signal("property::name", update_text) + c:connect_signal("property::floating", update_text) + c:connect_signal("property::maximized", update_text) + c:connect_signal("property::maximized_horizontal", update_text) + c:connect_signal("property::maximized_vertical", update_text) + c:connect_signal("focus", function(c) if c.screen == self.screen then |