Advertisement
constantin-net

theme.gtk3.v082c.desktop

Jun 9th, 2023 (edited)
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.31 KB | None | 0 0
  1. -------------------------------------------
  2. -- GTK colors awesome theme v082c desktop --
  3. -------------------------------------------
  4.  
  5. local theme_assets = require("beautiful.theme_assets")
  6. local xresources = require("beautiful.xresources")
  7. local gears = require("gears")
  8. local awful = require("awful")
  9.  
  10. local dpi = xresources.apply_dpi
  11.  
  12. local gtk = require("beautiful.gtk")
  13.  
  14. local themes_path = config_dir .. "themes/gtk3"
  15. local theme_gtk = gtk.get_theme_variables()
  16. local theme = {}
  17.  
  18. local function shadecolor(col1, col2, adj)
  19.     r1 = tonumber(string.sub(col1,2,3),16)
  20.     g1 = tonumber(string.sub(col1,4,5),16)
  21.     b1 = tonumber(string.sub(col1,6,7),16)
  22.     r2 = tonumber(string.sub(col2,2,3),16)
  23.     g2 = tonumber(string.sub(col2,4,5),16)
  24.     b2 = tonumber(string.sub(col2,6,7),16)
  25.     shade_r = math.ceil((r1+r2)/adj) if shade_r > 255 then shade_r = 255 end
  26.     shade_g = math.ceil((g1+g2)/adj) if shade_g > 255 then shade_g = 255 end
  27.     shade_b = math.ceil((b1+b2)/adj) if shade_b > 255 then shade_b = 255 end
  28.     return "#" .. tostring(string.format("%x",shade_r))..tostring(string.format("%x",shade_g))..tostring(string.format("%x",shade_b))
  29. end
  30.  
  31. theme.base_size = math.ceil(theme_gtk.font_size)
  32. theme.gap_single_client  = true
  33.  
  34. -- font
  35. theme.font_name        = theme_gtk.font_family
  36. theme.font             = theme_gtk.font_family .. " " .. theme.base_size
  37. theme.notification_font = theme_gtk.font_family .. " " .. theme.base_size+4
  38.  
  39. -- geometry
  40. theme.systray_icon_spacing = dpi(10)
  41.  
  42. --theme.notification_shape    = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 6) end
  43.  
  44. theme.border_width         = 0 --dpi(theme_gtk.button_border_width)
  45. theme.radius               = dpi(theme_gtk.button_border_radius * 2 + 1)
  46. theme.notification_shape    = function(cr, width, height) gears.shape.partially_rounded_rect(cr, width, height, true, true, false, true, theme.radius-1 ) end
  47.  
  48. theme.menu_height          = dpi(theme.base_size + 14)
  49. theme.menu_width           = dpi(theme.base_size*14)
  50.  
  51. theme.useless_gap          = dpi(theme.menu_height+8)
  52.  
  53. -- Light/Dark test
  54. if tonumber(string.sub(theme_gtk.base_color, 2, 7),16) < 10000000 then -- dark theme
  55.     theme.fg_normal     = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2.9)
  56.     theme.fg_focus          = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2.1)
  57.     theme.titlebar_fg_focus = shadecolor(theme_gtk.button_fg_color,theme_gtk.wm_border_focused_color,2.1)
  58.     theme.menu_fg_focus = shadecolor(theme_gtk.bg_color,theme_gtk.wm_border_focused_color,4)
  59.     theme.border_focus  = shadecolor(theme_gtk.wm_border_focused_color,"#888888",2)
  60.     theme.taglist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,3)
  61.     theme.tasklist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,3)
  62.     theme.tasklist_shape_border_color_focus = shadecolor(theme_gtk.header_button_border_color,theme_gtk.wm_border_focused_color,3)
  63.  
  64.     theme.layout_fairh      = themes_path.."/layouts/fairhw.png"
  65.     theme.layout_fairv      = themes_path.."/layouts/fairvw.png"
  66.     theme.layout_floating    = themes_path.."/layouts/floatingw.png"
  67.     theme.layout_magnifier   = themes_path.."/layouts/magnifierw.png"
  68.     theme.layout_max        = themes_path.."/layouts/maxw.png"
  69.     theme.layout_fullscreen = themes_path.."/layouts/fullscreenw.png"
  70.     theme.layout_tilebottom = themes_path.."/layouts/tilebottomw.png"
  71.     theme.layout_tileleft   = themes_path.."/layouts/tileleftw.png"
  72.     theme.layout_tile       = themes_path.."/layouts/tilew.png"
  73.     theme.layout_tiletop    = themes_path.."/layouts/tiletopw.png"
  74.     theme.layout_spiral     = themes_path.."/layouts/spiralw.png"
  75.     theme.layout_dwindle    = themes_path.."/layouts/dwindlew.png"
  76.     theme.layout_cornernw   = themes_path.."/layouts/cornernww.png"
  77.     theme.layout_cornerne   = themes_path.."/layouts/cornernew.png"
  78.     theme.layout_cornersw   = themes_path.."/layouts/cornersww.png"
  79.     theme.layout_cornerse   = themes_path.."/layouts/cornersew.png"
  80.    
  81.     theme.titlebar_ontop_button_normal_inactive = themes_path.."/titlebar2/ontop_normal_inactive.png"
  82.     theme.titlebar_ontop_button_focus_inactive  = themes_path.."/titlebar2/ontop_focus_inactive.png"
  83.     theme.titlebar_ontop_button_normal_active = themes_path.."/titlebar2/ontop_normal_active.png"
  84.     theme.titlebar_ontop_button_focus_active  = themes_path.."/titlebar2/ontop_focus_active.png"
  85.    
  86.     theme.titlebar_floating_button_normal_inactive = themes_path.."/titlebar2/floating_normal_inactive.png"
  87.     theme.titlebar_floating_button_focus_inactive  = themes_path.."/titlebar2/floating_focus_inactive.png"
  88.     theme.titlebar_floating_button_normal_active = themes_path.."/titlebar2/floating_normal_active.png"
  89.     theme.titlebar_floating_button_focus_active  = themes_path.."/titlebar2/floating_focus_active.png"
  90.    
  91.     theme.titlebar_sticky_button_normal_inactive = themes_path.."/titlebar2/sticky_normal_inactive.png"
  92.     theme.titlebar_sticky_button_focus_inactive  = themes_path.."/titlebar2/sticky_focus_inactive.png"
  93.     theme.titlebar_sticky_button_normal_active = themes_path.."/titlebar2/sticky_normal_active.png"
  94.     theme.titlebar_sticky_button_focus_active  = themes_path.."/titlebar2/sticky_focus_active.png"
  95.  
  96.     theme.titlebar_maximized_button_normal_inactive = themes_path.."/titlebar2/maximized_normal_inactive.png"
  97.     theme.titlebar_maximized_button_focus_inactive  = themes_path.."/titlebar2/maximized_focus_inactive.png"
  98.     theme.titlebar_maximized_button_normal_active = themes_path.."/titlebar2/maximized_normal_active.png"
  99.     theme.titlebar_maximized_button_focus_active  = themes_path.."/titlebar2/maximized_focus_active.png"
  100.    
  101.     theme.titlebar_minimize_button_normal = themes_path.."/titlebar2/minimize_normal.png"
  102.     theme.titlebar_minimize_button_focus  = themes_path.."/titlebar2/minimize_focus.png"
  103.    
  104.     theme.titlebar_close_button_normal = themes_path.."/titlebar/close_normal.png"
  105.     theme.titlebar_close_button_focus  = themes_path.."/titlebar/close_focus.png"
  106.     theme.awesome_icon = theme_assets.awesome_icon(
  107.         theme.menu_height, theme_gtk.header_button_bg_color, theme.border_focus
  108.     )
  109.     theme.awesome_icon_hover = theme_assets.awesome_icon(
  110.         theme.menu_height, theme.bg_focus, theme.border_focus
  111.     )
  112.  
  113. else
  114.     theme.fg_focus          = shadecolor(theme_gtk.button_fg_color,theme_gtk.wm_border_focused_color,1)
  115.     theme.titlebar_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
  116.     theme.menu_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,1)
  117.     theme.border_focus  = shadecolor(theme_gtk.wm_border_focused_color,"#111111",2)
  118.     theme.taglist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
  119.     theme.fg_normal     = shadecolor(theme_gtk.fg_color,theme_gtk.wm_border_focused_color,2)
  120.     theme.tasklist_fg_focus = shadecolor(theme_gtk.header_button_fg_color,theme_gtk.wm_border_focused_color,2)
  121.     theme.tasklist_shape_border_color_focus = shadecolor(theme_gtk.header_button_border_color,theme_gtk.wm_border_focused_color,2)
  122.  
  123.     theme.layout_fairh      = themes_path.."/layouts/fairh.png"
  124.     theme.layout_fairv      = themes_path.."/layouts/fairv.png"
  125.     theme.layout_floating    = themes_path.."/layouts/floating.png"
  126.     theme.layout_magnifier   = themes_path.."/layouts/magnifier.png"
  127.     theme.layout_max        = themes_path.."/layouts/max.png"
  128.     theme.layout_fullscreen = themes_path.."/layouts/fullscreen.png"
  129.     theme.layout_tilebottom = themes_path.."/layouts/tilebottom.png"
  130.     theme.layout_tileleft   = themes_path.."/layouts/tileleft.png"
  131.     theme.layout_tile       = themes_path.."/layouts/tile.png"
  132.     theme.layout_tiletop    = themes_path.."/layouts/tiletop.png"
  133.     theme.layout_spiral     = themes_path.."/layouts/spiral.png"
  134.     theme.layout_dwindle    = themes_path.."/layouts/dwindle.png"
  135.     theme.layout_cornernw   = themes_path.."/layouts/cornernw.png"
  136.     theme.layout_cornerne   = themes_path.."/layouts/cornerne.png"
  137.     theme.layout_cornersw   = themes_path.."/layouts/cornersw.png"
  138.     theme.layout_cornerse   = themes_path.."/layouts/cornerse.png"
  139.    
  140.     theme.titlebar_ontop_button_normal_inactive = themes_path.."/titlebar2/ontop_focus_inactive.png"
  141.     theme.titlebar_ontop_button_focus_inactive  = themes_path.."/titlebar2/ontop_normal_inactive.png"
  142.     theme.titlebar_ontop_button_normal_active = themes_path.."/titlebar2/ontop_focus_active.png"
  143.     theme.titlebar_ontop_button_focus_active  = themes_path.."/titlebar2/ontop_normal_active.png"
  144.    
  145.     theme.titlebar_floating_button_normal_inactive = themes_path.."/titlebar2/floating_focus_inactive.png"
  146.     theme.titlebar_floating_button_focus_inactive  = themes_path.."/titlebar2/floating_normal_inactive.png"
  147.     theme.titlebar_floating_button_normal_active = themes_path.."/titlebar2/floating_focus_active.png"
  148.     theme.titlebar_floating_button_focus_active  = themes_path.."/titlebar2/floating_normal_active.png"
  149.    
  150.     theme.titlebar_sticky_button_normal_inactive = themes_path.."/titlebar2/sticky_focus_inactive.png"
  151.     theme.titlebar_sticky_button_focus_inactive  = themes_path.."/titlebar2/sticky_normal_inactive.png"
  152.     theme.titlebar_sticky_button_normal_active = themes_path.."/titlebar2/sticky_focus_active.png"
  153.     theme.titlebar_sticky_button_focus_active  = themes_path.."/titlebar2/sticky_normal_active.png"
  154.  
  155.     theme.titlebar_maximized_button_normal_inactive = themes_path.."/titlebar2/maximized_focus_inactive.png"
  156.     theme.titlebar_maximized_button_focus_inactive  = themes_path.."/titlebar2/maximized_normal_inactive.png"
  157.     theme.titlebar_maximized_button_normal_active = themes_path.."/titlebar2/maximized_focus_active.png"
  158.     theme.titlebar_maximized_button_focus_active  = themes_path.."/titlebar2/maximized_normal_active.png"
  159.  
  160.     theme.titlebar_minimize_button_normal = themes_path.."/titlebar2/minimize_focus.png"
  161.     theme.titlebar_minimize_button_focus  = themes_path.."/titlebar2/minimize_normal.png"
  162.    
  163.     theme.titlebar_close_button_normal = themes_path.."/titlebar/close_focus.png"
  164.     theme.titlebar_close_button_focus  = themes_path.."/titlebar/close_normal.png"
  165.  
  166.     theme.awesome_icon = theme_assets.awesome_icon(
  167.         theme.menu_height, theme.border_focus, theme_gtk.header_button_bg_color
  168.     )
  169.     theme.awesome_icon_hover = theme_assets.awesome_icon(
  170.         theme.menu_height, theme.border_focus, theme.bg_focus
  171.     )
  172. end
  173.  
  174. theme.bg_normal     = theme_gtk.base_color
  175. theme.bg_focus      = theme_gtk.button_bg_color
  176. theme.bg_urgent     = theme_gtk.warning_bg_color
  177. theme.bg_minimize   = theme_gtk.base_color
  178. theme.bg_systray    = theme.bg_normal
  179.  
  180. theme.fg_urgent     = theme_gtk.warning_fg_color
  181. theme.fg_minimize   = theme.fg_color
  182.  
  183. theme.titlebar_bg_focus = string.sub(theme_gtk.header_button_bg_color,1,7)
  184.  
  185. theme.border_normal = theme_gtk.wm_border_unfocused_color
  186. theme.border_marked = theme_gtk.osd_border_color
  187.  
  188. theme.taglist_bg_focus = theme.bg_normal --theme_gtk.header_button_bg_color
  189. theme.taglist_bg_urgent = theme.taglist_bg_focus -- common urgent bg
  190.  
  191. theme.tooltip_bg_color = theme_gtk.tooltip_bg_color
  192. theme.tooltip_fg_color = theme_gtk.tooltip_fg_color
  193.  
  194. theme.tasklist_bg_focus = theme_gtk.header_button_bg_color
  195. theme.tasklist_shape_border_color = theme_gtk.header_button_bg_color
  196.  
  197. theme.notification_bg = theme_gtk.osd_bg_color
  198. theme.notification_fg = theme_gtk.osd_fg_color
  199. theme.notification_border_color = theme_gtk.osd_border_color
  200.  
  201. theme.menu_bg_focus = theme.border_focus
  202.  
  203. -- Generate taglist squares:
  204. --local taglist_square_size = dpi(25)
  205. --theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
  206. --    taglist_square_size, theme.border_normal
  207. --)
  208. --theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
  209. --    taglist_square_size, theme.fg_normal
  210. --)
  211.  
  212. -- Define the image to load
  213. theme.menu_submenu_icon = themes_path.."/submenu.png"
  214.  
  215. --theme.wallpaper = themes_path.."/background.jpg"
  216. theme.wallpaper = function(screen)
  217.    local wallpaper = config_dir .. "/wallpapers/" .. tostring(screen.index)
  218.    gears.wallpaper.maximized(wallpaper, screen, false)
  219. end
  220.  
  221. theme.icon_theme = "Moblin"
  222.  
  223. return theme
  224.  
  225. -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
  226.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement