-
82libs/awmtk2.lua
-
118libs/builder.lua
-
219modules/desktop.lua
-
2modules/global.lua
-
36themes/default/config/titlebar_top.json
-
13themes/default/config/wibar_top.json
-
18themes/default/theme.lua
-
36themes/reno98/config/titlebar_top.json
-
16themes/reno98/config/wibar_bottom.json
-
19themes/reno98/config/wibar_top.json
-
126themes/reno98/theme.lua
-
BINthemes/reno98/titlebar/close_focus.png
-
BINthemes/reno98/titlebar/close_normal.png
-
BINthemes/reno98/titlebar/maximized_focus_active.png
-
BINthemes/reno98/titlebar/maximized_focus_inactive.png
-
BINthemes/reno98/titlebar/maximized_normal_active.png
-
BINthemes/reno98/titlebar/maximized_normal_inactive.png
-
BINthemes/reno98/titlebar/minimize_focus.png
-
BINthemes/reno98/titlebar/minimize_normal.png
-
14widgets/base/base.lua
-
43widgets/base/clock.lua
-
14widgets/base/subpanel.lua
-
2widgets/dismal.lua
-
122widgets/tasklist.lua
@ -0,0 +1,118 @@ |
|||
-- JSON layout builder |
|||
local json = require("dkjson") |
|||
local gears = require("gears") |
|||
local wibox = require("wibox") |
|||
local awful = require("awful") |
|||
|
|||
local builtins = { |
|||
h_spacer = function(o) |
|||
return { |
|||
forced_width = o.size or 3, |
|||
widget = wibox.container.background |
|||
} |
|||
end, |
|||
v_spacer = function(o) |
|||
return { |
|||
forced_height = o.size or 3, |
|||
widget = wibox.container.background |
|||
} |
|||
end |
|||
-- Insert your other builtins here |
|||
} |
|||
-- Load a bunch of builtins from awful.titlebar |
|||
for _,name in pairs({ |
|||
"titlewidget","iconwidget","floatingbutton", |
|||
"maximizedbutton","minimizebutton","closebutton", |
|||
"ontopbutton","stickybutton" |
|||
}) do |
|||
builtins[name] = function(o) |
|||
o.widget = awful.titlebar.widget[name](o.client) |
|||
return o |
|||
end |
|||
end |
|||
|
|||
return function(description,opts) |
|||
local style = opts.style or {} |
|||
local c = opts.client |
|||
local s = opts.screen |
|||
local buttons = opts.buttons |
|||
-- Build a layout given a JSON description, a style and client |
|||
-- (if applicable) |
|||
local layout = {} |
|||
local test,err = json.decode(description) |
|||
if not test then |
|||
error("Builder failure: "..err) |
|||
end |
|||
local function inner_builder(struct) |
|||
if struct.widget then -- External widget descriptions |
|||
return require(struct.widget)(gears.table.join({ |
|||
layout = (struct.layout and inner_builder(struct.layout)), client = (struct.client and c), |
|||
screen = (struct.screen and s) |
|||
},struct.options or {})) |
|||
elseif struct.list then -- List descriptions |
|||
local list = { |
|||
layout = wibox.layout.fixed[( |
|||
(struct.vertical and "vertical") or |
|||
"horizontal" |
|||
)], |
|||
spacing = style.spacing |
|||
} |
|||
for k,v in pairs(struct.list) do |
|||
if v.draggable then |
|||
list.buttons = buttons |
|||
else |
|||
table.insert(list,inner_builder(v)) |
|||
end |
|||
end |
|||
return list |
|||
elseif struct.align then -- Align structure descriptions |
|||
local orient = ( |
|||
(struct.vertical and "vertical") or |
|||
"horizontal" |
|||
) |
|||
local list = { |
|||
{ |
|||
layout = wibox.layout.fixed[orient], |
|||
spacing = style.spacing |
|||
},{ |
|||
layout = wibox.layout.flex[orient], |
|||
spacing = style.spacing |
|||
},{ |
|||
-- Simulating "spacing" parameter |
|||
widget = builtins[(struct.vertical and "v_spacer") or |
|||
"h_spacer"]({size = style.spacing}), |
|||
layout = wibox.layout.fixed[orient], |
|||
spacing = style.spacing |
|||
}, |
|||
layout = wibox.layout.align[orient] |
|||
} |
|||
for k,v in pairs({"left","center","right"}) do |
|||
for _,obj in pairs(struct.align[v]) do |
|||
if obj.draggable then |
|||
list[k].buttons = buttons |
|||
else |
|||
table.insert(list[k],inner_builder(obj)) |
|||
end |
|||
end |
|||
end |
|||
-- Part of simulating "spacing" parameter |
|||
table.insert(list[1],builtins[(struct.vertical and "v_spacer") or |
|||
"h_spacer"]({size = style.spacing})) |
|||
|
|||
return list |
|||
elseif struct.builtin then -- Builtin widget descriptions |
|||
if not builtins[struct.builtin] then |
|||
error("Builtin not defined: "..struct.builtin) |
|||
end |
|||
return builtins[struct.builtin](gears.table.join({ |
|||
client = (struct.client and c) |
|||
},struct.options or {})) |
|||
end |
|||
-- If this gets interpreted it's safe to say none of the constructions |
|||
-- above got matched. |
|||
print("Object where the error occured: ") |
|||
gears.debug.dump(struct) |
|||
error("Builder error: invalid object description") |
|||
end |
|||
return inner_builder(test,layout),test.context_options |
|||
end |
@ -0,0 +1,36 @@ |
|||
{ |
|||
"align": { |
|||
"left": [ |
|||
{ |
|||
"builtin": "iconwidget", |
|||
"client": true |
|||
} |
|||
], |
|||
"center": [ |
|||
{ |
|||
"draggable": true |
|||
}, |
|||
{ |
|||
"builtin": "titlewidget", |
|||
"client" : true, |
|||
"options": { |
|||
"align": "left" |
|||
} |
|||
} |
|||
], |
|||
"right": [ |
|||
{ |
|||
"builtin": "minimizebutton", |
|||
"client": true |
|||
}, |
|||
{ |
|||
"builtin": "maximizedbutton", |
|||
"client": true |
|||
}, |
|||
{ |
|||
"builtin": "closebutton", |
|||
"client": true |
|||
} |
|||
] |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
{ |
|||
"align": { |
|||
"left": [ |
|||
{ "widget": "widgets.base.base" } |
|||
], |
|||
"center": [ |
|||
|
|||
], |
|||
"right": [ |
|||
{ "widget": "widgets.base.clock" } |
|||
] |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
{ |
|||
"align": { |
|||
"left": [ |
|||
{ |
|||
"builtin": "iconwidget", |
|||
"client": true |
|||
} |
|||
], |
|||
"center": [ |
|||
{ |
|||
"draggable": true |
|||
}, |
|||
{ |
|||
"builtin": "titlewidget", |
|||
"client" : true, |
|||
"options": { |
|||
"align": "left" |
|||
} |
|||
} |
|||
], |
|||
"right": [ |
|||
{ |
|||
"builtin": "minimizebutton", |
|||
"client": true |
|||
}, |
|||
{ |
|||
"builtin": "maximizedbutton", |
|||
"client": true |
|||
}, |
|||
{ |
|||
"builtin": "closebutton", |
|||
"client": true |
|||
} |
|||
] |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
{ |
|||
"align": { |
|||
"left": [ |
|||
{ |
|||
"widget": "widgets.tasklist", |
|||
"screen": true, |
|||
} |
|||
], |
|||
"center": [ |
|||
|
|||
], |
|||
"right": [ |
|||
|
|||
] |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
{ |
|||
"align": { |
|||
"left": [ |
|||
{ "widget": "widgets.base.base" } |
|||
], |
|||
"center": [ |
|||
|
|||
], |
|||
"right": [ |
|||
{ "widget": "widgets.base.subpanel", |
|||
"layout": { |
|||
"list": [ |
|||
{ "widget": "widgets.base.clock" } |
|||
] |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
Before Width: 64 | Height: 64 | Size: 966 B After Width: 16 | Height: 16 | Size: 369 B |
Before Width: 64 | Height: 64 | Size: 966 B After Width: 16 | Height: 16 | Size: 369 B |
Before Width: 64 | Height: 64 | Size: 480 B After Width: 16 | Height: 16 | Size: 217 B |
Before Width: 64 | Height: 64 | Size: 452 B After Width: 16 | Height: 16 | Size: 206 B |
Before Width: 64 | Height: 64 | Size: 480 B After Width: 16 | Height: 16 | Size: 217 B |
Before Width: 64 | Height: 64 | Size: 452 B After Width: 16 | Height: 16 | Size: 206 B |
Before Width: 64 | Height: 64 | Size: 234 B After Width: 16 | Height: 16 | Size: 190 B |
Before Width: 64 | Height: 64 | Size: 225 B After Width: 16 | Height: 16 | Size: 190 B |
@ -0,0 +1,14 @@ |
|||
-- Base for widgets |
|||
local awmtk2 = require("awmtk2") |
|||
local wibox = require("wibox") |
|||
local gears = require("gears") |
|||
local awful = require("awful") |
|||
local beautiful = require("beautiful") |
|||
|
|||
return function(args) |
|||
local style = awmtk2.create_style("base",awmtk2.default,args.style) |
|||
local templates = awmtk2.create_template_lib("base",awmtk2.templates,args.templates) |
|||
local t = awmtk2.build_templates(templates,style) |
|||
local widget = wibox.widget(t.container(t.textbox({markup = "Why are you loading this widget bruh"}))) |
|||
return widget |
|||
end |
@ -0,0 +1,43 @@ |
|||
-- wibox.widget.textclock but with awmtk2 templates. |
|||
local awmtk2 = require("awmtk2") |
|||
local wibox = require("wibox") |
|||
local gears = require("gears") |
|||
local awful = require("awful") |
|||
local beautiful = require("beautiful") |
|||
local glib = require("lgi").GLib |
|||
local DateTime = glib.DateTime |
|||
local TimeZone = glib.TimeZone |
|||
|
|||
return function(args) |
|||
local style = awmtk2.create_style("clock",awmtk2.default,args.style) |
|||
local templates = awmtk2.create_template_lib("clock",awmtk2.templates,args.templates) |
|||
local t = awmtk2.build_templates(templates,style) |
|||
-- Don't mind me just stealing default library code |
|||
local format = args.format or "%a %b %d, %H:%M" |
|||
local refresh = args.refresh or 60 |
|||
local tzid = args.tzid |
|||
local timezone = (tzid and TimeZone.new(tzid)) or TimeZone.new_local() |
|||
|
|||
-- Seriously, was it so hard to add a font parameter for textclock? |
|||
-- Do you actually expect of nobody to change the font to something like |
|||
-- idk, 7-segment display? Goddamnit awesome. I trusted you. |
|||
local widget = wibox.widget(t.container(t.textbox({ |
|||
id = "clocktext" |
|||
}))) |
|||
local textbox = widget:get_children_by_id("clocktext")[1] |
|||
widget.clocktimer = gears.timer { |
|||
timeout = refresh, |
|||
call_now = true, |
|||
autostart = true, |
|||
callback = function() |
|||
local str = DateTime.new_now(timezone):format(format) |
|||
if str == nil then |
|||
require("gears.debug").print_warning("clock: " |
|||
.. "g_date_time_format() failed for format " |
|||
.. "'" .. format .. "'") |
|||
end |
|||
textbox:set_markup(str) |
|||
end |
|||
} |
|||
return widget |
|||
end |
@ -0,0 +1,14 @@ |
|||
-- For those rare occasions when you want to group widgets in a panel |
|||
local awmtk2 = require("awmtk2") |
|||
local wibox = require("wibox") |
|||
local gears = require("gears") |
|||
local awful = require("awful") |
|||
local beautiful = require("beautiful") |
|||
|
|||
return function(args) |
|||
local style = awmtk2.create_style("subpanel",awmtk2.default,args.style) |
|||
local templates = awmtk2.create_template_lib("subpanel",awmtk2.templates,args.templates) |
|||
local t = awmtk2.build_templates(templates,style) |
|||
local widget = wibox.widget(t.container(args.layout)) |
|||
return widget |
|||
end |
@ -0,0 +1,122 @@ |
|||
local awful = require("awful") |
|||
local wibox = require("wibox") |
|||
local gears = require("gears") |
|||
local awmtk2 = require("awmtk2") |
|||
local tasklist_buttons = gears.table.join( |
|||
awful.button({}, 1, function(c) |
|||
if c == client.focus then |
|||
c.minimized = true |
|||
else |
|||
c:emit_signal( |
|||
"request::activate", |
|||
"tasklist", |
|||
{raise = true} |
|||
) |
|||
end |
|||
end), |
|||
awful.button({}, 4, function() |
|||
awful.client.focus.byidx(1) |
|||
end), |
|||
awful.button({}, 5, function() |
|||
awful.client.focus.byidx(-1) |
|||
end) |
|||
) |
|||
|
|||
return function(args) |
|||
local style = awmtk2.create_style("tasklist", awmtk2.default, args.style) |
|||
local templates = awmtk2.create_template_lib("tasklist", awmtk2.templates, args.templates) |
|||
local t = awmtk2.build_templates(templates,style) |
|||
local button = t.button({ |
|||
{ |
|||
{ |
|||
id = "clienticon", |
|||
widget = awful.widget.clienticon |
|||
}, |
|||
(not args.vertical) and t.textbox({ |
|||
id = "text_role" |
|||
}), |
|||
layout = wibox.layout.fixed.horizontal |
|||
}, |
|||
widget = wibox.container.constraint, |
|||
strategy="exact", |
|||
width = style.button.width, |
|||
height = style.button.height, |
|||
id = "constraint_task" |
|||
},{ |
|||
create_callback = function(self, c, index, objects) |
|||
self:get_children_by_id('clienticon')[1].client = c |
|||
-- If for some ungodly reason you enabled the behaviour of the original awesomewm, this script will just stop after setting the client icon. |
|||
if self.id == "background_role" then |
|||
return |
|||
end |
|||
local textbox = self:get_children_by_id("text_role")[1] or {} |
|||
-- Apparently the original system for changing bgimage is |
|||
-- 1) broken |
|||
-- 2) uses deprecated functions (nice code practices awesomewm) |
|||
-- Solution: write my own. I blame material design for all this. |
|||
-- (P.S: Not to bullshit you, check it yourself - replicatable |
|||
-- by adding theme.tasklist_bg_image_normal or |
|||
-- theme.tasklist_bg_image_focus in current beautiful theme.) |
|||
local onfocus = function() |
|||
self.bgimage = style.button.bgimage_focus |
|||
self.bg = style.button.bg_focus |
|||
self.shape = style.button.shape_focus |
|||
self.shape_border_width = style.button.shape_border_width_focus |
|||
self.shape_border_color = style.button.shape_border_color_focus |
|||
textbox.font = style.textbox.font_focus |
|||
end |
|||
local onunfocus = function() |
|||
self.bgimage = style.button.bgimage_normal |
|||
self.bg = style.button.bg_normal |
|||
self.shape = style.button.shape_normal |
|||
self.shape_border_width = style.button.shape_border_width_normal |
|||
self.shape_border_color = style.button.shape_border_color_normal |
|||
textbox.font = style.textbox.font_normal |
|||
end |
|||
local onurgent = function() |
|||
if not c.urgent then return end |
|||
self.bgimage = style.button.bgimage_urgent |
|||
self.bg = style.button.bg_urgent |
|||
self.shape = style.button.shape_urgent |
|||
self.shape_border_width = style.button.shape_border_width_urgent |
|||
self.shape_border_color = style.button.shape_border_color_urgent |
|||
textbox.font = style.textbox.font_urgent |
|||
end |
|||
local onminimize = function() |
|||
if not c.minimized then return end |
|||
self.bgimage = style.button.bgimage_minimize |
|||
self.bg = style.button.bg_minimize |
|||
self.shape = style.button.shape_minimize |
|||
self.shape_border_width = style.button.shape_border_width_minimize |
|||
self.shape_border_color = style.button.shape_border_color_minimize |
|||
textbox.font = style.textbox.font_minimize |
|||
end |
|||
c:connect_signal("focus",onfocus) |
|||
c:connect_signal("unfocus",onunfocus) |
|||
c:connect_signal("property::urgent",onurgent) |
|||
c:connect_signal("property::minimized",onminimize) |
|||
onfocus() |
|||
end, |
|||
-- Uncomment this only, and **ONLY** if you actually need it. |
|||
--id = "background_role" |
|||
}) |
|||
return awful.widget.tasklist { |
|||
screen = args.screen, |
|||
filter = awful.widget.tasklist.filter.currenttags, |
|||
buttons = tasklist_buttons, |
|||
layout = { |
|||
-- basically we just map every property of this to beautiful.tasklist.base |
|||
spacing = style.base.spacing, |
|||
spacing_widget = style.base.spacing_widget, |
|||
-- Now THIS is shit racing |
|||
layout = ( |
|||
(args.vertical and style.base.layout_vertical) or |
|||
style.base.layout_horizontal |
|||
) or ( |
|||
(args.vertical and wibox.layout.fixed.vertical) or |
|||
wibox.layout.fixed.horizontal |
|||
) |
|||
}, |
|||
widget_template = button |
|||
} |
|||
end |