support a simple widget parameter when creating a titlebar that allow
user to put customs widgets in the titlebar.
From f4ecaa16c8d30a58709f79824d0c05171e5fb2a4 Mon Sep 17 00:00:00 2001
From: Cedric GESTES <[email protected]>
Date: Thu, 3 Sep 2009 19:37:59 +0200
Subject: [PATCH] titlebar: add support for a custom widget
---
lib/awful/titlebar.lua.in | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in
index 5c1d88e..0a6f289 100644
--- a/lib/awful/titlebar.lua.in
+++ b/lib/awful/titlebar.lua.in
@@ -63,6 +63,7 @@ function add(c, args)
if not args then args = {} end
if not args.height then args.height = capi.awesome.font_height * 1.5 end
local theme = beautiful.get()
+ if not args.widget then customwidget = {} else customwidget = args.widget end
-- Store colors
data[c] = {}
data[c].fg = args.fg or theme.titlebar_fg_normal or theme.fg_normal
@@ -115,6 +116,7 @@ function add(c, args)
tb.widgets = {
widget_list,
+ customwidget,
{
appicon = appicon,
title = title,
--
1.6.0.4