Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------
- -- GTK colors awesome theme v082c desktop --
- -------------------------------------------
- local theme_assets = require("beautiful.theme_assets")
- local xresources = require("beautiful.xresources")
- local gears = require("gears")
- local awful = require("awful")
- local dpi = xresources.apply_dpi
- local gtk = require("beautiful.gtk")
- local themes_path = config_dir .. "themes/gtk3"
- local theme_gtk = gtk.get_theme_variables()
- local theme = {}
- local function shadecolor(col1, col2, adj)
- r1 = tonumber(string.sub(col1,2,3),16)
- g1 = tonumber(string.sub(col1,4,5),16)
- b1 = tonumber(string.sub(col1,6,7),16)
- r2 = tonumber(string.sub(col2,2,3),16)
- g2 = tonumber(string.sub(col2,4,5),16)
- b2 = tonumber(string.sub(col2,6,7),16)
- shade_r = math.ceil((r1+r2)/adj) if shade_r > 255 then shade_r = 255 end
- shade_g = math.ceil((g1+g2)/adj) if shade_g > 255 then shade_g = 255 end
- shade_b = math.ceil((b1+b2)/adj) if shade_b > 255 then shade_b = 255 end
- return "#" .. tostring(string.format("%x",shade_r))..tostring(string.format("%x",shade_g))..tostring(string.format("%x",shade_b))
- end
- theme.base_size = math.ceil(theme_gtk.font_size)
- theme.gap_single_client = true
- -- font
- theme.font_name = theme_gtk.font_family
- theme.font = theme_gtk.font_family .. " " .. theme.base_size
- theme.notification_font = theme_gtk.font_family .. " " .. theme.base_size+4
- -- geometry
- theme.systray_icon_spacing = dpi(10)
- --theme.notification_shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 6) end
- theme.border_width = 0 --dpi(theme_gtk.button_border_width)
- theme.radius = dpi(theme_gtk.button_border_radius * 2 + 1)
- theme.notification_shape = function(cr, width, height) gears.shape.partially_rounded_rect(cr, width, height, true, true, false, true, theme.radius-1 ) end
- theme.menu_height = dpi(theme.base_size + 14)
- theme.menu_width = dpi(theme.base_size*14)
- theme.useless_gap = dpi(theme.menu_height+8)
- -- Light/Dark test
- if tonumber(string.sub(theme_gtk.base_color, 2, 7),16) < 10000000 then -- dark theme
- theme.fg_normal = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2.9)
- theme.fg_focus = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2.1)
- theme.titlebar_fg_focus = shadecolor(theme_gtk.button_fg_color,theme_gtk.wm_border_focused_color,2.1)
- theme.menu_fg_focus = shadecolor(theme_gtk.bg_color,theme_gtk.wm_border_focused_color,4)
- theme.border_focus = shadecolor(theme_gtk.wm_border_focused_color,"#888888",2)
- theme.taglist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,3)
- theme.tasklist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,3)
- theme.tasklist_shape_border_color_focus = shadecolor(theme_gtk.header_button_border_color,theme_gtk.wm_border_focused_color,3)
- theme.layout_fairh = themes_path.."/layouts/fairhw.png"
- theme.layout_fairv = themes_path.."/layouts/fairvw.png"
- theme.layout_floating = themes_path.."/layouts/floatingw.png"
- theme.layout_magnifier = themes_path.."/layouts/magnifierw.png"
- theme.layout_max = themes_path.."/layouts/maxw.png"
- theme.layout_fullscreen = themes_path.."/layouts/fullscreenw.png"
- theme.layout_tilebottom = themes_path.."/layouts/tilebottomw.png"
- theme.layout_tileleft = themes_path.."/layouts/tileleftw.png"
- theme.layout_tile = themes_path.."/layouts/tilew.png"
- theme.layout_tiletop = themes_path.."/layouts/tiletopw.png"
- theme.layout_spiral = themes_path.."/layouts/spiralw.png"
- theme.layout_dwindle = themes_path.."/layouts/dwindlew.png"
- theme.layout_cornernw = themes_path.."/layouts/cornernww.png"
- theme.layout_cornerne = themes_path.."/layouts/cornernew.png"
- theme.layout_cornersw = themes_path.."/layouts/cornersww.png"
- theme.layout_cornerse = themes_path.."/layouts/cornersew.png"
- theme.titlebar_ontop_button_normal_inactive = themes_path.."/titlebar2/ontop_normal_inactive.png"
- theme.titlebar_ontop_button_focus_inactive = themes_path.."/titlebar2/ontop_focus_inactive.png"
- theme.titlebar_ontop_button_normal_active = themes_path.."/titlebar2/ontop_normal_active.png"
- theme.titlebar_ontop_button_focus_active = themes_path.."/titlebar2/ontop_focus_active.png"
- theme.titlebar_floating_button_normal_inactive = themes_path.."/titlebar2/floating_normal_inactive.png"
- theme.titlebar_floating_button_focus_inactive = themes_path.."/titlebar2/floating_focus_inactive.png"
- theme.titlebar_floating_button_normal_active = themes_path.."/titlebar2/floating_normal_active.png"
- theme.titlebar_floating_button_focus_active = themes_path.."/titlebar2/floating_focus_active.png"
- theme.titlebar_sticky_button_normal_inactive = themes_path.."/titlebar2/sticky_normal_inactive.png"
- theme.titlebar_sticky_button_focus_inactive = themes_path.."/titlebar2/sticky_focus_inactive.png"
- theme.titlebar_sticky_button_normal_active = themes_path.."/titlebar2/sticky_normal_active.png"
- theme.titlebar_sticky_button_focus_active = themes_path.."/titlebar2/sticky_focus_active.png"
- theme.titlebar_maximized_button_normal_inactive = themes_path.."/titlebar2/maximized_normal_inactive.png"
- theme.titlebar_maximized_button_focus_inactive = themes_path.."/titlebar2/maximized_focus_inactive.png"
- theme.titlebar_maximized_button_normal_active = themes_path.."/titlebar2/maximized_normal_active.png"
- theme.titlebar_maximized_button_focus_active = themes_path.."/titlebar2/maximized_focus_active.png"
- theme.titlebar_minimize_button_normal = themes_path.."/titlebar2/minimize_normal.png"
- theme.titlebar_minimize_button_focus = themes_path.."/titlebar2/minimize_focus.png"
- theme.titlebar_close_button_normal = themes_path.."/titlebar/close_normal.png"
- theme.titlebar_close_button_focus = themes_path.."/titlebar/close_focus.png"
- theme.awesome_icon = theme_assets.awesome_icon(
- theme.menu_height, theme_gtk.header_button_bg_color, theme.border_focus
- )
- theme.awesome_icon_hover = theme_assets.awesome_icon(
- theme.menu_height, theme.bg_focus, theme.border_focus
- )
- else
- theme.fg_focus = shadecolor(theme_gtk.button_fg_color,theme_gtk.wm_border_focused_color,1)
- theme.titlebar_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
- theme.menu_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,1)
- theme.border_focus = shadecolor(theme_gtk.wm_border_focused_color,"#111111",2)
- theme.taglist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
- theme.fg_normal = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2)
- theme.tasklist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
- theme.tasklist_shape_border_color_focus = shadecolor(theme_gtk.header_button_border_color,theme_gtk.wm_border_focused_color,2)
- theme.layout_fairh = themes_path.."/layouts/fairh.png"
- theme.layout_fairv = themes_path.."/layouts/fairv.png"
- theme.layout_floating = themes_path.."/layouts/floating.png"
- theme.layout_magnifier = themes_path.."/layouts/magnifier.png"
- theme.layout_max = themes_path.."/layouts/max.png"
- theme.layout_fullscreen = themes_path.."/layouts/fullscreen.png"
- theme.layout_tilebottom = themes_path.."/layouts/tilebottom.png"
- theme.layout_tileleft = themes_path.."/layouts/tileleft.png"
- theme.layout_tile = themes_path.."/layouts/tile.png"
- theme.layout_tiletop = themes_path.."/layouts/tiletop.png"
- theme.layout_spiral = themes_path.."/layouts/spiral.png"
- theme.layout_dwindle = themes_path.."/layouts/dwindle.png"
- theme.layout_cornernw = themes_path.."/layouts/cornernw.png"
- theme.layout_cornerne = themes_path.."/layouts/cornerne.png"
- theme.layout_cornersw = themes_path.."/layouts/cornersw.png"
- theme.layout_cornerse = themes_path.."/layouts/cornerse.png"
- theme.titlebar_ontop_button_normal_inactive = themes_path.."/titlebar2/ontop_focus_inactive.png"
- theme.titlebar_ontop_button_focus_inactive = themes_path.."/titlebar2/ontop_normal_inactive.png"
- theme.titlebar_ontop_button_normal_active = themes_path.."/titlebar2/ontop_focus_active.png"
- theme.titlebar_ontop_button_focus_active = themes_path.."/titlebar2/ontop_normal_active.png"
- theme.titlebar_floating_button_normal_inactive = themes_path.."/titlebar2/floating_focus_inactive.png"
- theme.titlebar_floating_button_focus_inactive = themes_path.."/titlebar2/floating_normal_inactive.png"
- theme.titlebar_floating_button_normal_active = themes_path.."/titlebar2/floating_focus_active.png"
- theme.titlebar_floating_button_focus_active = themes_path.."/titlebar2/floating_normal_active.png"
- theme.titlebar_sticky_button_normal_inactive = themes_path.."/titlebar2/sticky_focus_inactive.png"
- theme.titlebar_sticky_button_focus_inactive = themes_path.."/titlebar2/sticky_normal_inactive.png"
- theme.titlebar_sticky_button_normal_active = themes_path.."/titlebar2/sticky_focus_active.png"
- theme.titlebar_sticky_button_focus_active = themes_path.."/titlebar2/sticky_normal_active.png"
- theme.titlebar_maximized_button_normal_inactive = themes_path.."/titlebar2/maximized_focus_inactive.png"
- theme.titlebar_maximized_button_focus_inactive = themes_path.."/titlebar2/maximized_normal_inactive.png"
- theme.titlebar_maximized_button_normal_active = themes_path.."/titlebar2/maximized_focus_active.png"
- theme.titlebar_maximized_button_focus_active = themes_path.."/titlebar2/maximized_normal_active.png"
- theme.titlebar_minimize_button_normal = themes_path.."/titlebar2/minimize_focus.png"
- theme.titlebar_minimize_button_focus = themes_path.."/titlebar2/minimize_normal.png"
- theme.titlebar_close_button_normal = themes_path.."/titlebar/close_focus.png"
- theme.titlebar_close_button_focus = themes_path.."/titlebar/close_normal.png"
- theme.awesome_icon = theme_assets.awesome_icon(
- theme.menu_height, theme.border_focus, theme_gtk.header_button_bg_color
- )
- theme.awesome_icon_hover = theme_assets.awesome_icon(
- theme.menu_height, theme.border_focus, theme.bg_focus
- )
- end
- theme.bg_normal = theme_gtk.base_color
- theme.bg_focus = theme_gtk.button_bg_color
- theme.bg_urgent = theme_gtk.warning_bg_color
- theme.bg_minimize = theme_gtk.base_color
- theme.bg_systray = theme.bg_normal
- theme.fg_urgent = theme_gtk.warning_fg_color
- theme.fg_minimize = theme.fg_color
- theme.titlebar_bg_focus = string.sub(theme_gtk.header_button_bg_color,1,7)
- theme.border_normal = theme_gtk.wm_border_unfocused_color
- theme.border_marked = theme_gtk.osd_border_color
- theme.taglist_bg_focus = theme.bg_normal --theme_gtk.header_button_bg_color
- theme.taglist_bg_urgent = theme.taglist_bg_focus -- common urgent bg
- theme.tooltip_bg_color = theme_gtk.tooltip_bg_color
- theme.tooltip_fg_color = theme_gtk.tooltip_fg_color
- theme.tasklist_bg_focus = theme_gtk.header_button_bg_color
- theme.tasklist_shape_border_color = theme_gtk.header_button_bg_color
- theme.notification_bg = theme_gtk.osd_bg_color
- theme.notification_fg = theme_gtk.osd_fg_color
- theme.notification_border_color = theme_gtk.osd_border_color
- theme.menu_bg_focus = theme.border_focus
- -- Generate taglist squares:
- --local taglist_square_size = dpi(25)
- --theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
- -- taglist_square_size, theme.border_normal
- --)
- --theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
- -- taglist_square_size, theme.fg_normal
- --)
- -- Define the image to load
- theme.menu_submenu_icon = themes_path.."/submenu.png"
- --theme.wallpaper = themes_path.."/background.jpg"
- theme.wallpaper = function(screen)
- local wallpaper = config_dir .. "/wallpapers/" .. tostring(screen.index)
- gears.wallpaper.maximized(wallpaper, screen, false)
- end
- theme.icon_theme = "Moblin"
- return theme
- -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement