diff --git a/libs/awmtk2.lua b/libs/awmtk2.lua index 9f13715..c04fc43 100644 --- a/libs/awmtk2.lua +++ b/libs/awmtk2.lua @@ -6,14 +6,17 @@ local beautiful = require("beautiful") local awmtk = {} -- {{{ Utils -awmtk.create_delta = function(name,instance_delta,class_delta,parent_delta) +awmtk.create_delta = function(name,instance_delta,class_delta,parent_delta) -- To save memory, we create proxies for lower layers called "deltas" -- This function creates that proxy layer using metatables - return setmetatable(instance_delta,{ + + -- Fun story - i used instance_delta instead of {} at first. + -- The results were horrifying and confusing. + return setmetatable({},{ __index = function(self,k) -- Per-instance overrides are top priority - if rawget(self,k) then - return rawget(self,k) + if rawget(instance_delta,k) then + return rawget(instance_delta,k) -- Class-wide overrides are second in priority elseif type(class_delta[name]) == "table" and rawget(class_delta[name],k) then @@ -29,11 +32,13 @@ end awmtk.create_style = function(name,parent,overrides) -- A style is essentially a layer of deltas upon the previous (parent) style local new_style = {} + local odelta = (overrides and overrides[name]) or {} + local cdelta = (beautiful.widgets and beautiful.widgets[name]) or {} for name,parent_class in pairs(parent) do new_style[name] = awmtk.create_delta( name, - (overrides and overrides[name]) or {}, - (beautiful.widgets and beautiful.widgets[style_name]) or {}, + odelta, + cdelta, parent_class ) end @@ -52,7 +57,7 @@ end awmtk.build_templates = function(templates,style) local new_templates = {} - for name,template in pairs(awmtk.templates) do + for name,template in pairs(awmtk.proto_templates) do new_templates[name] = templates[name](style) end return new_templates @@ -70,16 +75,25 @@ end -- {{{ Default style -- Default style -awmtk.default = { +awmtk.proto_style = { base = setmetatable({ -- { Backgrounds -- custom background color for highlighting elements bg_highlight = beautiful.bg_highlight or beautiful.bg_focus, + -- allow more complex themes to define background images + bgimage_focus = beautiful.bgimage_focus, + bgimage_normal = beautiful.bgimage_normal, -- } -- { Borders -- Borders for popups shape_border_width = beautiful.shape_border_width or 0, shape_border_color = beautiful.shape_border_color or beautiful.bg_normal, + -- { Callbacks + -- a tiny bit more complex thing to account for more extensibility + -- the stub functions do nothing - you should implement functionality inside theme + onpress = function() end, + onrelease = function() end, + -- } -- } -- { Shapes margins = 5, @@ -92,43 +106,50 @@ awmtk.default = { } -- Subclasses -awmtk.default.container = awmtk.create_delta("container",{ -},awmtk.default,awmtk.default.base) +awmtk.proto_style.container = awmtk.create_delta("container",{ +},awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.button = awmtk.create_delta("button",{ +awmtk.proto_style.button = awmtk.create_delta("button",{ margins = 3 -},awmtk.default,awmtk.default.base) +},awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.icon = awmtk.create_delta("icon",{ +awmtk.proto_style.icon = awmtk.create_delta("icon",{ margins = 1 -},awmtk.default,awmtk.default.base) +},awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.textbox = awmtk.create_delta("textbox",{ +awmtk.proto_style.textbox = awmtk.create_delta("textbox",{ font = beautiful.font or "sans 8" -}, awmtk.default,awmtk.default.base) +}, awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.separator = awmtk.create_delta("separator",{ +awmtk.proto_style.separator = awmtk.create_delta("separator",{ thickness = 1, color = beautiful.bg_focus, border_width = 0 -}, awmtk.default,awmtk.default.base) +}, awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.article = awmtk.create_delta("article", { +awmtk.proto_style.article = awmtk.create_delta("article", { icon_size = 16, - small_font = beautiful.font or "sans 8", + small_font = beautiful.small_font or beautiful.font, font_align = "left", small_font_align = "left" -}, awmtk.default,awmtk.default.base) +}, awmtk.proto_style,awmtk.proto_style.base) -awmtk.default.popup = awmtk.create_delta("popup", { -}, awmtk.default,awmtk.default.base) --- }}} +awmtk.proto_style.popup = awmtk.create_delta("popup", { +}, awmtk.proto_style,awmtk.proto_style.base) + +awmtk.proto_style.titlebar = awmtk.create_delta("titlebar", { + margins = 1 +}, awmtk.proto_style,awmtk.proto_style.base) +-- }}} -- {{{ Generic templates -awmtk.templates = { +awmtk.proto_templates = { -- Templates are built first using the given style, then applied to contents -- through returned function container = function(style) + -- Container is practically any "box" that contains buttons, textboxes, + -- and anything you want to put into the container. Do not confuse with + -- popup - containers are designed to separate contents within a popup. return function(layout,options) return awmtk.merge({ { @@ -136,6 +157,7 @@ awmtk.templates = { margins = (options and options.margins) or style.container.margins, widget = wibox.container.margin }, + bgimage = style.container.bgimage, bg = style.container.bg_normal, shape = style.container.shape, widget = wibox.container.background @@ -144,6 +166,9 @@ awmtk.templates = { end, button = function(style) + -- Self explanatory. Notice that this does not bear any function - + -- only the visual part of the button. By design, onpress and onrelease + -- callbacks should be connected to button events for animations return function(layout,options) return awmtk.merge({ { @@ -151,6 +176,7 @@ awmtk.templates = { margins = (options and options.margins) or style.button.margins, widget = wibox.container.margin }, + bgimage = style.button.bgimage, bg = style.button.bg_normal, shape = style.button.shape, widget = wibox.container.background @@ -158,8 +184,8 @@ awmtk.templates = { end end, - textbox = function(style) + -- Nothing fancy here, but you can set per-widget fonts using beautiful. return function(options) return awmtk.merge({ font = style.textbox.font, @@ -169,8 +195,9 @@ awmtk.templates = { end, hseparator = function(style) + -- Wow, i guess? return function(options) - awmtk.merge({ + return awmtk.merge({ widget = wibox.widget.separator, orientation = "horizontal", thickness = style.separator.thickness, @@ -181,8 +208,9 @@ awmtk.templates = { end, vseparator = function(style) + -- I'm running out of comments return function(options) - awmtk.merge({ + return awmtk.merge({ widget = wibox.widget.separator, orientation = "vertical", thickness = style.separator.thickness, @@ -192,9 +220,10 @@ awmtk.templates = { end end, - -- Article is a template that contains an icon, a headline and a - -- short description, side by side. Useful for menus and notifications. article = function(style) + -- Article is a template that combines 3 common pieces of a full item: + -- Icon, name and description. Designed to be placed within a container + -- or a button. return function(options) return awmtk.merge({ (options.icon and { @@ -237,30 +266,49 @@ awmtk.templates = { }, spacing = style.article.spacing, layout = wibox.layout.fixed.horizontal, - bg = style.article.bg_normal, - widget = wibox.container.background }, options or {}) end end, popup = function(style) + -- Popup is a distinct template designed to accomodate the "root" of + -- a popup, allowing one to add titlebars to popups, for example. return function(widget,options) return awmtk.merge({ widget = { - { - widget, - margins = (options and options.margins) or style.popup.margins, - widget = wibox.container.margin - }, - bg = style.popup.bg_normal, - widget = wibox.container.background + widget, + margins = (options and options.margins) or style.popup.margins, + widget = wibox.container.margin }, + bgimage = style.popup.bgimage, shape = style.popup.shape, visible = false, ontop = true },options or {}) end + end, + + titlebar = function(style) + -- Titlebar is a separate class specifically for window and popup + -- titlebars. The decision to make it a separate class was due to + -- the fact that much customization is done through default theme table + return function(layout,options) + return awmtk.merge({ + layout, + margins = (options and options.margins) or + style.titlebar.margins, + widget = wibox.container.margin, + left = style.titlebar.left, + right = style.titlebar.right, + bottom = style.titlebar.bottom, + top = style.titlebar.top + },options or {}) + end end } + +-- yes +awmtk.default = awmtk.create_style("default",awmtk.proto_style,{}) +awmtk.templates = awmtk.create_template_lib("templates",awmtk.proto_templates,{}) -- }}} return awmtk diff --git a/modules/base.lua b/modules/base.lua index a1986a5..44b7b52 100644 --- a/modules/base.lua +++ b/modules/base.lua @@ -4,14 +4,6 @@ local awful = require("awful") local beautiful = require("beautiful") local gears = require("gears") --- Global settings -global = {} -global.terminal = "xfce4-terminal" --Mod+Enter (spawn terminal) -global.browser = "prime-run librewolf" --Mod+Shift+Enter (spawn browser) -global.modkey = "Mod4" -- Default modifier key -global.theme = "default" -global.shell = "zsh" - awful.util.shell = global.shell --error handling if awesome.startup_errors then @@ -50,8 +42,6 @@ awful.rules.rules = { properties = { focus = awful.client.focus.filter, raise = true, - keys = clientkeys, - buttons = clientbuttons, screen = awful.screen.preferred, border_width = beautiful.border_width, border_color = beautiful.border_normal, diff --git a/modules/binds.lua b/modules/binds.lua index 3395dfe..eef7d27 100644 --- a/modules/binds.lua +++ b/modules/binds.lua @@ -44,6 +44,13 @@ local keys = gears.table.join( {description = "Open browser", group = "launcher"})) root.keys(keys) +local buttons = gears.table.join( + awful.button({}, 3, function() end), + awful.button({}, 4, awful.tag.viewnext), + awful.button({}, 5, awful.tag.viewprev) +) +root.buttons(buttons) + local clientkeys = gears.table.join( awful.key({global.modkey, "Shift"},"c", function(c) diff --git a/modules/desktop.lua b/modules/desktop.lua new file mode 100644 index 0000000..ae14613 --- /dev/null +++ b/modules/desktop.lua @@ -0,0 +1,108 @@ +local awmtk2 = require("awmtk2") +local gears = require("gears") +local wibox = require("wibox") +local awful = require("awful") +local beautiful = require("beautiful") + +-- {{{ Global widgets +local runmenu = require("widgets.dismal")({}) + +-- }}} + +-- {{{ Titlebars +local style = awmtk2.create_style("titlebar",awmtk2.default,{}) +style.titlebar_top = awmtk2.create_delta("titlebar_top", {}, + (beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar) +style.titlebar_left = awmtk2.create_delta("titlebar_left", {}, + (beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar) +style.titlebar_right = awmtk2.create_delta("titlebar_right", {}, + (beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar) +style.titlebar_bottom = awmtk2.create_delta("titlebar_bottom", {}, + (beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar) +local templates = awmtk2.create_template_lib("titlebar",awmtk2.templates,{}) +local t = awmtk2.build_templates(templates,style) +table.insert(awful.rules.rules, + { rule_any = {type = { "normal", "dialog" } + }, properties = { titlebars_enabled = true } + } +) +client.connect_signal("request::titlebars",function(c) + local buttons = gears.table.join( + awful.button({}, 1, function() + c:emit_signal("request::activate","titlebar",{raise=true}) + awful.mouse.client.move(c) + end), + awful.button({}, 3, function() + c:emit_signal("request::activate","titlebar",{raise=true}) + awful.mouse.client.resize(c) + end) + ) + + awful.titlebar(c,{ + size = style.titlebar_top.size or 16, + bg_normal = style.titlebar_top.bg_normal, + bg_focus = style.titlebar_top.bg_focus, + bgimage_normal = style.titlebar_top.bgimage_normal, + bgimage_focus = style.titlebar_top.bgimage_focus, + fg_normal = style.titlebar_top.fg_normal, + fg_focus = style.titlebar_top.fg_focus, + font = style.titlebar_top.font + }):setup(t.titlebar({ + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton (c), + awful.titlebar.widget.ontopbutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + })) + awful.titlebar(c,{ + size = style.titlebar_right.size or 0, + position = "right", + bg_normal = style.titlebar_right.bg_normal, + bg_focus = style.titlebar_right.bg_focus, + bgimage_normal = style.titlebar_right.bgimage_normal, + bgimage_focus = style.titlebar_right.bgimage_focus, + fg_normal = style.titlebar_right.fg_normal, + fg_focus = style.titlebar_right.fg_focus, + font = style.titlebar_right.font + }):setup(t.titlebar({widget = wibox.container.background})) + awful.titlebar(c,{ + size = style.titlebar_bottom.size or 0, + position = "bottom", + bg_normal = style.titlebar_bottom.bg_normal, + bg_focus = style.titlebar_bottom.bg_focus, + bgimage_normal = style.titlebar_bottom.bgimage_normal, + bgimage_focus = style.titlebar_bottom.bgimage_focus, + fg_normal = style.titlebar_bottom.fg_normal, + fg_focus = style.titlebar_bottom.fg_focus, + font = style.titlebar_bottom.font + }):setup(t.titlebar({widget = wibox.container.background})) + awful.titlebar(c,{ + size = style.titlebar_left.size or 0, + position = "left", + bg_normal = style.titlebar_left.bg_normal, + bg_focus = style.titlebar_left.bg_focus, + bgimage_normal = style.titlebar_left.bgimage_normal, + bgimage_focus = style.titlebar_left.bgimage_focus, + fg_normal = style.titlebar_left.fg_normal, + fg_focus = style.titlebar_left.fg_focus, + font = style.titlebar_left.font + }):setup(t.titlebar({widget = wibox.container.background})) +end) +--}}} diff --git a/modules/global.lua b/modules/global.lua new file mode 100644 index 0000000..b4d193a --- /dev/null +++ b/modules/global.lua @@ -0,0 +1,8 @@ +-- Global settings +global = {} +global.terminal = "xfce4-terminal" --Mod+Enter (spawn terminal) +global.browser = "prime-run librewolf" --Mod+Shift+Enter (spawn browser) +global.modkey = "Mod4" -- Default modifier key +global.theme = "reno98" +global.shell = "zsh" + diff --git a/modules/menu_test.lua b/modules/menu_test.lua deleted file mode 100644 index 29070e0..0000000 --- a/modules/menu_test.lua +++ /dev/null @@ -1,8 +0,0 @@ -local menu = require("widgets.dismal")({}) -local gears = require("gears") -local awful = require("awful") -root.buttons(gears.table.join( - awful.button({}, 3, function() end), - awful.button({}, 4, awful.tag.viewnext), - awful.button({}, 5, awful.tag.viewprev) -)) diff --git a/rc.lua b/rc.lua index 92a31ba..6315fc6 100644 --- a/rc.lua +++ b/rc.lua @@ -7,10 +7,11 @@ package.cpath = package.cpath ..";"..root_path.."/libs/?.so" -- Modules list +require("modules.global") require("modules.errorlog") require("modules.base") require("modules.binds") require("modules.xdg_data") require("modules.autostart") require("modules.static_tags") -require("modules.menu_test") +require("modules.desktop") diff --git a/themes/reno98/README b/themes/reno98/README new file mode 100644 index 0000000..1ddb349 --- /dev/null +++ b/themes/reno98/README @@ -0,0 +1,3 @@ +Background images: + Mikael Eriksson + Licensed under CC-BY-SA-3.0 diff --git a/themes/reno98/background.png b/themes/reno98/background.png new file mode 100644 index 0000000..8f52b6b Binary files /dev/null and b/themes/reno98/background.png differ diff --git a/themes/reno98/background_white.png b/themes/reno98/background_white.png new file mode 100644 index 0000000..bb0c5d0 Binary files /dev/null and b/themes/reno98/background_white.png differ diff --git a/themes/reno98/layouts/cornerne.png b/themes/reno98/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/themes/reno98/layouts/cornerne.png differ diff --git a/themes/reno98/layouts/cornernew.png b/themes/reno98/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/themes/reno98/layouts/cornernew.png differ diff --git a/themes/reno98/layouts/cornernw.png b/themes/reno98/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/themes/reno98/layouts/cornernw.png differ diff --git a/themes/reno98/layouts/cornernww.png b/themes/reno98/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/themes/reno98/layouts/cornernww.png differ diff --git a/themes/reno98/layouts/cornerse.png b/themes/reno98/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/themes/reno98/layouts/cornerse.png differ diff --git a/themes/reno98/layouts/cornersew.png b/themes/reno98/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/themes/reno98/layouts/cornersew.png differ diff --git a/themes/reno98/layouts/cornersw.png b/themes/reno98/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/themes/reno98/layouts/cornersw.png differ diff --git a/themes/reno98/layouts/cornersww.png b/themes/reno98/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/themes/reno98/layouts/cornersww.png differ diff --git a/themes/reno98/layouts/dwindle.png b/themes/reno98/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/themes/reno98/layouts/dwindle.png differ diff --git a/themes/reno98/layouts/dwindlew.png b/themes/reno98/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/themes/reno98/layouts/dwindlew.png differ diff --git a/themes/reno98/layouts/fairh.png b/themes/reno98/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/themes/reno98/layouts/fairh.png differ diff --git a/themes/reno98/layouts/fairhw.png b/themes/reno98/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/themes/reno98/layouts/fairhw.png differ diff --git a/themes/reno98/layouts/fairv.png b/themes/reno98/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/themes/reno98/layouts/fairv.png differ diff --git a/themes/reno98/layouts/fairvw.png b/themes/reno98/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/themes/reno98/layouts/fairvw.png differ diff --git a/themes/reno98/layouts/floating.png b/themes/reno98/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/themes/reno98/layouts/floating.png differ diff --git a/themes/reno98/layouts/floatingw.png b/themes/reno98/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/themes/reno98/layouts/floatingw.png differ diff --git a/themes/reno98/layouts/fullscreen.png b/themes/reno98/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/themes/reno98/layouts/fullscreen.png differ diff --git a/themes/reno98/layouts/fullscreenw.png b/themes/reno98/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/themes/reno98/layouts/fullscreenw.png differ diff --git a/themes/reno98/layouts/magnifier.png b/themes/reno98/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/themes/reno98/layouts/magnifier.png differ diff --git a/themes/reno98/layouts/magnifierw.png b/themes/reno98/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/themes/reno98/layouts/magnifierw.png differ diff --git a/themes/reno98/layouts/max.png b/themes/reno98/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/themes/reno98/layouts/max.png differ diff --git a/themes/reno98/layouts/maxw.png b/themes/reno98/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/themes/reno98/layouts/maxw.png differ diff --git a/themes/reno98/layouts/spiral.png b/themes/reno98/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/themes/reno98/layouts/spiral.png differ diff --git a/themes/reno98/layouts/spiralw.png b/themes/reno98/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/themes/reno98/layouts/spiralw.png differ diff --git a/themes/reno98/layouts/tile.png b/themes/reno98/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/themes/reno98/layouts/tile.png differ diff --git a/themes/reno98/layouts/tilebottom.png b/themes/reno98/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/themes/reno98/layouts/tilebottom.png differ diff --git a/themes/reno98/layouts/tilebottomw.png b/themes/reno98/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/themes/reno98/layouts/tilebottomw.png differ diff --git a/themes/reno98/layouts/tileleft.png b/themes/reno98/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/themes/reno98/layouts/tileleft.png differ diff --git a/themes/reno98/layouts/tileleftw.png b/themes/reno98/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/themes/reno98/layouts/tileleftw.png differ diff --git a/themes/reno98/layouts/tiletop.png b/themes/reno98/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/themes/reno98/layouts/tiletop.png differ diff --git a/themes/reno98/layouts/tiletopw.png b/themes/reno98/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/themes/reno98/layouts/tiletopw.png differ diff --git a/themes/reno98/layouts/tilew.png b/themes/reno98/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/themes/reno98/layouts/tilew.png differ diff --git a/themes/reno98/submenu.png b/themes/reno98/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/themes/reno98/submenu.png differ diff --git a/themes/reno98/taglist/squarefw.png b/themes/reno98/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/themes/reno98/taglist/squarefw.png differ diff --git a/themes/reno98/taglist/squarew.png b/themes/reno98/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/themes/reno98/taglist/squarew.png differ diff --git a/themes/reno98/theme.lua b/themes/reno98/theme.lua new file mode 100644 index 0000000..79211c6 --- /dev/null +++ b/themes/reno98/theme.lua @@ -0,0 +1,364 @@ +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 diff --git a/themes/reno98/titlebar/close_focus.png b/themes/reno98/titlebar/close_focus.png new file mode 100644 index 0000000..01ef825 Binary files /dev/null and b/themes/reno98/titlebar/close_focus.png differ diff --git a/themes/reno98/titlebar/close_normal.png b/themes/reno98/titlebar/close_normal.png new file mode 100644 index 0000000..5448ed8 Binary files /dev/null and b/themes/reno98/titlebar/close_normal.png differ diff --git a/themes/reno98/titlebar/floating_focus_active.png b/themes/reno98/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/themes/reno98/titlebar/floating_focus_active.png differ diff --git a/themes/reno98/titlebar/floating_focus_inactive.png b/themes/reno98/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/themes/reno98/titlebar/floating_focus_inactive.png differ diff --git a/themes/reno98/titlebar/floating_normal_active.png b/themes/reno98/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/themes/reno98/titlebar/floating_normal_active.png differ diff --git a/themes/reno98/titlebar/floating_normal_inactive.png b/themes/reno98/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/themes/reno98/titlebar/floating_normal_inactive.png differ diff --git a/themes/reno98/titlebar/maximized_focus_active.png b/themes/reno98/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..d7dffd7 Binary files /dev/null and b/themes/reno98/titlebar/maximized_focus_active.png differ diff --git a/themes/reno98/titlebar/maximized_focus_inactive.png b/themes/reno98/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..844389f Binary files /dev/null and b/themes/reno98/titlebar/maximized_focus_inactive.png differ diff --git a/themes/reno98/titlebar/maximized_normal_active.png b/themes/reno98/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..a705f81 Binary files /dev/null and b/themes/reno98/titlebar/maximized_normal_active.png differ diff --git a/themes/reno98/titlebar/maximized_normal_inactive.png b/themes/reno98/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..4c1ab1f Binary files /dev/null and b/themes/reno98/titlebar/maximized_normal_inactive.png differ diff --git a/themes/reno98/titlebar/minimize_focus.png b/themes/reno98/titlebar/minimize_focus.png new file mode 100644 index 0000000..caaceb2 Binary files /dev/null and b/themes/reno98/titlebar/minimize_focus.png differ diff --git a/themes/reno98/titlebar/minimize_normal.png b/themes/reno98/titlebar/minimize_normal.png new file mode 100644 index 0000000..36621d0 Binary files /dev/null and b/themes/reno98/titlebar/minimize_normal.png differ diff --git a/themes/reno98/titlebar/ontop_focus_active.png b/themes/reno98/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/themes/reno98/titlebar/ontop_focus_active.png differ diff --git a/themes/reno98/titlebar/ontop_focus_inactive.png b/themes/reno98/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/themes/reno98/titlebar/ontop_focus_inactive.png differ diff --git a/themes/reno98/titlebar/ontop_normal_active.png b/themes/reno98/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/themes/reno98/titlebar/ontop_normal_active.png differ diff --git a/themes/reno98/titlebar/ontop_normal_inactive.png b/themes/reno98/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/themes/reno98/titlebar/ontop_normal_inactive.png differ diff --git a/themes/reno98/titlebar/sticky_focus_active.png b/themes/reno98/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/themes/reno98/titlebar/sticky_focus_active.png differ diff --git a/themes/reno98/titlebar/sticky_focus_inactive.png b/themes/reno98/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/themes/reno98/titlebar/sticky_focus_inactive.png differ diff --git a/themes/reno98/titlebar/sticky_normal_active.png b/themes/reno98/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/themes/reno98/titlebar/sticky_normal_active.png differ diff --git a/themes/reno98/titlebar/sticky_normal_inactive.png b/themes/reno98/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/themes/reno98/titlebar/sticky_normal_inactive.png differ diff --git a/widgets/dismal.lua b/widgets/dismal.lua index 1375700..683f4b5 100644 --- a/widgets/dismal.lua +++ b/widgets/dismal.lua @@ -3,6 +3,7 @@ local awmtk2 = require("awmtk2") local wibox = require("wibox") local gears = require("gears") local awful = require("awful") +local beautiful = require("beautiful") local xdg_search = function(name,rlimit) local results = {} @@ -38,7 +39,7 @@ return function(args) forced_width = style.button.width or 180 }), t.textbox({ - markup = "Enter - Run;\nCtrl+Enter - run in terminal" + markup = "Enter - run\nCtrl+Enter - run in terminal" }), spacing = style.container.spacing, layout = wibox.layout.fixed.vertical @@ -46,18 +47,24 @@ return function(args) local button_cache = gears.cache(function(name,exec,description,icon) -- beacause apparently cache doesn't allow nil values if icon == "" then icon = nil end + -- contents of our button local widget = wibox.widget(t.button(t.article({ icon = icon, resize = true, title = name, description = description, icon_size = (style.button.height and - (style.button.height-style.container.margins)) or - 30-style.container.margins + (style.button.height-style.button.margins)) or + 34-style.button.margins }),{ forced_height = style.button.height or 30 })) local exec = exec:gsub("%%%w","") + -- theme-declared highlight function, because why not + -- maybe you'd like to add duck noises to button presses idk. + widget:connect_signal("button::press",style.button.onpress) + widget:connect_signal("button::release",style.button.onrelease) + widget:connect_signal("mouses::leave",style.button.onrelease) widget:buttons( gears.table.join( awful.button({},1,function() @@ -87,6 +94,7 @@ return function(args) root.keys(gears.table.join( root.keys(), awful.key({ global.modkey }, "r", function() + results_list:reset() launchpad.visible = true if launchpad.visible then awful.prompt.run {