Compare commits

..

No commits in common. "44a1c20d6196078232bd266529327c564af578c2" and "3a8a55b63a1ac5e5b0943bb5ab4de1ee3cda8268" have entirely different histories.

3 changed files with 45 additions and 99 deletions

View File

@ -54,7 +54,6 @@ awful.screen.connect_for_each_screen(function(s)
}) })
-- Add screen lock -- Add screen lock
require("widgets.lock")({screen = s, obscure = true}) require("widgets.lock")({screen = s, obscure = true})
require("widgets.dismal")({})
require("widgets.unitybar")(s,{ require("widgets.unitybar")(s,{
top_widgets = { top_widgets = {
require("widgets.polytasklist")({ require("widgets.polytasklist")({

View File

@ -6,18 +6,14 @@ local beautiful = require("beautiful")
local awmtk = {} local awmtk = {}
-- {{{ Utils -- {{{ Utils
local debugdata = io.open("/home/yessiest/.awesome_errors","w")
awmtk.create_class = function(name,overrides,style,parent_class) awmtk.create_namespace = function(parent_class,instance_overrides,name)
return setmetatable(overrides,{ return setmetatable(instance_overrides,{
__index = function(self,k) __index = function(self,k)
debugdata:write(tostring(name)..": "..tostring(k).."\n")
-- Per-widget overrides are top priority
if rawget(self,k) then if rawget(self,k) then
return rawget(self,k) return rawget(self,k)
-- Style overrides are second in priority elseif type(beautiful[name]) == "table" and beautiful[name][k] then
elseif type(style[name]) == "table" and rawget(style[name],k) then return beautiful[name][k]
return rawget(style[name],k)
-- Parent class is fallback
elseif parent_class[k] then elseif parent_class[k] then
return parent_class[k] return parent_class[k]
end end
@ -25,35 +21,15 @@ awmtk.create_class = function(name,overrides,style,parent_class)
}) })
end end
awmtk.create_style = function(name,parent,overrides) awmtk.create_class = function
local new_style = setmetatable(beautiful[name] or {},{
__index = function(self,k)
if rawget(self,k) then
return rawget(self,k)
else
return parent[k]
end
end
})
for name,parent_class in pairs(parent) do
new_style[name] = awmtk.create_class(
name,
(overrides and overrides[name]) or {},
new_style,
parent_class
)
end
return new_style
end
-- }}} -- }}}
-- {{{ Default style -- {{{ Classes and namespaces
-- Default style -- Default namespace
awmtk.default = { awmtk.default = setmetatable({
base = setmetatable({},{
-- { Backgrounds -- { Backgrounds
-- custom background color for highlighting elements -- custom background color for highlighting elements
bg_highlight = beautiful.bg_highlight or beautiful.bg_focus, bg_highlight = beautiful.bg_highlight or beautiful.bg_focus,
@ -64,26 +40,31 @@ awmtk.default = {
shape_border_color = beautiful.shape_border_color or beautiful.bg_normal, shape_border_color = beautiful.shape_border_color or beautiful.bg_normal,
-- } -- }
-- { Shapes -- { Shapes
inner_margin = beautiful.inner_margin or 5, inner_margin = beautiful.inner_margin or 5
rounding = beautiful.rounding or 0, rounding = beautiful.rounding or 0
-- } -- }
},{__index = beautiful}) }, { __index = beautiful })
}
-- Container subnamespace
-- We copy the table instead of referncing default namespace to avoid recursion
awmtk.default.container = setmetatable({
-- { Backgrounds
-- custom background color for highlighting elements
bg_highlight = beautiful.bg_highlight or beautiful.bg_focus,
-- }
-- { Borders
-- Borders for popups
shape_border_width = beautiful.shape_border_width or 0,
shape_border_color = beautiful.shape_border_color or beautiful.bg_normal,
-- }
-- { Shapes
inner_margin = beautiful.inner_margin or 5
rounding = beautiful.rounding or 0
-- }
-- { Layout spacing
spacing = (beautiful.container and beautiful.container.spacing) or 2
},{
__index = beautiful
})
-- Container subclass
awmtk.default.container = awmtk.create_class("container",{
},awmtk.default,awmtk.default.base)
-- Button subclass
awmtk.default.button = awmtk.create_class("button",{
inner_margin = 1
},awmtk.default,awmtk.default.base)
-- Icon subclass
awmtk.default.icon = awmtk.create_class("icon",{
inner_margin = 1
},awmtk.default,awmtk.default.base)
return awmtk
-- }}}

View File

@ -1,34 +0,0 @@
local awmtk2 = require("awmtk2")
local wibox = require("wibox")
local gears = require("gears")
local awful = require("awful")
return function(args)
local style = awmtk2.create_style("dismal",awmtk2.default,args.style)
local launchpad = awful.popup({
widget = {
{
{
{
markup = "[b]Enter[/b] - run; [b]Ctrl+Enter[/b] - run in terminal",
widget = wibox.widget.textbox
},
layout = wibox.layout.fixed.vertical
},
widget = wibox.container.margin,
margin = style.container.inner_margin
},
bg = style.container.bg_normal,
widget = wibox.container.background
},
visible = false,
ontop = true
})
root.keys(gears.table.join(
root.keys(),
awful.key({ global.modkey }, "0", function()
launchpad.visible = not launchpad.visible
end)
))
return launchpad
end