diff --git a/modules/desktop.lua b/modules/desktop.lua index a35ed92..9cfd9a2 100644 --- a/modules/desktop.lua +++ b/modules/desktop.lua @@ -145,7 +145,7 @@ client.connect_signal("request::titlebars",function(c) buttons = buttons }) end - awful.titlebar(c,{ + local titlebar = awful.titlebar(c,{ size = style[v].size or 0, position = v:gsub("titlebar_",""), bg_normal = style[v].bg_normal, @@ -155,8 +155,19 @@ client.connect_signal("request::titlebars",function(c) fg_normal = style[v].fg_normal, fg_focus = style[v].fg_focus, font = style[v].font - }):setup(t.titlebar(contents)) + }) + titlebar:setup(t.titlebar(contents)) awful.rules.rules[1].properties.placement(c) + if style[v].onfocus then + c:connect_signal("focus",function() + style[v].onfocus(titlebar) + end) + end + if style[v].onunfocus then + c:connect_signal("unfocus",function() + style[v].onunfocus(titlebar) + end) + end end end) end --}}} diff --git a/themes/unity/WARNING.txt b/themes/unity/WARNING.txt new file mode 100644 index 0000000..5a79fcf --- /dev/null +++ b/themes/unity/WARNING.txt @@ -0,0 +1,2 @@ +A compositor (like compton) is ***required*** for this theme to work as intended. +This is in part due to the fact that it makes the top bar look less bland, and in part due to the fact that your titlebar corners will look weird otherwise. diff --git a/themes/unity/icons/ac-adapter-symbolic.png b/themes/unity/icons/ac-adapter-symbolic.png index cdf53b7..a1a4b07 100644 Binary files a/themes/unity/icons/ac-adapter-symbolic.png and b/themes/unity/icons/ac-adapter-symbolic.png differ diff --git a/themes/unity/icons/backlight-symbolic.png b/themes/unity/icons/backlight-symbolic.png index 828f571..4bd29bc 100644 Binary files a/themes/unity/icons/backlight-symbolic.png and b/themes/unity/icons/backlight-symbolic.png differ diff --git a/themes/unity/icons/battery-caution-charging-symbolic.png b/themes/unity/icons/battery-caution-charging-symbolic.png index be0746b..e8ca1cd 100644 Binary files a/themes/unity/icons/battery-caution-charging-symbolic.png and b/themes/unity/icons/battery-caution-charging-symbolic.png differ diff --git a/themes/unity/icons/battery-caution-symbolic.png b/themes/unity/icons/battery-caution-symbolic.png index 25e3572..f710939 100644 Binary files a/themes/unity/icons/battery-caution-symbolic.png and b/themes/unity/icons/battery-caution-symbolic.png differ diff --git a/themes/unity/icons/battery-full-charged-symbolic.png b/themes/unity/icons/battery-full-charged-symbolic.png index 4735283..4ea42bb 100644 Binary files a/themes/unity/icons/battery-full-charged-symbolic.png and b/themes/unity/icons/battery-full-charged-symbolic.png differ diff --git a/themes/unity/icons/battery-full-charging-symbolic.png b/themes/unity/icons/battery-full-charging-symbolic.png index c299736..6b1d1ee 100644 Binary files a/themes/unity/icons/battery-full-charging-symbolic.png and b/themes/unity/icons/battery-full-charging-symbolic.png differ diff --git a/themes/unity/icons/battery-full-symbolic.png b/themes/unity/icons/battery-full-symbolic.png index 4735283..4ea42bb 100644 Binary files a/themes/unity/icons/battery-full-symbolic.png and b/themes/unity/icons/battery-full-symbolic.png differ diff --git a/themes/unity/icons/battery-good-charging-symbolic.png b/themes/unity/icons/battery-good-charging-symbolic.png index 364fc94..289f521 100644 Binary files a/themes/unity/icons/battery-good-charging-symbolic.png and b/themes/unity/icons/battery-good-charging-symbolic.png differ diff --git a/themes/unity/icons/battery-good-symbolic.png b/themes/unity/icons/battery-good-symbolic.png index c9edfb0..a7e2351 100644 Binary files a/themes/unity/icons/battery-good-symbolic.png and b/themes/unity/icons/battery-good-symbolic.png differ diff --git a/themes/unity/icons/battery-low-charging-symbolic.png b/themes/unity/icons/battery-low-charging-symbolic.png index f1a7544..66b1c60 100644 Binary files a/themes/unity/icons/battery-low-charging-symbolic.png and b/themes/unity/icons/battery-low-charging-symbolic.png differ diff --git a/themes/unity/icons/battery-low-symbolic.png b/themes/unity/icons/battery-low-symbolic.png index 5f26e83..246c334 100644 Binary files a/themes/unity/icons/battery-low-symbolic.png and b/themes/unity/icons/battery-low-symbolic.png differ diff --git a/themes/unity/icons/notifications-area-symbolic.png b/themes/unity/icons/notifications-area-symbolic.png index ceb0578..24341ea 100644 Binary files a/themes/unity/icons/notifications-area-symbolic.png and b/themes/unity/icons/notifications-area-symbolic.png differ diff --git a/themes/unity/icons/unknown-app.png b/themes/unity/icons/unknown-app.png index 0d0f8bd..26976ec 100644 Binary files a/themes/unity/icons/unknown-app.png and b/themes/unity/icons/unknown-app.png differ diff --git a/themes/unity/icons/wallpapers.png b/themes/unity/icons/wallpapers.png index 49e84e7..26b98a8 100644 Binary files a/themes/unity/icons/wallpapers.png and b/themes/unity/icons/wallpapers.png differ diff --git a/themes/unity/theme.lua b/themes/unity/theme.lua index ca26bfd..be64eea 100644 --- a/themes/unity/theme.lua +++ b/themes/unity/theme.lua @@ -154,9 +154,6 @@ theme.titlebar_maximized_button_focus_inactive = themes_path.."unity/titlebar/m theme.titlebar_maximized_button_normal_active = themes_path.."unity/titlebar/maximized_normal_active.png" theme.titlebar_maximized_button_focus_active = themes_path.."unity/titlebar/maximized_focus_active.png" -theme.wallpaper = themes_path.."unity/background.png" -theme.wallpapers_icon = themes_path.."unity/icons/wallpapers.png" - -- You can use your own layout icons like this: theme.layout_fairh = themes_path.."unity/layouts/fairhw.png" theme.layout_fairv = themes_path.."unity/layouts/fairvw.png" @@ -217,13 +214,40 @@ theme["mpc-next-symbolic"] = themes_path.."unity/icons/mpc-next-symbolic.png" theme["action-poweroff-symbolic"] = themes_path.."unity/icons/action-poweroff-symbolic.png" theme["action-lock-screen-symbolic"] = themes_path.."unity/icons/action-lock-screen-symbolic.png" theme["action-suspend-symbolic"] = themes_path.."unity/icons/action-suspend-symbolic.png" +theme.wallpaper = themes_path.."unity/background.png" +theme.wallpapers_icon = themes_path.."unity/icons/wallpapers.png" +-- Default icon for clients +-- This one has to be baked as a surface to avoid memory leaks +theme.icon_default = themes_path.."unity/icons/unknown-app.png" + +for k,v in pairs({ + "battery-caution-charging-symbolic", + "battery-empty-charging-symbolic", + "battery-full-charging-symbolic", + "battery-good-charging-symbolic", + "battery-low-charging-symbolic", + "battery-full-charged-symbolic", + "battery-missing-symbolic", + "ac-adapter-symbolic", + "backlight-symbolic", + "notifications-area-symbolic", + "mpc-previous-symbolic", + "mpc-play-symbolic", + "mpc-pause-symbolic", + "mpc-next-symbolic", + "action-poweroff-symbolic", + "action-lock-screen-symbolic", + "action-suspend-symbolic", + "wallpapers_icon", + "icon_default"}) do + if theme[v] and gears.filesystem.file_readable(theme[v]) then + theme[v] = gears.color.recolor_image(theme[v],theme.fg_normal) + end +end -- Notification popups settings theme.notification_width = 240 theme.notification_height = 60 --- Default icon for clients --- This one has to be baked as a surface to avoid memory leaks -theme.icon_default = gears.surface(themes_path.."unity/icons/unknown-app.png") theme.widgets = { -- {{{ Widget base @@ -247,8 +271,16 @@ theme.widgets = { shape = function(cr,width,height) return gears.shape.rounded_rect(cr,width,height,4) end, + root_shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,6) + end, }, titlebar = { + root_shape = function(cr,width,height) + return gears.shape.partially_rounded_rect(cr,width,height, + true,true,false,false,7) end, + root_bg_focus = theme.titlebar_bg_focus, + root_bg_normal = theme.titlebar_bg_normal, top = 2, bottom = 2, left = 3, @@ -298,7 +330,7 @@ theme.widgets = { -- {{{ Popup activating icons generic_iconified_widget = { button = { - margins = 2, + margins = 1, bg_normal = "#00000000", onpress = function(widget) widget:set_bg(theme.bg_normal) @@ -323,7 +355,7 @@ theme.widgets = { bg_normal = "#00000000", }, button = { - margins = 2, + margins = 1, bg_normal = "#00000000", onpress = function() end, onrelease = function() end, @@ -413,7 +445,8 @@ theme.widgets = { tasklist = { button = { width = 160, - height = 50, + height = 44, + margins = 5, shape_focus = theme.button_shape, shape_normal = theme.button_shape, shape_urgent = theme.button_shape, @@ -490,8 +523,23 @@ theme.widgets = { }, titlebar = { titlebar_top = { - bg_focus = theme.titlebar_bg_focus, - bg_normal = theme.titlebar_bg_normal, + onfocus = function(titlebar) + local root = titlebar:get_children_by_id("titlebar_root")[1] + root:set_bg(theme.titlebar_bg_focus) + root:set_shape(function(cr,width,height) + return gears.shape.partially_rounded_rect(cr,width,height, + true,true,false,false,7) end) + + end, + onunfocus = function(titlebar) + local root = titlebar:get_children_by_id("titlebar_root")[1] + root:set_bg(theme.titlebar_bg_normal) + root:set_shape(function(cr,width,height) + return gears.shape.partially_rounded_rect(cr,width,height, + true,true,false,false,7) end) + end, + bg_focus = "#00000000", + bg_normal = "#00000000", fg_focus = "#FAFAFA", fg_normal = theme.fg_normal, size = 22, @@ -517,7 +565,7 @@ theme.widgets = { wibar_top = { bg_normal = theme.bar_bg_normal, fg_normal = theme.fg_normal, - size = 22 + size = 22, }, wibar_left = { bg_normal = "#0D0D0966", @@ -527,6 +575,70 @@ theme.widgets = { } } +local wibox = require("wibox") + +theme.templates = { + templates = { + titlebar = function(style) + return function(layout,options) + local margins = style.titlebar.margins + if (style.titlebar.left or + style.titlebar.right or + style.titlebar.bottom or + style.titlebar.top) then + margins = nil + end + return { + { + gears.table.join({ + layout, + margins = margins, + layout = wibox.container.margin, + left = style.titlebar.left, + right = style.titlebar.right, + bottom = style.titlebar.bottom, + top = style.titlebar.top + },options or {}), + bgimage = style.titlebar.root_bgimage_normal, + bg = style.titlebar.root_bg_normal, + fg = style.titlebar.root_fg_normal, + shape = style.titlebar.root_shape, + shape_border_color = style.titlebar.root_shape_border_color, + shape_border_width = style.titlebar.root_shape_border_width, + widget = wibox.container.background, + id = "titlebar_root" + }, + layout = wibox.container.margin, + left = style.titlebar.root_margin_left, + right = style.titlebar.root_margin_right, + top = style.titlebar.root_margin_top, + bottom = style.titlebar.root_margin_bottom + } + end + end, + popup = function(style) + return function(widget,options) + return gears.table.join({ + widget = { + { + widget, + margins = style.popup.margins, + layout = wibox.container.margin + }, + bg = style.popup.bg_normal, + shape = style.popup.root_shape, + widget = wibox.container.background + }, + bg = "#00000000", + shape = style.popup.shape, + visible = false, + ontop = true + },options or {}) + end + end + } +} + return theme -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80