add ability to change titlebar color per app
This commit is contained in:
		
							parent
							
								
									bbd48a17c2
								
							
						
					
					
						commit
						76f56be701
					
				@ -501,15 +501,11 @@ awful.rules.rules = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
   -- Set Firefox to always map on the first tag on screen 1.
 | 
					   -- Set Firefox to always map on the first tag on screen 1.
 | 
				
			||||||
    { rule = { class = "Firefox" },
 | 
					    { rule = { class = "Firefox" },
 | 
				
			||||||
      properties = { maximized = true, tag = awful.util.tagnames[3] } },
 | 
					      properties = { maximized = true, tag = awful.util.tagnames[3], titlebar_color = "#0c0c0d" } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    -- Jetbrains stuff
 | 
					    -- Jetbrains stuff
 | 
				
			||||||
    { rule_any = { class = { "jetbrains-phpstorm", "jetbrains-idea", "jetbrains-pycharm" } },
 | 
					    { rule_any = { class = { "jetbrains-phpstorm", "jetbrains-idea", "jetbrains-pycharm" } },
 | 
				
			||||||
      properties = { titlebars_enabled = false, tag = awful.util.tagnames[1], maximized = false } },
 | 
					      properties = { titlebars_enabled = false, tag = awful.util.tagnames[1], maximized = false, titlebar_color = "#3c3f41" } },
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- jetbrains bugs
 | 
					 | 
				
			||||||
    { rule = { class = "jetbrains-.*", name = "win.*" }, 
 | 
					 | 
				
			||||||
      properties = { titlebars_enabled = false, focusable = false, focus = true, floating = true, placement = awful.placement.restore } },
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    -- flameshot
 | 
					    -- flameshot
 | 
				
			||||||
    { rule = { class = "flameshot" },
 | 
					    { rule = { class = "flameshot" },
 | 
				
			||||||
@ -530,6 +526,10 @@ awful.rules.rules = {
 | 
				
			|||||||
    -- dialogs
 | 
					    -- dialogs
 | 
				
			||||||
    { rule = { type = "dialog" },
 | 
					    { rule = { type = "dialog" },
 | 
				
			||||||
      properties = { titlebars_enabled = true, floating = true, maximized = false, border_width = 1 } },
 | 
					      properties = { titlebars_enabled = true, floating = true, maximized = false, border_width = 1 } },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- jetbrains bugs
 | 
				
			||||||
 | 
					    { rule = { class = "jetbrains-.*", name = "win.*" }, 
 | 
				
			||||||
 | 
					      properties = { titlebars_enabled = false, allow_titlebars = false, focusable = false, floating = true, titlebar_color = "#ff0000" } },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Signals
 | 
					-- Signals
 | 
				
			||||||
@ -573,20 +573,22 @@ client.connect_signal("request::titlebars", function(c)
 | 
				
			|||||||
    local title = awful.titlebar.widget.titlewidget(c)
 | 
					    local title = awful.titlebar.widget.titlewidget(c)
 | 
				
			||||||
    title.font = "Fira Code Regular 7"
 | 
					    title.font = "Fira Code Regular 7"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    awful.titlebar(c, { size = 20, fg_focus = "#ffffff" }) : setup {
 | 
					    awful.titlebar(c, { size = 20, fg_focus = "#ffffff", bg_focus = c.titlebar_color or beautiful.titlebar_bg_focus }) : setup {
 | 
				
			||||||
        { -- Left
 | 
					        { -- Left
 | 
				
			||||||
            --awful.titlebar.widget.iconwidget(c),
 | 
					            awful.titlebar.widget.iconwidget(c),
 | 
				
			||||||
            -- Title
 | 
					            -- Title
 | 
				
			||||||
 | 
					            buttons = buttons,
 | 
				
			||||||
 | 
					            layout  = wibox.container.margin,
 | 
				
			||||||
 | 
					            left    = 8,
 | 
				
			||||||
 | 
					            right   = 8,
 | 
				
			||||||
 | 
					            top     = 2,
 | 
				
			||||||
 | 
					            bottom  = 2,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        { -- Middle
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                align  = "left",
 | 
					                align  = "left",
 | 
				
			||||||
                widget = title,
 | 
					                widget = title,
 | 
				
			||||||
                left   = 20
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            buttons = buttons,
 | 
					 | 
				
			||||||
            layout  = wibox.container.margin,
 | 
					 | 
				
			||||||
            left    = 8
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        { -- Middle
 | 
					 | 
				
			||||||
            buttons = buttons,
 | 
					            buttons = buttons,
 | 
				
			||||||
            layout  = wibox.layout.flex.horizontal
 | 
					            layout  = wibox.layout.flex.horizontal
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
@ -614,27 +616,21 @@ client.connect_signal("property::floating", function (c)
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        awful.titlebar.show(c)
 | 
					        awful.titlebar.show(c)
 | 
				
			||||||
 | 
					        c.border_width = 1
 | 
				
			||||||
    elseif not c.floating then
 | 
					    elseif not c.floating then
 | 
				
			||||||
        awful.titlebar.hide(c)
 | 
					        awful.titlebar.hide(c)
 | 
				
			||||||
 | 
					        c.border_width = 0
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Enable sloppy focus, so that focus follows mouse.
 | 
					 | 
				
			||||||
-- client.connect_signal("mouse::enter", function(c)
 | 
					 | 
				
			||||||
--     if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
 | 
					 | 
				
			||||||
--         and awful.client.focus.filter(c) then
 | 
					 | 
				
			||||||
--         client.focus = c
 | 
					 | 
				
			||||||
--     end
 | 
					 | 
				
			||||||
-- end)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- No border for maximized clients
 | 
					-- No border for maximized clients
 | 
				
			||||||
client.connect_signal("focus",
 | 
					client.connect_signal("focus",
 | 
				
			||||||
    function(c)
 | 
					    function(c)
 | 
				
			||||||
        if c.maximized then -- no borders if only 1 client visible
 | 
					        if c.maximized then
 | 
				
			||||||
 | 
					            c.border_width_old = c.border_width
 | 
				
			||||||
            c.border_width = 0
 | 
					            c.border_width = 0
 | 
				
			||||||
        elseif #awful.screen.focused().clients > 1 then
 | 
					        elseif #awful.screen.focused().clients > 1 then
 | 
				
			||||||
            c.border_width = beautiful.border_width
 | 
					            c.border_width = c.border_width_old
 | 
				
			||||||
            c.border_color = beautiful.border_focus
 | 
					 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
    end)
 | 
					    end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -67,7 +67,7 @@ theme.border_focus                              = "#3f3f3f"
 | 
				
			|||||||
theme.border_marked                             = "#CC9393"
 | 
					theme.border_marked                             = "#CC9393"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
theme.titlebar_bg_normal                        = "#313742"
 | 
					theme.titlebar_bg_normal                        = "#313742"
 | 
				
			||||||
theme.titlebar_bg_focus                         = "#313742"
 | 
					theme.titlebar_bg_focus                         = "#2f343f"
 | 
				
			||||||
theme.titlebar_fg_normal                        = colors.white
 | 
					theme.titlebar_fg_normal                        = colors.white
 | 
				
			||||||
theme.titlebar_fg_focus                         = colors.white
 | 
					theme.titlebar_fg_focus                         = colors.white
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -308,7 +308,7 @@ function theme.connect(s)
 | 
				
			|||||||
            layout = wibox.layout.fixed.horizontal,
 | 
					            layout = wibox.layout.fixed.horizontal,
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                widget = wibox.container.background,
 | 
					                widget = wibox.container.background,
 | 
				
			||||||
                shape  = gears.shape.powerline,
 | 
					                shape  = function (cr, w, h) gears.shape.powerline(cr, w, h, -h/2) end,
 | 
				
			||||||
                color  = "#000000",
 | 
					                color  = "#000000",
 | 
				
			||||||
                bg     = "#000000",
 | 
					                bg     = "#000000",
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user