feat(themes: xresources): recolor titlebar icons; improve comments

This commit is contained in:
actionless 2015-08-02 12:56:57 +02:00 committed by Daniel Hahler
parent 2f340f05ff
commit d1f13975dd
1 changed files with 39 additions and 27 deletions

View File

@ -55,44 +55,55 @@ theme.menu_width = dpi(100)
-- beautiful.variable in your rc.lua
--theme.bg_widget = "#cc0000"
-- Define the image to load
--theme.titlebar_close_button_normal = "@AWESOME_THEMES_PATH@/default/titlebar/close_normal.png"
--theme.titlebar_close_button_focus = "@AWESOME_THEMES_PATH@/default/titlebar/close_focus.png"
-- Recolor titlebar icons:
for _, titlebar_icon in ipairs({
'titlebar_close_button_normal',
--theme.titlebar_ontop_button_normal_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/ontop_normal_inactive.png"
--theme.titlebar_ontop_button_focus_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/ontop_focus_inactive.png"
--theme.titlebar_ontop_button_normal_active = "@AWESOME_THEMES_PATH@/default/titlebar/ontop_normal_active.png"
--theme.titlebar_ontop_button_focus_active = "@AWESOME_THEMES_PATH@/default/titlebar/ontop_focus_active.png"
'titlebar_ontop_button_normal_inactive',
'titlebar_ontop_button_normal_active',
--theme.titlebar_sticky_button_normal_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/sticky_normal_inactive.png"
--theme.titlebar_sticky_button_focus_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/sticky_focus_inactive.png"
--theme.titlebar_sticky_button_normal_active = "@AWESOME_THEMES_PATH@/default/titlebar/sticky_normal_active.png"
--theme.titlebar_sticky_button_focus_active = "@AWESOME_THEMES_PATH@/default/titlebar/sticky_focus_active.png"
'titlebar_sticky_button_normal_inactive',
'titlebar_sticky_button_normal_active',
--theme.titlebar_floating_button_normal_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/floating_normal_inactive.png"
--theme.titlebar_floating_button_focus_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/floating_focus_inactive.png"
--theme.titlebar_floating_button_normal_active = "@AWESOME_THEMES_PATH@/default/titlebar/floating_normal_active.png"
--theme.titlebar_floating_button_focus_active = "@AWESOME_THEMES_PATH@/default/titlebar/floating_focus_active.png"
'titlebar_floating_button_normal_inactive',
'titlebar_floating_button_normal_active',
--theme.titlebar_maximized_button_normal_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/maximized_normal_inactive.png"
--theme.titlebar_maximized_button_focus_inactive = "@AWESOME_THEMES_PATH@/default/titlebar/maximized_focus_inactive.png"
--theme.titlebar_maximized_button_normal_active = "@AWESOME_THEMES_PATH@/default/titlebar/maximized_normal_active.png"
--theme.titlebar_maximized_button_focus_active = "@AWESOME_THEMES_PATH@/default/titlebar/maximized_focus_active.png"
'titlebar_maximized_button_normal_inactive',
'titlebar_maximized_button_normal_active',
}) do
theme[titlebar_icon] = recolor_image(theme[titlebar_icon], theme.fg_normal)
end
for _, titlebar_icon in ipairs({
'titlebar_close_button_focus',
'titlebar_ontop_button_focus_inactive',
'titlebar_ontop_button_focus_active',
'titlebar_sticky_button_focus_inactive',
'titlebar_sticky_button_focus_active',
'titlebar_floating_button_focus_inactive',
'titlebar_floating_button_focus_active',
'titlebar_maximized_button_focus_inactive',
'titlebar_maximized_button_focus_active',
}) do
theme[titlebar_icon] = recolor_image(theme[titlebar_icon], theme.fg_focus)
end
-- Recolor layout icons:
for _, layout_name in ipairs({
'layout_fairh',
'layout_fairv',
'layout_floating ',
'layout_floating',
'layout_magnifier',
'layout_max',
'layout_fullscreen',
'layout_tilebottom',
'layout_tileleft ',
'layout_tileleft',
'layout_tile',
'layout_tiletop',
'layout_spiral ',
'layout_spiral',
'layout_dwindle',
'layout_cornernw',
'layout_cornerne',
@ -102,17 +113,16 @@ for _, layout_name in ipairs({
theme[layout_name] = recolor_image(theme[layout_name], theme.fg_normal)
end
-- Define the icon theme for application icons. If not set then the icons
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
theme.icon_theme = nil
-- Generate Awesome icon:
theme.awesome_icon = theme_assets.awesome_icon(
theme.menu_height, theme.bg_focus, theme.fg_focus
)
-- Taglist squares:
-- Generate taglist squares:
local taglist_square_size = dpi(4)
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
taglist_square_size, theme.fg_normal
@ -121,20 +131,22 @@ theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
taglist_square_size, theme.fg_normal
)
-- Try to determine if we are running light or dark colorscheme:
local bg_numberic_value = 0;
for s in theme.bg_normal:gmatch("[a-fA-F0-9][a-fA-F0-9]") do
bg_numberic_value = bg_numberic_value + tonumber("0x"..s);
end
local is_dark_bg = (bg_numberic_value < 383)
-- Generate wallpaper:
local wallpaper_bg = xrdb.color8
local wallpaper_fg = xrdb.color7
local wallpaper_alt_wallpaper_fg = xrdb.color12
local wallpaper_alt_fg = xrdb.color12
if not is_dark_bg then
wallpaper_bg, wallpaper_fg = wallpaper_fg, wallpaper_bg
end
theme.wallpaper = theme_assets.wallpaper(
wallpaper_bg, wallpaper_fg, wallpaper_alt_wallpaper_fg
wallpaper_bg, wallpaper_fg, wallpaper_alt_fg
)
return theme