diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in
index 113a4f2e..02bbd90c 100644
--- a/lib/awful/titlebar.lua.in
+++ b/lib/awful/titlebar.lua.in
@@ -68,16 +68,19 @@ function add(c, args)
appicon:buttons(bts)
function appicon.mouse_enter(s) hooks.user.call('mouse_enter', c) end
- if theme.titlebar_close_button == "true" then
- local closef = widget.button({ name = "closef", align = "right",
- image = theme.titlebar_close_button_focus
- or theme.titlebar_close_button_img_focus
- or "@AWESOME_ICON_PATH@/titlebar/closer.png" })
- local close = widget.button({ name = "close", align = "right",
- image = theme.titlebar_close_button_normal
- or theme.titlebar_close_button_img_normal
- or "@AWESOME_ICON_PATH@/titlebar/close.png" })
+ local closef
+ if theme.titlebar_close_button_focus then
+ closef = widget.button({ name = "closef", align = "right",
+ image = theme.titlebar_close_button_focus })
+ end
+ local close
+ if theme.titlebar_close_button_normal then
+ close = widget.button({ name = "close", align = "right",
+ image = theme.titlebar_close_button_normal })
+ end
+
+ if close or closef then
-- Bind kill button, also allow moving and resizing on this widget
local bts =
{
@@ -85,17 +88,19 @@ function add(c, args)
capi.button({ args.modkey }, 1, function (t) t.client:mouse_move() end),
capi.button({ args.modkey }, 3, function (t) t.client:mouse_resize() end)
}
- close:buttons(bts)
- closef:buttons(bts)
- -- Needed for sloppy focus beheaviour
- function close.mouse_enter(s) hooks.user.call('mouse_enter', c) end
- function closef.mouse_enter(s) hooks.user.call('mouse_enter', c) end
-
- tb.widgets = { appicon, title, closef, close }
- else
- tbx.widgets = { appicon, title }
+ if close then
+ close:buttons(bts)
+ function close.mouse_enter(s) hooks.user.call('mouse_enter', c) end
+ end
+ if closef then
+ closef:buttons(bts)
+ -- Needed for sloppy focus beheaviour
+ function closef.mouse_enter(s) hooks.user.call('mouse_enter', c) end
+ end
end
+ tb.widgets = { appicon, title, closef, close }
+
c.titlebar = tb
update(c)
diff --git a/themes/default/theme.in b/themes/default/theme.in
index f73d5c42..9e172c05 100644
--- a/themes/default/theme.in
+++ b/themes/default/theme.in
@@ -43,16 +43,9 @@ menu_width = 100
# beautiful.variable in your rc.lua
#bg_widget = #cc0000
-# Display close button inside titlebar
-titlebar_close_button = true
-
# Define the image to load
-@ (if titlebar_close_button_[normal|focus] these values are ignored)
-#titlebar_close_button_img_normal = @AWESOME_THEMES_PATH@/default/titlebar/closea.png
-#titlebar_close_button_img_focus = @AWESOME_THEMES_PATH@/default/titlebar/closera.png
-# Or create your own close button
-#titlebar_close_button_normal = ...
-#titlebar_close_button_focus = ...
+titlebar_close_button_normal = @AWESOME_THEMES_PATH@/default/titlebar/close.png
+titlebar_close_button_focus = @AWESOME_THEMES_PATH@/default/titlebar/closer.png
# You can use your own command to set your wallpaper
wallpaper_cmd = awsetbg @AWESOME_THEMES_PATH@/default/background.png