awesomerc: make titlebar optional and disabled by default

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-31 17:52:34 +02:00
parent 06fac9a151
commit b7568c44ea
1 changed files with 18 additions and 7 deletions

View File

@ -52,6 +52,9 @@ fg_focus = "#ffffff"
border_focus = bg_focus
border_marked = "#91231C"
-- Define if we want to use titlebar on all applications
use_titlebar = false
awesome.font_set(font)
awesome.colors_set({ fg = fg_normal, bg = bg_normal })
@ -292,16 +295,20 @@ function hook_focus(c)
if not awful.client.ismarked(c) then
c.border_color = border_focus
end
if use_titlebar then
awful.titlebar.update(c, bg_normal, fg_normal, bg_focus, fg_focus)
end
end
-- Hook function to execute when unfocusing a client.
function hook_unfocus(c)
if not awful.client.ismarked(c) then
c.border_color = border_normal
end
if use_titlebar then
awful.titlebar.update(c, bg_normal, fg_normal, bg_focus, fg_focus)
end
end
-- Hook function to execute when marking a client
function hook_marked(c)
@ -325,9 +332,11 @@ end
function hook_manage(c)
-- Set floating placement to be smart!
c.floating_placement = "smart"
if use_titlebar then
-- Add a titlebar
c.titlebar = awful.titlebar.new({ fg = fg, bg = bg, modkey = modkey })
awful.titlebar.update(c, bg_normal, fg_normal, bg_focus, fg_focus)
end
-- Add mouse bindings
c:mouse_add(mouse({ }, 1, function (c) c:focus_set(); c:raise() end))
c:mouse_add(mouse({ modkey }, 1, function (c) c:mouse_move() end))
@ -385,9 +394,11 @@ function hook_timer ()
end
function hook_titleupdate (c)
if use_titlebar then
-- Update titlebar
awful.titlebar.update(c, bg_normal, fg_normal, bg_focus, fg_focus)
end
end
-- Set up some hooks
awful.hooks.focus(hook_focus)