You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
364 lines
12 KiB
364 lines
12 KiB
local theme_assets = require("beautiful.theme_assets")
|
|
local xresources = require("beautiful.xresources")
|
|
local dpi = xresources.apply_dpi
|
|
local gears = require("gears")
|
|
|
|
local gfs = require("gears.filesystem")
|
|
local themes_path = gfs.get_themes_dir()
|
|
|
|
local theme = {}
|
|
|
|
theme.font = "Liberation Sans 8"
|
|
|
|
theme.bg_normal = "#c0c0c0"
|
|
theme.bg_focus = "#808080"
|
|
theme.bg_urgent = "#FFEDCC"
|
|
theme.bg_minimize = "#dfdfdf"
|
|
theme.bg_highlight_shadow = "#000000FF"
|
|
theme.bg_highlight_light = "#FFFFFFFF"
|
|
theme.bg_highlight_outline = "#808080FF"
|
|
theme.bg_systray = theme.bg_normal
|
|
|
|
theme.fg_normal = "#000000"
|
|
theme.fg_focus = "#000000"
|
|
theme.fg_urgent = "#000000"
|
|
theme.fg_minimize = "#000000"
|
|
|
|
theme.useless_gap = dpi(0)
|
|
-- technically speaking these are irrelevant since they're not exactly smart
|
|
-- borders
|
|
theme.border_width = dpi(0)
|
|
theme.border_normal = "#c0c0c0"
|
|
theme.border_focus = "#c0c0c0"
|
|
theme.border_marked = "#c0c0c0"
|
|
|
|
theme.titlebar_bg_focus = {
|
|
type = "linear",
|
|
from = { 0, 0 },
|
|
to = { 640, 0 },
|
|
stops = { {0, "#040582"}, {1, "#0F7FCD"} }
|
|
}
|
|
|
|
theme.titlebar_bg_normal = {
|
|
type = "linear",
|
|
from = { 0, 0 },
|
|
to = { 640, 0 },
|
|
stops = { {0, "#828282"}, {1, "#AFAFAF"} }
|
|
}
|
|
local taglist_square_size = dpi(4)
|
|
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
|
|
taglist_square_size, theme.fg_normal
|
|
)
|
|
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
|
|
taglist_square_size, theme.fg_normal
|
|
)
|
|
theme.menu_submenu_icon = themes_path.."default/submenu.png"
|
|
theme.menu_height = dpi(15)
|
|
theme.menu_width = dpi(100)
|
|
|
|
-- Define the image to load
|
|
theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png"
|
|
theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png"
|
|
|
|
theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png"
|
|
theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png"
|
|
|
|
theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png"
|
|
theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png"
|
|
theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png"
|
|
theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png"
|
|
|
|
theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png"
|
|
theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png"
|
|
theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png"
|
|
theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png"
|
|
|
|
theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png"
|
|
theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png"
|
|
theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png"
|
|
theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png"
|
|
|
|
theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png"
|
|
theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png"
|
|
theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png"
|
|
theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png"
|
|
|
|
theme.wallpaper = themes_path.."default/background.png"
|
|
|
|
-- You can use your own layout icons like this:
|
|
theme.layout_fairh = themes_path.."default/layouts/fairhw.png"
|
|
theme.layout_fairv = themes_path.."default/layouts/fairvw.png"
|
|
theme.layout_floating = themes_path.."default/layouts/floatingw.png"
|
|
theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png"
|
|
theme.layout_max = themes_path.."default/layouts/maxw.png"
|
|
theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png"
|
|
theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png"
|
|
theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png"
|
|
theme.layout_tile = themes_path.."default/layouts/tilew.png"
|
|
theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png"
|
|
theme.layout_spiral = themes_path.."default/layouts/spiralw.png"
|
|
theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png"
|
|
theme.layout_cornernw = themes_path.."default/layouts/cornernww.png"
|
|
theme.layout_cornerne = themes_path.."default/layouts/cornernew.png"
|
|
theme.layout_cornersw = themes_path.."default/layouts/cornersww.png"
|
|
theme.layout_cornerse = themes_path.."default/layouts/cornersew.png"
|
|
|
|
-- Generate Awesome icon:
|
|
theme.awesome_icon = theme_assets.awesome_icon(
|
|
theme.menu_height, theme.bg_focus, theme.fg_focus
|
|
)
|
|
|
|
theme.bgimage_outset = function(context, cr, width, height,...)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
-- Background
|
|
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(0,0)
|
|
cr:line_to(width,0)
|
|
cr:move_to(0,0)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
|
|
-- Outline
|
|
cr:set_source(outline)
|
|
cr:move_to(width-1,height-1)
|
|
cr:line_to(width-1,1)
|
|
cr:move_to(width-2,height-1)
|
|
cr:line_to(1,height-1)
|
|
cr:stroke()
|
|
|
|
-- Shadow
|
|
cr:set_source(shadow)
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:move_to(width-1,height)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
end
|
|
|
|
theme.bgimage_inset = function(context,cr,width,height)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:move_to(width,height)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
|
|
-- Shadow
|
|
cr:set_source(shadow)
|
|
cr.line_width=2
|
|
cr:move_to(0,0)
|
|
cr:line_to(0,height)
|
|
cr:move_to(0,0)
|
|
cr:line_to(width,0)
|
|
cr:stroke()
|
|
end
|
|
|
|
theme.bgimage_highlight = function(context,cr,width,height)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(1,1)
|
|
cr:line_to(1,height-2)
|
|
cr:move_to(1,1)
|
|
cr:line_to(width-2,1)
|
|
cr:stroke()
|
|
|
|
-- Outline
|
|
cr:set_source(outline)
|
|
cr.line_width=2
|
|
cr:rectangle(0,0,width-1,height-1)
|
|
cr:stroke()
|
|
|
|
-- Light (bottom)
|
|
cr:set_source(light)
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:move_to(width,height)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
end
|
|
|
|
-- A complex piece of "code" to simulate borders.
|
|
theme.titlebar_bgimage_top = function(context, cr, width, height,...)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
cr.line_width = 2
|
|
cr:set_source(gears.color(theme.bg_normal))
|
|
cr:rectangle(2,2,width-5,height-3)
|
|
cr:stroke()
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(0,0)
|
|
cr:line_to(width,0)
|
|
cr:move_to(0,0)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
|
|
-- Outline
|
|
cr:set_source(outline)
|
|
cr:move_to(width-1,height)
|
|
cr:line_to(width-1,1)
|
|
cr:stroke()
|
|
|
|
-- Shadow
|
|
cr:set_source(shadow)
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:stroke()
|
|
end
|
|
theme.titlebar_bgimage_bottom = function(context, cr, width, height, ...)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
-- Background
|
|
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(0,0)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
|
|
-- Outline
|
|
cr:set_source(outline)
|
|
cr:move_to(width-1,height-1)
|
|
cr:line_to(width-1,0)
|
|
cr:move_to(width-2,height-1)
|
|
cr:line_to(1,height-1)
|
|
cr:stroke()
|
|
|
|
-- Shadow
|
|
cr:set_source(shadow)
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:move_to(width-1,height)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
|
|
end
|
|
theme.titlebar_bgimage_left = function(context, cr, width, height,...)
|
|
local light = gears.color(theme.bg_highlight_light)
|
|
-- Light
|
|
cr:set_source(light)
|
|
cr.line_width=2
|
|
cr:move_to(0,0)
|
|
cr:line_to(0,height)
|
|
cr:stroke()
|
|
end
|
|
theme.titlebar_bgimage_right = function(context, cr, width, height,...)
|
|
local shadow = gears.color(theme.bg_highlight_shadow)
|
|
local outline = gears.color(theme.bg_highlight_outline)
|
|
cr.line_width=2
|
|
|
|
-- Outline
|
|
cr:set_source(outline)
|
|
cr:move_to(width-1,height)
|
|
cr:line_to(width-1,0)
|
|
cr:stroke()
|
|
|
|
-- Shadow
|
|
cr:set_source(shadow)
|
|
cr:move_to(width,height)
|
|
cr:line_to(width,0)
|
|
cr:stroke()
|
|
end
|
|
|
|
---theme.bgimage_outset
|
|
-- 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
|
|
|
|
theme.widgets = {
|
|
default = {
|
|
container = {
|
|
bgimage = theme.bgimage_highlight,
|
|
shape = function(cr,width,height)
|
|
return require("gears").shape.rounded_rect(cr,width,height,0)
|
|
end
|
|
},
|
|
button = {
|
|
bgimage = theme.bgimage_outset,
|
|
shape = function(cr,width,height)
|
|
return require("gears").shape.rounded_rect(cr,width,height,0)
|
|
end,
|
|
onpress = function(widget)
|
|
widget:set_bg(theme.bg_focus)
|
|
widget:set_bgimage(theme.bgimage_inset)
|
|
end,
|
|
onrelease = function(widget)
|
|
widget:set_bg(theme.bg_normal)
|
|
widget:set_bgimage(theme.bgimage_outset)
|
|
end
|
|
},
|
|
popup = {
|
|
bgimage = theme.bgimage_outset,
|
|
shape = function(cr,width,height)
|
|
return gears.shape.rounded_rect(cr,width,height,0)
|
|
end,
|
|
},
|
|
titlebar = {
|
|
bgimage = theme.bgimage_outset,
|
|
margins = 4,
|
|
left = 5,
|
|
right = 5
|
|
}
|
|
},
|
|
dismal = {
|
|
container = {
|
|
bg = theme.bg_focus
|
|
},
|
|
button = {
|
|
height = 34
|
|
}
|
|
},
|
|
titlebar = {
|
|
titlebar_top = {
|
|
bgimage_normal = theme.titlebar_bgimage_top,
|
|
bgimage_focus = theme.titlebar_bgimage_top,
|
|
bg_focus = theme.titlebar_bg_focus,
|
|
bg_normal = theme.titlebar_bg_normal,
|
|
fg_focus = "#FAFAFA",
|
|
fg_normal = theme.fg_normal,
|
|
size = 22
|
|
},
|
|
titlebar_left = {
|
|
bgimage_normal = theme.titlebar_bgimage_left,
|
|
bgimage_focus = theme.titlebar_bgimage_left,
|
|
size = 4,
|
|
bg_focus = theme.bg_normal
|
|
},
|
|
titlebar_right = {
|
|
bgimage_normal = theme.titlebar_bgimage_right,
|
|
bgimage_focus = theme.titlebar_bgimage_right,
|
|
size = 4,
|
|
bg_focus = theme.bg_normal
|
|
},
|
|
titlebar_bottom = {
|
|
bgimage_normal = theme.titlebar_bgimage_bottom,
|
|
bgimage_focus = theme.titlebar_bgimage_bottom,
|
|
size = 4,
|
|
bg_focus = theme.bg_normal
|
|
}
|
|
}
|
|
}
|
|
|
|
return theme
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|