diff --git a/libs/awmtk2.lua b/libs/awmtk2.lua index 0f03274..56c0b20 100644 --- a/libs/awmtk2.lua +++ b/libs/awmtk2.lua @@ -7,7 +7,6 @@ -- you should have received a copy of the gnu general public license along with reno desktop. if not, see . -- renotk (formerly awmtk2) - template/granular styling library for reno local wibox = require("wibox") -local awful = require("awful") local gears = require("gears") local beautiful = require("beautiful") beautiful.widgets = beautiful.widgets or {} @@ -16,20 +15,26 @@ beautiful.templates = beautiful.templates or {} 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,vertical) -- to save memory, we create proxies for lower layers called "deltas" -- this function creates that proxy layer using metatables -- fun story - i used instance_delta instead of {} at first. -- the results were horrifying and confusing. return setmetatable({},{ - __index = function(self,k) + __index = function(_,k) -- per-instance overrides are top priority 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 - return rawget(class_delta[name],k) + if vertical and + type(rawget(class_delta[name],"vertical")) == "table" and + rawget(class_delta[name],"vertical")[k] then + return rawget(class_delta[name].vertical,k) + else + return rawget(class_delta[name],k) + end -- parent is fallback elseif parent_delta[k] then return parent_delta[k] @@ -38,17 +43,18 @@ awmtk.create_delta = function(name,instance_delta,class_delta,parent_delta) }) end -awmtk.create_style = function(name,parent,overrides) +awmtk.create_style = function(name,parent,overrides,vertical) -- 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[name] or {} - for name,parent_class in pairs(parent) do - new_style[name] = awmtk.create_delta( - name, + for class_name,parent_class in pairs(parent) do + new_style[class_name] = awmtk.create_delta( + class_name, odelta, cdelta, - parent_class + parent_class, + vertical ) end return new_style @@ -66,7 +72,7 @@ end awmtk.build_templates = function(templates,style,vertical) local new_templates = {} - for name,template in pairs(awmtk.proto_templates) do + for name,_ in pairs(awmtk.proto_templates) do new_templates[name] = templates[name](style,vertical) end return new_templates @@ -205,6 +211,15 @@ awmtk.proto_style.slider = awmtk.create_delta("slider", { awmtk.proto_style.checkbox = awmtk.create_delta("checkbox", { }, awmtk.proto_style,awmtk.proto_style.base) + +awmtk.proto_style.icon = awmtk.create_delta("icon", { + constraint = "max", + height = 100, + width = 100, + valign = "center", + halign = "center", + margins = 0 +}, awmtk.proto_style,awmtk.proto_style.base) -- }}} -- {{{ generic templates @@ -278,6 +293,40 @@ awmtk.proto_templates = { end end, + icon = function(style) + return function(args) + args = args or {} + return { + { + { + { + image = args.image, + id = args.id, + resize = args.resize, + widget = wibox.widget.imagebox + }, + widget = wibox.container.margin, + margins = args.margins or style.icon.margins + }, + strategy = args.constraint or style.icon.constraint, + height = args.height or + style.icon.height, + width = args.width or + style.icon.width, + widget = awmtk.wrap_hooks(wibox.container.constraint, + args), + id = "constraint" + }, + --widget = awmtk.wrap_hooks( + widget = wibox.container.place, + -- args + --), + valign = args.valign or style.icon.valign, + halign = style.icon.halign or style.icon.halign + } + end + end, + vseparator = function(style) -- i'm running out of comments return function(options) @@ -435,26 +484,50 @@ awmtk.proto_templates = { end end, - slider = function(style) + slider = function(style,vertical) -- slider widget but wired to work with the awmtk2 namespace system return function(args) - return awmtk.merge({ - handle_shape = style.slider.handle_shape or style.slider.shape, - handle_color = style.slider.bg_normal, - handle_margins = style.slider.handle_margins, - handle_width = style.slider.handle_width, - handle_border_color = style.slider.handle_border_color, - handle_border_width = style.slider.handle_border_width, - bar_shape = style.slider.bar_shape or style.slider.shape, - bar_height = style.slider.bar_height, - bar_color = style.slider.bg_focus, - bar_margins = style.slider.bar_margins, - bar_border_width = style.slider.bar_border_width, - bar_border_color = style.slider.bar_border_color, - forced_width = style.slider.width, - forced_height = style.slider.height, - widget = awmtk.wrap_hooks(wibox.widget.slider,args) - },args or {}) + if not vertical then + return awmtk.merge({ + handle_shape = style.slider.handle_shape or style.slider.shape, + handle_color = style.slider.bg_normal, + handle_margins = style.slider.handle_margins, + handle_width = style.slider.handle_width, + handle_border_color = style.slider.handle_border_color, + handle_border_width = style.slider.handle_border_width, + bar_shape = style.slider.bar_shape or style.slider.shape, + bar_height = style.slider.bar_height, + bar_color = style.slider.bg_focus, + bar_margins = style.slider.bar_margins, + bar_border_width = style.slider.bar_border_width, + bar_border_color = style.slider.bar_border_color, + forced_width = style.slider.width, + forced_height = style.slider.height, + widget = awmtk.wrap_hooks(wibox.widget.slider,args) + },args or {}) + else + return { + awmtk.merge({ + handle_shape = style.slider.handle_shape or style.slider.shape, + handle_color = style.slider.bg_normal, + handle_margins = style.slider.handle_margins, + handle_width = style.slider.handle_width, + handle_border_color = style.slider.handle_border_color, + handle_border_width = style.slider.handle_border_width, + bar_shape = style.slider.bar_shape or style.slider.shape, + bar_height = style.slider.bar_height, + bar_color = style.slider.bg_focus, + bar_margins = style.slider.bar_margins, + bar_border_width = style.slider.bar_border_width, + bar_border_color = style.slider.bar_border_color, + forced_width = style.slider.width, + forced_height = style.slider.height, + widget = awmtk.wrap_hooks(wibox.widget.slider,args) + },args or {}), + widget = wibox.container.rotate, + direction = "west" + } + end end end, diff --git a/libs/builder.lua b/libs/builder.lua index 25d76b0..d7ecae7 100644 --- a/libs/builder.lua +++ b/libs/builder.lua @@ -51,11 +51,17 @@ return function(description,opts) end local function inner_builder(struct,vertical) if struct.widget then -- External widget descriptions - return require(struct.widget)(gears.table.join({ + local args = gears.table.join({ layout = (struct.layout and inner_builder(struct.layout)), client = (struct.client and c), screen = (struct.screen and s), - vertical = vertical - },struct.options or {},opts.passthrough or {})) + vertical = (function() + if type(struct.vertical) ~= "nil" then + return struct.vertical + end + return vertical + end)() + },struct.options or {},opts.passthrough or {}) + return require(struct.widget)(args) elseif struct.list then -- List descriptions local list = { layout = wibox.layout.fixed[( diff --git a/libs/context_menu.lua b/libs/context_menu.lua index 0abd7bf..3a77106 100644 --- a/libs/context_menu.lua +++ b/libs/context_menu.lua @@ -8,8 +8,6 @@ -- POLYMENU - brutal deluxe -- This isn't in the widgets folder because it's too meta to be there local awful = require("awful") -local gears = require("gears") -local menubar_utils = require("menubar.utils") local wibox = require("wibox") local awmtk2 = require("awmtk2") diff --git a/modules/collect_garbage.lua b/modules/collect_garbage.lua index 8c1e984..cd2bbf7 100644 --- a/modules/collect_garbage.lua +++ b/modules/collect_garbage.lua @@ -5,12 +5,18 @@ -- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- garbage collection timer local gears = require("gears") gears.timer { - timeout = 10, + timeout = 30, autostart = true, callback = function() - collectgarbage("step", 20000) - return true + local out_string = tostring(os.date()) .. "\nLua memory usage:"..tostring(collectgarbage("count")).."\n" + collectgarbage() + out_string = out_string .. "\nLua memory usage after GC: "..tostring(collectgarbage("count")).."\n" + out_string = out_string.."Objects alive:" + for name, obj in pairs{button = button, client = client, drawable = drawable, drawin = drawin, key = key, screen = screen, tag = tag } do + out_string = out_string .. "\n" .. tostring(name) .. " = "..tostring(obj.instances()) + end end } diff --git a/modules/desktop.lua b/modules/desktop.lua index a2816be..911042a 100644 --- a/modules/desktop.lua +++ b/modules/desktop.lua @@ -11,8 +11,6 @@ local wibox = require("wibox") local awful = require("awful") local beautiful = require("beautiful") local builder = require("builder") -local mbarutils = require("menubar").utils -local menugen = require("context_menu") local json = require("dkjson") local function read_file(fname) @@ -49,9 +47,9 @@ end -- }}} do --{{{ Screen local wibar_config = {} local style = awmtk2.create_style("wibar",awmtk2.generic.composite_widget,{}) -for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do - style[v] = awmtk2.create_delta(v, {}, - (beautiful.widgets and beautiful.widgets.wibar) or {}, +for _,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do + style[v] = awmtk2.create_delta(v, {}, + (beautiful.widgets and beautiful.widgets.wibar) or {}, style.wibar) wibar_config[v] = read_file(root_path.."/themes/"..global.theme.."/config/"..v..".json") end @@ -59,18 +57,14 @@ local templates = awmtk2.create_template_lib("wibar",awmtk2.templates,{}) local t = awmtk2.build_templates(templates,style) awful.screen.connect_for_each_screen(function(s) - for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do + for _,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do local contents = { widget = wibox.container.background } if wibar_config[v] then contents = builder(wibar_config[v],{ client = c, style = style[v], buttons = buttons, - screen = s, - passthrough = { - vertical = ((v == "wibar_left") or - (v == "wibar_right")) - } + screen = s }) s[v] = awful.wibar({ -- There really isn't a better way to do this. I wish there was. @@ -99,10 +93,10 @@ end -- }}} do -- {{{ Titlebars local titlebar_config = {} local style = awmtk2.create_style("titlebar",awmtk2.generic.composite_widget,{}) -for k,v in pairs({"titlebar_top","titlebar_left","titlebar_right","titlebar_bottom"}) do +for _,v in pairs({"titlebar_top","titlebar_left","titlebar_right","titlebar_bottom"}) do -- Create styles for each titlebar - style[v] = awmtk2.create_delta(v, {}, - (beautiful.widgets and beautiful.widgets.titlebar) or {}, + style[v] = awmtk2.create_delta(v, {}, + (beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar) -- Load in json layouts for titlebars titlebar_config[v] = read_file(root_path.."/themes/"..global.theme.."/config/"..v..".json") @@ -238,4 +232,3 @@ client.connect_signal("manage",function(c) end end) end --}}} - diff --git a/modules/powermanX.lua b/modules/powermanX.lua index 2cdd528..1716fb1 100644 --- a/modules/powermanX.lua +++ b/modules/powermanX.lua @@ -9,7 +9,6 @@ local sysctl = require("syscontrol") local naughty = require("naughty") local gears = require("gears") -local awful = require("awful") local batteries = sysctl.power_supply.enumerate() local state_tracking = {} -- Configuration variables @@ -17,12 +16,12 @@ local cfg = config.powerman or {} local quality_min = cfg.battery_quality_min or 33 local capacity_min = cfg.battery_capacity_min or 15 -- Main loop -local update_loop = gears.timer({ +gears.timer({ timeout = 2, autostart = true, callback = function() - for k,v in pairs(batteries) do - local data,err = sysctl.power_supply.read_attribs(v) + for _,v in pairs(batteries) do + local data,_ = sysctl.power_supply.read_attribs(v) state_tracking[v] = state_tracking[v] or {} if data.type == "Battery" then if (tonumber(data.quality) < quality_min) and diff --git a/modules/xdg_data.lua b/modules/xdg_data.lua index a2cc0fc..0e230ff 100644 --- a/modules/xdg_data.lua +++ b/modules/xdg_data.lua @@ -136,7 +136,6 @@ awesome.connect_signal("xdg::dir_finished",function(dir) end -- Save the cache if it doesn't exist yet io.open(gears.filesystem.get_xdg_cache_home()..".reno_xdg_cache.json","w"):write(json.encode(xdg)):close() - require("naughty").notify({title = "Human time: "..tostring(os.time()-start_human),text = "Computer time: "..tostring(os.clock()-start_computer)}) -- Finally, call the all_finished signal awesome.emit_signal("xdg::all_finished") end diff --git a/themes/reno98/config/client_menu.json b/themes/reno98/config/client_menu.json index 17fff5a..deb50dc 100644 --- a/themes/reno98/config/client_menu.json +++ b/themes/reno98/config/client_menu.json @@ -1,7 +1,8 @@ { "list": [ - {"widget": "widgets.clientcontrols"}, - {"widget": "widgets.clientbuttons"} + {"widget": "widgets.clientmenu.volume","vertical":false}, + {"widget": "widgets.clientmenu.controls"}, + {"widget": "widgets.clientmenu.buttons"} ], "vertical":true } diff --git a/themes/reno98/config/root_menu.json b/themes/reno98/config/root_menu.json index 625d067..48247c2 100644 --- a/themes/reno98/config/root_menu.json +++ b/themes/reno98/config/root_menu.json @@ -2,22 +2,27 @@ "list": [ {"widget": "widgets.base.popuptitle", "options":{ - "icon":"icons/reno98.png", - "title":"Reno 98" - } + "title":"Reno Unity" + }, + "vertical":true }, - {"widget": "widgets.base.tagswitcher", - "screen":true - }, - {"widget": "widgets.rootcontrols"}, - {"widget": "widgets.xdgmenu", - "options": { - "exclude_category": [ - "Other" - ] - } - }, - {"widget": "widgets.rootbuttons"} + { + "list": [ + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootmenu.controls"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + }, + {"widget": "widgets.rootmenu.buttons"} + ], + "vertical": true + } ], - "vertical": true + "vertical": false } diff --git a/themes/reno98/config/wibar_bottom.json b/themes/reno98/config/wibar_bottom.json index 567f0b8..1b707a8 100644 --- a/themes/reno98/config/wibar_bottom.json +++ b/themes/reno98/config/wibar_bottom.json @@ -2,10 +2,7 @@ "align": { "left": [ { - "widget": "widgets.launcher" - }, - { - "widget": "widgets.tasklist", + "widget": "widgets.desktop.tasklist", "screen": true } ], @@ -13,6 +10,9 @@ ], "right": [ + { + "widget": "widgets.desktop.launcher" + } ] } } diff --git a/themes/reno98/config/wibar_top.json b/themes/reno98/config/wibar_top.json index 79bf780..a19cb1c 100644 --- a/themes/reno98/config/wibar_top.json +++ b/themes/reno98/config/wibar_top.json @@ -1,30 +1,25 @@ { "align": { "left": [ - { "widget": "widgets.soundclown" } + { "widget": "widgets.desktop.soundclown" } ], "center": [ ], "right": [ - { "widget": "widgets.notifications", + { "widget":"widgets.desktop.volume" }, + { "widget": "widgets.desktop.notifications", "screen": true }, - { "widget": "widgets.wallpapers", + { "widget": "widgets.desktop.wallpapers", "screen": true, "options": { "path": "$HOME/Pictures/Wallpapers" } }, - { "widget": "widgets.base.subpanel", - "layout": { - "list": [ - { "widget": "widgets.battery" }, - { "widget": "widgets.base.systray" }, - { "widget": "widgets.base.clock" } - ] - } - } + { "widget": "widgets.desktop.battery" }, + { "widget": "widgets.base.systray" }, + { "widget": "widgets.base.clock" } ] } } diff --git a/themes/unity/config/client_menu.json b/themes/unity/config/client_menu.json index a09013b..deb50dc 100644 --- a/themes/unity/config/client_menu.json +++ b/themes/unity/config/client_menu.json @@ -1,8 +1,8 @@ { "list": [ - {"widget": "widgets.clientvolume"}, - {"widget": "widgets.clientcontrols"}, - {"widget": "widgets.clientbuttons"} + {"widget": "widgets.clientmenu.volume","vertical":false}, + {"widget": "widgets.clientmenu.controls"}, + {"widget": "widgets.clientmenu.buttons"} ], "vertical":true } diff --git a/themes/unity/config/root_menu.json b/themes/unity/config/root_menu.json index 95a9a1a..48247c2 100644 --- a/themes/unity/config/root_menu.json +++ b/themes/unity/config/root_menu.json @@ -3,20 +3,26 @@ {"widget": "widgets.base.popuptitle", "options":{ "title":"Reno Unity" - } + }, + "vertical":true }, - {"widget": "widgets.base.tagswitcher", - "screen":true - }, - {"widget": "widgets.rootcontrols"}, - {"widget": "widgets.xdgmenu", - "options": { - "exclude_category": [ - "Other" - ] - } - }, - {"widget": "widgets.rootbuttons"} + { + "list": [ + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootmenu.controls"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + }, + {"widget": "widgets.rootmenu.buttons"} + ], + "vertical": true + } ], - "vertical": true + "vertical": false } diff --git a/themes/unity/config/wibar_left.json b/themes/unity/config/wibar_left.json index c24d8b8..5c1d88f 100644 --- a/themes/unity/config/wibar_left.json +++ b/themes/unity/config/wibar_left.json @@ -2,7 +2,7 @@ "align": { "left": [ { - "widget": "widgets.tasklist", + "widget": "widgets.desktop.tasklist", "screen": true } ], @@ -11,7 +11,7 @@ ], "right": [ { - "widget": "widgets.launcher" + "widget": "widgets.desktop.launcher" } ] }, diff --git a/themes/unity/config/wibar_top.json b/themes/unity/config/wibar_top.json index 3dbed26..a19cb1c 100644 --- a/themes/unity/config/wibar_top.json +++ b/themes/unity/config/wibar_top.json @@ -1,23 +1,23 @@ { "align": { "left": [ - { "widget": "widgets.soundclown" } + { "widget": "widgets.desktop.soundclown" } ], "center": [ ], "right": [ - { "widget":"widgets.volume" }, - { "widget": "widgets.notifications", + { "widget":"widgets.desktop.volume" }, + { "widget": "widgets.desktop.notifications", "screen": true }, - { "widget": "widgets.wallpapers", + { "widget": "widgets.desktop.wallpapers", "screen": true, "options": { "path": "$HOME/Pictures/Wallpapers" } }, - { "widget": "widgets.battery" }, + { "widget": "widgets.desktop.battery" }, { "widget": "widgets.base.systray" }, { "widget": "widgets.base.clock" } ] diff --git a/themes/unity/theme.lua b/themes/unity/theme.lua index 07cc0a6..2e62355 100644 --- a/themes/unity/theme.lua +++ b/themes/unity/theme.lua @@ -25,6 +25,7 @@ theme.bg_minimize = "#2E2E2E" theme.bg_highlight = "#45433D" theme.bg_systray = theme.bg_normal + theme.fg_normal = "#e1dec7" theme.fg_focus = "#e1dec7" theme.fg_urgent = "#e1dec7" @@ -39,12 +40,36 @@ theme.border_normal = "#c0c0c0" theme.border_focus = "#c0c0c0" theme.border_marked = "#c0c0c0" -local bsize = 50 +local wibar_height = 26 +local wibar_width = 56 + + +theme.horizontal_button_bg_focus = { + type = "linear", + from = {0,0}, + to = {0,wibar_height}, + stops = { + {0,"#32322C"}, + {1,"#4E4E46"} + } +} + +theme.horizontal_button_bg_normal = { + type = "linear", + from = {0,0}, + to = {0,wibar_height}, + stops = { + {0,"#51514E"}, + {1,"#343431"} + } +} + +theme.horizontal_button_border_bg = "#51514E" theme.button_bg_focus = { type = "radial", - from = {bsize/2,-0.5*bsize,bsize/10}, - to = {bsize/2,-0.5*bsize,bsize*2}, + from = {wibar_width/2,-0.5*wibar_width,wibar_width/10}, + to = {wibar_width/2,-0.5*wibar_width,wibar_width*2}, stops = { { 0 , "#FFFFFFBB"}, { 0.45, "#DF744E99"}, @@ -55,8 +80,8 @@ theme.button_bg_focus = { theme.button_bg_normal = { type = "radial", - from = {bsize/2,-0.5*bsize,bsize/10}, - to = {bsize/2,-0.2*bsize,bsize*1.5}, + from = {wibar_width/2,-0.5*wibar_width,wibar_width/10}, + to = {wibar_width/2,-0.2*wibar_width,wibar_width*1.5}, stops = { { 0 , "#FFFFFFFF"}, { 0.5, "#33333333"}, @@ -99,8 +124,8 @@ theme.bar_bg_inverted_focus = { theme.bar_border_color = { type = "radial", - from = {bsize/2,bsize/(-3),bsize/8}, - to = {bsize/2,bsize/(-5),bsize*1}, + from = {wibar_width/2,wibar_width/(-3),wibar_width/8}, + to = {wibar_width/2,wibar_width/(-5),wibar_width*1}, stops = { { 0 , "#FFFFFF66"}, { 1, "#43434366"}, @@ -193,7 +218,7 @@ local icons = { "battery-good-charging-symbolic", "battery-low-charging-symbolic" } -for k,v in pairs(icons) do +for _,v in pairs(icons) do theme[v] = themes_path.."unity/icons/"..v..".png" theme[v:gsub("-charging","")] = themes_path.."unity/icons/"..v:gsub("-charging","")..".png" end @@ -224,7 +249,7 @@ theme.wallpapers_icon = themes_path.."unity/icons/wallpapers.png" -- This one has to be baked as a surface to avoid memory leaks theme.icon_default = themes_path.."unity/icons/unknown-app.png" -for k,v in pairs({ +for _,v in pairs({ "battery-caution-symbolic", "battery-empty-symbolic", "battery-full-symbolic", @@ -304,8 +329,8 @@ theme.widgets = { shape = function(cr,width,height) return gears.shape.rounded_rect(cr,width,height,0) end, - height = 26, - width = 60, + height = wibar_height, + width = wibar_width+6, margins = 3, stretch = true }, @@ -332,6 +357,10 @@ theme.widgets = { border_color = theme.bg_normal, paddings = {2,2,2,2} }, + icon = { + width = 25, + height = 25 + } }, -- }}} -- {{{ Menus @@ -432,6 +461,10 @@ theme.widgets = { article = { icon_size = 30 }, + icon = { + height = 60, + width = 100 + } }, -- }}} soundclown = { @@ -469,46 +502,88 @@ theme.widgets = { } }, tasklist = { + icon = { + margins = 2 + }, button = { width = 160, - height = 44, - margins = 5, + height = wibar_width-4, + margins = 4, shape_focus = theme.button_shape, shape_normal = theme.button_shape, shape_urgent = theme.button_shape, shape_minimize = theme.button_shape, - bg_normal = theme.button_bg_normal, - bg_focus = theme.button_bg_focus, - bg_urgent = theme.bg_urgent, - bg_minimize = theme.bg_minimize, - shape_border_color_normal = theme.bar_border_color, - shape_border_color_focus = theme.bar_border_color, - shape_border_color_urgent = theme.bar_border_color, - shape_border_color_minimize = theme.bar_border_color, shape_border_width_normal = dpi(1), shape_border_width_focus = dpi(1), shape_border_width_urgent = dpi(1), shape_border_width_minimize = dpi(1), + bg_normal = theme.horizontal_button_bg_normal, + bg_focus = theme.horizontal_button_bg_focus, + bg_urgent = theme.bg_urgent, + bg_minimize = theme.bg_minimize, + shape_border_color_normal = theme.horizontal_button_border_bg, + shape_border_color_focus = theme.horizontal_button_border_bg, + shape_border_color_minimize = theme.horizontal_button_border_bg, + shape_border_color_urgent = theme.horizontal_button_border_bg, + vertical = { + margins = 2, + shape_border_width_normal = dpi(1), + shape_border_width_focus = dpi(1), + shape_border_width_urgent = dpi(1), + shape_border_width_minimize = dpi(1), + bg_normal = theme.button_bg_normal, + bg_focus = theme.button_bg_focus, + bg_urgent = theme.bg_urgent, + bg_minimize = theme.bg_minimize, + shape_border_color_normal = theme.bar_border_color, + shape_border_color_focus = theme.bar_border_color, + shape_border_color_urgent = theme.bar_border_color, + shape_border_color_minimize = theme.bar_border_color + } } }, launcher = { + icon = { + width = wibar_width, + height = wibar_width, + margins = 2 + }, button = { - margins = 5, - bg_normal = theme.button_bg_normal, - bg_focus = theme.button_bg_focus, + forced_height = wibar_width, + forced_width = wibar_width, + margins = 2, + bg_normal = theme.horizontal_button_bg_normal, + bg_focus = theme.horizontal_button_bg_focus, shape_border_width = dpi(1), - shape_border_color = theme.bar_border_color, + shape_border_color = theme.horizontal_button_border_bg, + vertical = { + margins = 1, + bg_normal = theme.button_bg_normal, + bg_focus = theme.button_bg_focus, + shape_border_width = dpi(1), + shape_border_color = theme.bar_border_color, + onpress = function(widget) + widget:set_bg(theme.button_bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.button_bg_normal) + end + }, onpress = function(widget) - widget:set_bg(theme.button_bg_focus) + widget:set_bg(theme.horizontal_button_bg_focus) end, onrelease = function(widget) - widget:set_bg(theme.button_bg_normal) + widget:set_bg(theme.horizontal_button_bg_normal) end } }, lockscreen = { popup = { margins = 0 + }, + icon = { + width = 150, + height = 150 } }, lockbar = { @@ -592,12 +667,23 @@ theme.widgets = { wibar_top = { bg_normal = theme.bar_bg_normal, fg_normal = theme.fg_normal, - size = 22, + height = 28, }, wibar_left = { bg_normal = "#0D0D0966", border_width = dpi(1), border_color = "#26262666" + }, + wibar_bottom = { + bg_normal = theme.bar_bg_normal, + fg_normal = theme.fg_normal, + height = 28, + margins = 0 + }, + wibar_right = { + bg_normal = "#0D0D0966", + border_width = dpi(1), + border_color = "#26262666" } } } @@ -662,7 +748,7 @@ theme.templates = { ontop = true },options or {}) end - end + end, } } diff --git a/themes/unity_mate/COPYING.txt b/themes/unity_mate/COPYING.txt new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/themes/unity_mate/COPYING.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/themes/unity_mate/WARNING.txt b/themes/unity_mate/WARNING.txt new file mode 100644 index 0000000..dd1c576 --- /dev/null +++ b/themes/unity_mate/WARNING.txt @@ -0,0 +1,3 @@ +A compositor (like compton) is ***required*** for this theme to work as intended. +This is in part due to the fact that it makes the top bar look less bland, and in part due to the fact that your titlebar corners will look weird otherwise (the corners won't be properly cut). +You may, of course, dismiss using a compositor, but don't tell me about not exactly round corners being a "bug" in this theme afterwards - it's the best you can get with Awesome. diff --git a/themes/unity_mate/background.png b/themes/unity_mate/background.png new file mode 100644 index 0000000..2ff7836 Binary files /dev/null and b/themes/unity_mate/background.png differ diff --git a/themes/unity_mate/config/client_menu.json b/themes/unity_mate/config/client_menu.json new file mode 100644 index 0000000..deb50dc --- /dev/null +++ b/themes/unity_mate/config/client_menu.json @@ -0,0 +1,8 @@ +{ + "list": [ + {"widget": "widgets.clientmenu.volume","vertical":false}, + {"widget": "widgets.clientmenu.controls"}, + {"widget": "widgets.clientmenu.buttons"} + ], + "vertical":true +} diff --git a/themes/unity_mate/config/global.json b/themes/unity_mate/config/global.json new file mode 100644 index 0000000..dab1382 --- /dev/null +++ b/themes/unity_mate/config/global.json @@ -0,0 +1,9 @@ +{ + "widgets.dismal":{ + "x":0, + "y":26 + }, + "widgets.rootmenu":{}, + "widgets.lockscreen":{}, + "widgets.base.keypopup":{} +} diff --git a/themes/unity_mate/config/lockpanel.json b/themes/unity_mate/config/lockpanel.json new file mode 100644 index 0000000..9c8ee56 --- /dev/null +++ b/themes/unity_mate/config/lockpanel.json @@ -0,0 +1,5 @@ +{ + "widgets.lock.clock":{ + "format": "%a %b %d\n %H: %M" + } +} diff --git a/themes/unity_mate/config/root_menu.json b/themes/unity_mate/config/root_menu.json new file mode 100644 index 0000000..48247c2 --- /dev/null +++ b/themes/unity_mate/config/root_menu.json @@ -0,0 +1,28 @@ +{ + "list": [ + {"widget": "widgets.base.popuptitle", + "options":{ + "title":"Reno Unity" + }, + "vertical":true + }, + { + "list": [ + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootmenu.controls"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + }, + {"widget": "widgets.rootmenu.buttons"} + ], + "vertical": true + } + ], + "vertical": false +} diff --git a/themes/unity_mate/config/root_menu_test.json b/themes/unity_mate/config/root_menu_test.json new file mode 100644 index 0000000..61e9d2f --- /dev/null +++ b/themes/unity_mate/config/root_menu_test.json @@ -0,0 +1,32 @@ +{ + "list": [ + { + "list": [ + {"widget": "widgets.base.popuptitle", + "options":{ + "title":"Reno Unity" + } + }, + {"widget": "widgets.rootcontrols"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + } + ], + "vertical": true + }, + { + "list":[ + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootbuttons"} + ], + "vertical":true + } + ], + "vertical":false +} diff --git a/themes/unity_mate/config/titlebar_top.json b/themes/unity_mate/config/titlebar_top.json new file mode 100644 index 0000000..d4a2c11 --- /dev/null +++ b/themes/unity_mate/config/titlebar_top.json @@ -0,0 +1,42 @@ +{ +"align": { + "left": [ + { + "widget":"widgets.clientmenu", + "client":true + } + ], + "center": [ + { + "draggable": true + }, + { + "builtin": "titlewidget", + "client" : true, + "options": { + "align": "left" + } + } + ], + "right": [ + { "widget": "widgets.base.subpanel", + "layout": { + "list": [ + { + "builtin": "minimizebutton", + "client": true + }, + { + "builtin": "maximizedbutton", + "client": true + }, + { + "builtin": "closebutton", + "client": true + } + ] + } + } + ] +} +} diff --git a/themes/unity_mate/config/wibar_bottom.json b/themes/unity_mate/config/wibar_bottom.json new file mode 100644 index 0000000..1b707a8 --- /dev/null +++ b/themes/unity_mate/config/wibar_bottom.json @@ -0,0 +1,18 @@ +{ + "align": { + "left": [ + { + "widget": "widgets.desktop.tasklist", + "screen": true + } + ], + "center": [ + + ], + "right": [ + { + "widget": "widgets.desktop.launcher" + } + ] + } +} diff --git a/themes/unity_mate/config/wibar_top.json b/themes/unity_mate/config/wibar_top.json new file mode 100644 index 0000000..a19cb1c --- /dev/null +++ b/themes/unity_mate/config/wibar_top.json @@ -0,0 +1,25 @@ +{ + "align": { + "left": [ + { "widget": "widgets.desktop.soundclown" } + ], + "center": [ + + ], + "right": [ + { "widget":"widgets.desktop.volume" }, + { "widget": "widgets.desktop.notifications", + "screen": true + }, + { "widget": "widgets.desktop.wallpapers", + "screen": true, + "options": { + "path": "$HOME/Pictures/Wallpapers" + } + }, + { "widget": "widgets.desktop.battery" }, + { "widget": "widgets.base.systray" }, + { "widget": "widgets.base.clock" } + ] + } +} diff --git a/themes/unity_mate/icons/README b/themes/unity_mate/icons/README new file mode 100644 index 0000000..7023132 --- /dev/null +++ b/themes/unity_mate/icons/README @@ -0,0 +1,3 @@ +Licensed under conditions of CC0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt) + +To the extent possible under law, Yessiest (yessiest@memeware.net) has waived all copyright and related or neighboring rights to Reno98 icons diff --git a/themes/unity_mate/icons/ac-adapter-symbolic.png b/themes/unity_mate/icons/ac-adapter-symbolic.png new file mode 100644 index 0000000..a1a4b07 Binary files /dev/null and b/themes/unity_mate/icons/ac-adapter-symbolic.png differ diff --git a/themes/unity_mate/icons/action-lock-screen-symbolic.png b/themes/unity_mate/icons/action-lock-screen-symbolic.png new file mode 100644 index 0000000..cc3cdab Binary files /dev/null and b/themes/unity_mate/icons/action-lock-screen-symbolic.png differ diff --git a/themes/unity_mate/icons/action-poweroff-symbolic.png b/themes/unity_mate/icons/action-poweroff-symbolic.png new file mode 100644 index 0000000..94be34c Binary files /dev/null and b/themes/unity_mate/icons/action-poweroff-symbolic.png differ diff --git a/themes/unity_mate/icons/action-suspend-symbolic.png b/themes/unity_mate/icons/action-suspend-symbolic.png new file mode 100644 index 0000000..1000808 Binary files /dev/null and b/themes/unity_mate/icons/action-suspend-symbolic.png differ diff --git a/themes/unity_mate/icons/backlight-symbolic.png b/themes/unity_mate/icons/backlight-symbolic.png new file mode 100644 index 0000000..4bd29bc Binary files /dev/null and b/themes/unity_mate/icons/backlight-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-caution-charging-symbolic.png b/themes/unity_mate/icons/battery-caution-charging-symbolic.png new file mode 100644 index 0000000..6b282dc Binary files /dev/null and b/themes/unity_mate/icons/battery-caution-charging-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-caution-symbolic.png b/themes/unity_mate/icons/battery-caution-symbolic.png new file mode 100644 index 0000000..72909e7 Binary files /dev/null and b/themes/unity_mate/icons/battery-caution-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-empty-charging-symbolic.png b/themes/unity_mate/icons/battery-empty-charging-symbolic.png new file mode 100644 index 0000000..6628ab9 Binary files /dev/null and b/themes/unity_mate/icons/battery-empty-charging-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-empty-symbolic.png b/themes/unity_mate/icons/battery-empty-symbolic.png new file mode 100644 index 0000000..7b88252 Binary files /dev/null and b/themes/unity_mate/icons/battery-empty-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-full-charged-symbolic.png b/themes/unity_mate/icons/battery-full-charged-symbolic.png new file mode 100644 index 0000000..1091689 Binary files /dev/null and b/themes/unity_mate/icons/battery-full-charged-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-full-charging-symbolic.png b/themes/unity_mate/icons/battery-full-charging-symbolic.png new file mode 100644 index 0000000..8783dae Binary files /dev/null and b/themes/unity_mate/icons/battery-full-charging-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-full-symbolic.png b/themes/unity_mate/icons/battery-full-symbolic.png new file mode 100644 index 0000000..1091689 Binary files /dev/null and b/themes/unity_mate/icons/battery-full-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-good-charging-symbolic.png b/themes/unity_mate/icons/battery-good-charging-symbolic.png new file mode 100644 index 0000000..8f28dcb Binary files /dev/null and b/themes/unity_mate/icons/battery-good-charging-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-good-symbolic.png b/themes/unity_mate/icons/battery-good-symbolic.png new file mode 100644 index 0000000..e6f21da Binary files /dev/null and b/themes/unity_mate/icons/battery-good-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-low-charging-symbolic.png b/themes/unity_mate/icons/battery-low-charging-symbolic.png new file mode 100644 index 0000000..e98269d Binary files /dev/null and b/themes/unity_mate/icons/battery-low-charging-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-low-symbolic.png b/themes/unity_mate/icons/battery-low-symbolic.png new file mode 100644 index 0000000..1b2f9e3 Binary files /dev/null and b/themes/unity_mate/icons/battery-low-symbolic.png differ diff --git a/themes/unity_mate/icons/battery-missing-symbolic.png b/themes/unity_mate/icons/battery-missing-symbolic.png new file mode 100644 index 0000000..37d01b3 Binary files /dev/null and b/themes/unity_mate/icons/battery-missing-symbolic.png differ diff --git a/themes/unity_mate/icons/battery.png b/themes/unity_mate/icons/battery.png new file mode 100644 index 0000000..4735283 Binary files /dev/null and b/themes/unity_mate/icons/battery.png differ diff --git a/themes/unity_mate/icons/mpc-next-symbolic.png b/themes/unity_mate/icons/mpc-next-symbolic.png new file mode 100644 index 0000000..8d94bc7 Binary files /dev/null and b/themes/unity_mate/icons/mpc-next-symbolic.png differ diff --git a/themes/unity_mate/icons/mpc-pause-symbolic.png b/themes/unity_mate/icons/mpc-pause-symbolic.png new file mode 100644 index 0000000..8e8a97f Binary files /dev/null and b/themes/unity_mate/icons/mpc-pause-symbolic.png differ diff --git a/themes/unity_mate/icons/mpc-play-symbolic.png b/themes/unity_mate/icons/mpc-play-symbolic.png new file mode 100644 index 0000000..5a1cfaf Binary files /dev/null and b/themes/unity_mate/icons/mpc-play-symbolic.png differ diff --git a/themes/unity_mate/icons/mpc-previous-symbolic.png b/themes/unity_mate/icons/mpc-previous-symbolic.png new file mode 100644 index 0000000..73120bf Binary files /dev/null and b/themes/unity_mate/icons/mpc-previous-symbolic.png differ diff --git a/themes/unity_mate/icons/notifications-area-symbolic.png b/themes/unity_mate/icons/notifications-area-symbolic.png new file mode 100644 index 0000000..24341ea Binary files /dev/null and b/themes/unity_mate/icons/notifications-area-symbolic.png differ diff --git a/themes/unity_mate/icons/reno.png b/themes/unity_mate/icons/reno.png new file mode 100644 index 0000000..a5a3fe7 Binary files /dev/null and b/themes/unity_mate/icons/reno.png differ diff --git a/themes/unity_mate/icons/unknown-app.png b/themes/unity_mate/icons/unknown-app.png new file mode 100644 index 0000000..26976ec Binary files /dev/null and b/themes/unity_mate/icons/unknown-app.png differ diff --git a/themes/unity_mate/icons/volume-high-symbolic.png b/themes/unity_mate/icons/volume-high-symbolic.png new file mode 100644 index 0000000..c4638c2 Binary files /dev/null and b/themes/unity_mate/icons/volume-high-symbolic.png differ diff --git a/themes/unity_mate/icons/volume-low-symbolic.png b/themes/unity_mate/icons/volume-low-symbolic.png new file mode 100644 index 0000000..312a08f Binary files /dev/null and b/themes/unity_mate/icons/volume-low-symbolic.png differ diff --git a/themes/unity_mate/icons/volume-medium-symbolic.png b/themes/unity_mate/icons/volume-medium-symbolic.png new file mode 100644 index 0000000..e3e75b4 Binary files /dev/null and b/themes/unity_mate/icons/volume-medium-symbolic.png differ diff --git a/themes/unity_mate/icons/volume-muted-symbolic.png b/themes/unity_mate/icons/volume-muted-symbolic.png new file mode 100644 index 0000000..727b87c Binary files /dev/null and b/themes/unity_mate/icons/volume-muted-symbolic.png differ diff --git a/themes/unity_mate/icons/volume.png b/themes/unity_mate/icons/volume.png new file mode 100644 index 0000000..31cb3f6 Binary files /dev/null and b/themes/unity_mate/icons/volume.png differ diff --git a/themes/unity_mate/icons/wallpapers.png b/themes/unity_mate/icons/wallpapers.png new file mode 100644 index 0000000..26b98a8 Binary files /dev/null and b/themes/unity_mate/icons/wallpapers.png differ diff --git a/themes/unity_mate/layouts/cornerne.png b/themes/unity_mate/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/themes/unity_mate/layouts/cornerne.png differ diff --git a/themes/unity_mate/layouts/cornernew.png b/themes/unity_mate/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/themes/unity_mate/layouts/cornernew.png differ diff --git a/themes/unity_mate/layouts/cornernw.png b/themes/unity_mate/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/themes/unity_mate/layouts/cornernw.png differ diff --git a/themes/unity_mate/layouts/cornernww.png b/themes/unity_mate/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/themes/unity_mate/layouts/cornernww.png differ diff --git a/themes/unity_mate/layouts/cornerse.png b/themes/unity_mate/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/themes/unity_mate/layouts/cornerse.png differ diff --git a/themes/unity_mate/layouts/cornersew.png b/themes/unity_mate/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/themes/unity_mate/layouts/cornersew.png differ diff --git a/themes/unity_mate/layouts/cornersw.png b/themes/unity_mate/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/themes/unity_mate/layouts/cornersw.png differ diff --git a/themes/unity_mate/layouts/cornersww.png b/themes/unity_mate/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/themes/unity_mate/layouts/cornersww.png differ diff --git a/themes/unity_mate/layouts/dwindle.png b/themes/unity_mate/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/themes/unity_mate/layouts/dwindle.png differ diff --git a/themes/unity_mate/layouts/dwindlew.png b/themes/unity_mate/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/themes/unity_mate/layouts/dwindlew.png differ diff --git a/themes/unity_mate/layouts/fairh.png b/themes/unity_mate/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/themes/unity_mate/layouts/fairh.png differ diff --git a/themes/unity_mate/layouts/fairhw.png b/themes/unity_mate/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/themes/unity_mate/layouts/fairhw.png differ diff --git a/themes/unity_mate/layouts/fairv.png b/themes/unity_mate/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/themes/unity_mate/layouts/fairv.png differ diff --git a/themes/unity_mate/layouts/fairvw.png b/themes/unity_mate/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/themes/unity_mate/layouts/fairvw.png differ diff --git a/themes/unity_mate/layouts/floating.png b/themes/unity_mate/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/themes/unity_mate/layouts/floating.png differ diff --git a/themes/unity_mate/layouts/floatingw.png b/themes/unity_mate/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/themes/unity_mate/layouts/floatingw.png differ diff --git a/themes/unity_mate/layouts/fullscreen.png b/themes/unity_mate/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/themes/unity_mate/layouts/fullscreen.png differ diff --git a/themes/unity_mate/layouts/fullscreenw.png b/themes/unity_mate/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/themes/unity_mate/layouts/fullscreenw.png differ diff --git a/themes/unity_mate/layouts/magnifier.png b/themes/unity_mate/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/themes/unity_mate/layouts/magnifier.png differ diff --git a/themes/unity_mate/layouts/magnifierw.png b/themes/unity_mate/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/themes/unity_mate/layouts/magnifierw.png differ diff --git a/themes/unity_mate/layouts/max.png b/themes/unity_mate/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/themes/unity_mate/layouts/max.png differ diff --git a/themes/unity_mate/layouts/maxw.png b/themes/unity_mate/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/themes/unity_mate/layouts/maxw.png differ diff --git a/themes/unity_mate/layouts/spiral.png b/themes/unity_mate/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/themes/unity_mate/layouts/spiral.png differ diff --git a/themes/unity_mate/layouts/spiralw.png b/themes/unity_mate/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/themes/unity_mate/layouts/spiralw.png differ diff --git a/themes/unity_mate/layouts/tile.png b/themes/unity_mate/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/themes/unity_mate/layouts/tile.png differ diff --git a/themes/unity_mate/layouts/tilebottom.png b/themes/unity_mate/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/themes/unity_mate/layouts/tilebottom.png differ diff --git a/themes/unity_mate/layouts/tilebottomw.png b/themes/unity_mate/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/themes/unity_mate/layouts/tilebottomw.png differ diff --git a/themes/unity_mate/layouts/tileleft.png b/themes/unity_mate/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/themes/unity_mate/layouts/tileleft.png differ diff --git a/themes/unity_mate/layouts/tileleftw.png b/themes/unity_mate/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/themes/unity_mate/layouts/tileleftw.png differ diff --git a/themes/unity_mate/layouts/tiletop.png b/themes/unity_mate/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/themes/unity_mate/layouts/tiletop.png differ diff --git a/themes/unity_mate/layouts/tiletopw.png b/themes/unity_mate/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/themes/unity_mate/layouts/tiletopw.png differ diff --git a/themes/unity_mate/layouts/tilew.png b/themes/unity_mate/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/themes/unity_mate/layouts/tilew.png differ diff --git a/themes/unity_mate/submenu.png b/themes/unity_mate/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/themes/unity_mate/submenu.png differ diff --git a/themes/unity_mate/taglist/squarefw.png b/themes/unity_mate/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/themes/unity_mate/taglist/squarefw.png differ diff --git a/themes/unity_mate/taglist/squarew.png b/themes/unity_mate/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/themes/unity_mate/taglist/squarew.png differ diff --git a/themes/unity_mate/theme.lua b/themes/unity_mate/theme.lua new file mode 100644 index 0000000..2e62355 --- /dev/null +++ b/themes/unity_mate/theme.lua @@ -0,0 +1,757 @@ +-- Reno Unity - Unity theme for Reno desktop +--[[ + Reno Unity - A theme for Reno desktop + + Written in 2022 by Yessiest (yessiest@memeware.net) + + To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. + + You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see . +--]] +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi +local gears = require("gears") +local themes_path = root_path.."/themes/" + +local theme = {} + +theme.font = "Ubuntu 8" + +theme.bg_normal = "#19191D" +theme.bg_focus = "#3E3E3E" +theme.bg_urgent = "#2E2E2E" +theme.bg_minimize = "#2E2E2E" +theme.bg_highlight = "#45433D" +theme.bg_systray = theme.bg_normal + + +theme.fg_normal = "#e1dec7" +theme.fg_focus = "#e1dec7" +theme.fg_urgent = "#e1dec7" +theme.fg_minimize = "#e1dec7" + +theme.window_rounding = 5 +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" + +local wibar_height = 26 +local wibar_width = 56 + + +theme.horizontal_button_bg_focus = { + type = "linear", + from = {0,0}, + to = {0,wibar_height}, + stops = { + {0,"#32322C"}, + {1,"#4E4E46"} + } +} + +theme.horizontal_button_bg_normal = { + type = "linear", + from = {0,0}, + to = {0,wibar_height}, + stops = { + {0,"#51514E"}, + {1,"#343431"} + } +} + +theme.horizontal_button_border_bg = "#51514E" + +theme.button_bg_focus = { + type = "radial", + from = {wibar_width/2,-0.5*wibar_width,wibar_width/10}, + to = {wibar_width/2,-0.5*wibar_width,wibar_width*2}, + stops = { + { 0 , "#FFFFFFBB"}, + { 0.45, "#DF744E99"}, + { 0.55, "#DF744E99"}, + { 1, "#FFFFFF44"} + } +} + +theme.button_bg_normal = { + type = "radial", + from = {wibar_width/2,-0.5*wibar_width,wibar_width/10}, + to = {wibar_width/2,-0.2*wibar_width,wibar_width*1.5}, + stops = { + { 0 , "#FFFFFFFF"}, + { 0.5, "#33333333"}, + { 1, "#FFFFFF22"} + } +} + +theme.button_shape = function(cr,width,height) + return require("gears").shape.rounded_rect(cr,width,height,2) +end + + +theme.bar_bg_focus = { + type = "linear", + from = { 0, 20 }, + to = { 0, 0 }, + stops = { { 0, "#3C3B37"} , { 1 , "#59574E"} } +} + +theme.bar_bg_normal = { + type = "linear", + from = { 0, 20 }, + to = { 0, 0 }, + stops = { { 0, "#3C3B37"} , { 1 , "#41403D"} } +} + +theme.bar_bg_inverted_normal = { + type = "linear", + from = { 0, 20 }, + to = { 0, 0 }, + stops = { { 0 , "#41403D"}, { 1, "#3C3B37"} } +} + +theme.bar_bg_inverted_focus = { + type = "linear", + from = { 0, 20 }, + to = { 0, 0 }, + stops = { { 0 , "#59574E"}, { 1, "#3C3B37"} } +} + +theme.bar_border_color = { + type = "radial", + from = {wibar_width/2,wibar_width/(-3),wibar_width/8}, + to = {wibar_width/2,wibar_width/(-5),wibar_width*1}, + stops = { + { 0 , "#FFFFFF66"}, + { 1, "#43434366"}, + } +} + +theme.titlebar_bg_focus = theme.bar_bg_focus +theme.titlebar_bg_normal = theme.bar_bg_normal + +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_height = dpi(15) +theme.menu_width = dpi(100) +theme.systray_icon_spacing = 2 + +-- Define the image to load + +theme.titlebar_ontop_button_normal_inactive = themes_path.."unity/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path.."unity/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path.."unity/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path.."unity/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = themes_path.."unity/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path.."unity/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path.."unity/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path.."unity/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = themes_path.."unity/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path.."unity/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path.."unity/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path.."unity/titlebar/floating_focus_active.png" + +theme = theme_assets.recolor_titlebar(theme,theme.fg_normal,"normal") +theme = theme_assets.recolor_titlebar(theme,theme.fg_focus,"focus") + +theme.titlebar_close_button_normal = themes_path.."unity/titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path.."unity/titlebar/close_focus.png" + +theme.titlebar_minimize_button_normal = themes_path.."unity/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path.."unity/titlebar/minimize_focus.png" + +theme.titlebar_maximized_button_normal_inactive = themes_path.."unity/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path.."unity/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path.."unity/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path.."unity/titlebar/maximized_focus_active.png" + +-- You can use your own layout icons like this: +theme.layout_fairh = themes_path.."unity/layouts/fairhw.png" +theme.layout_fairv = themes_path.."unity/layouts/fairvw.png" +theme.layout_floating = themes_path.."unity/layouts/floatingw.png" +theme.layout_magnifier = themes_path.."unity/layouts/magnifierw.png" +theme.layout_max = themes_path.."unity/layouts/maxw.png" +theme.layout_fullscreen = themes_path.."unity/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path.."unity/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path.."unity/layouts/tileleftw.png" +theme.layout_tile = themes_path.."unity/layouts/tilew.png" +theme.layout_tiletop = themes_path.."unity/layouts/tiletopw.png" +theme.layout_spiral = themes_path.."unity/layouts/spiralw.png" +theme.layout_dwindle = themes_path.."unity/layouts/dwindlew.png" +theme.layout_cornernw = themes_path.."unity/layouts/cornernww.png" +theme.layout_cornerne = themes_path.."unity/layouts/cornernew.png" +theme.layout_cornersw = themes_path.."unity/layouts/cornersww.png" +theme.layout_cornerse = themes_path.."unity/layouts/cornersew.png" + +-- Generate Awesome icon: +theme.awesome_icon = theme_assets.awesome_icon( + theme.menu_height, theme.bg_focus, theme.fg_focus +) + +theme.hotkeys_border_width = 3 +theme.hotkeys_border_color = theme.bg_focus +theme.hotkeys_modifiers_fg = theme.fg_normal +theme.hotkeys_label_fg = theme.fg_normal + +---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 = "Humanity" + +-- Icons +local icons = { + "battery-caution-charging-symbolic", + "battery-empty-charging-symbolic", + "battery-full-charging-symbolic", + "battery-good-charging-symbolic", + "battery-low-charging-symbolic" +} +for _,v in pairs(icons) do + theme[v] = themes_path.."unity/icons/"..v..".png" + theme[v:gsub("-charging","")] = themes_path.."unity/icons/"..v:gsub("-charging","")..".png" +end +theme["battery-full-charged-symbolic"] = themes_path.."unity/icons/battery-full-charged-symbolic.png" +theme["battery-missing-symbolic"] = themes_path.."unity/icons/battery-missing-symbolic.png" +theme["ac-adapter-symbolic"] = themes_path.."unity/icons/ac-adapter-symbolic.png" +theme["backlight-symbolic"] = themes_path.."unity/icons/backlight-symbolic.png" +theme["notifications-area-symbolic"] = themes_path.."unity/icons/notifications-area-symbolic.png" + +theme["mpc-previous-symbolic"] = themes_path.."unity/icons/mpc-previous-symbolic.png" + +theme["mpc-play-symbolic"] = themes_path.."unity/icons/mpc-play-symbolic.png" +theme["mpc-pause-symbolic"] = themes_path.."unity/icons/mpc-pause-symbolic.png" +theme["mpc-next-symbolic"] = themes_path.."unity/icons/mpc-next-symbolic.png" + +theme["action-poweroff-symbolic"] = themes_path.."unity/icons/action-poweroff-symbolic.png" +theme["action-lock-screen-symbolic"] = themes_path.."unity/icons/action-lock-screen-symbolic.png" +theme["action-suspend-symbolic"] = themes_path.."unity/icons/action-suspend-symbolic.png" +theme["volume-high-symbolic"] = themes_path.."unity/icons/volume-high-symbolic.png" +theme["volume-medium-symbolic"] = themes_path.."unity/icons/volume-medium-symbolic.png" +theme["volume-low-symbolic"] = themes_path.."unity/icons/volume-low-symbolic.png" +theme["volume-muted-symbolic"] = themes_path.."unity/icons/volume-muted-symbolic.png" + + +theme.wallpaper = themes_path.."unity/background.png" +theme.wallpapers_icon = themes_path.."unity/icons/wallpapers.png" +-- Default icon for clients +-- This one has to be baked as a surface to avoid memory leaks +theme.icon_default = themes_path.."unity/icons/unknown-app.png" + +for _,v in pairs({ + "battery-caution-symbolic", + "battery-empty-symbolic", + "battery-full-symbolic", + "battery-good-symbolic", + "battery-low-symbolic", + "battery-caution-charging-symbolic", + "battery-empty-charging-symbolic", + "battery-full-charging-symbolic", + "battery-good-charging-symbolic", + "battery-low-charging-symbolic", + "battery-full-charged-symbolic", + "battery-missing-symbolic", + "ac-adapter-symbolic", + "backlight-symbolic", + "notifications-area-symbolic", + "mpc-previous-symbolic", + "mpc-play-symbolic", + "mpc-pause-symbolic", + "mpc-next-symbolic", + "action-poweroff-symbolic", + "action-lock-screen-symbolic", + "action-suspend-symbolic", + "wallpapers_icon", + "icon_default", + "volume-high-symbolic", + "volume-medium-symbolic", + "volume-low-symbolic", + "volume-muted-symbolic"}) do + if theme[v] and gears.filesystem.file_readable(theme[v]) then + theme[v] = gears.color.recolor_image(theme[v],theme.fg_normal) + end +end +-- Notification popups settings +theme.notification_width = 240 +theme.notification_height = 60 + + +theme.widgets = { + -- {{{ Widget base + default = { + container = { + shape = function(cr,width,height) + return require("gears").shape.rounded_rect(cr,width,height,2) + end, + bgimage_highlight = theme.bgimage_inset + }, + button = { + shape = theme.button_shape, + onpress = function(widget) + widget:set_bg(theme.bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.bg_normal) + end + }, + popup = { + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,4) + end, + root_shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,6) + end, + }, + titlebar = { + hidden_size = 2, + root_shape = function(cr,width,height) + return gears.shape.partially_rounded_rect(cr,width,height, + true,true,false,false,6) end, + root_bg_focus = theme.titlebar_bg_focus, + root_bg_normal = theme.titlebar_bg_normal, + top = 2, + bottom = 2, + left = 3, + right = 3 + }, + wibar = { + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,0) + end, + height = wibar_height, + width = wibar_width+6, + margins = 3, + stretch = true + }, + slider = { + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,0) + end, + height = 20, + width = 140, + bg_focus = theme.bg_normal, + bg_normal = theme.bg_focus, + handle_width = 8, + handle_border_color = theme.bg_normal, + handle_border_width = 2, + bar_height = 6, + bar_border_color = theme.bg_focus, + bar_border_width = 2 + }, + checkbox = { + width = 15, + height = 15, + shape = gears.shape.circle, + border_width = 3, + border_color = theme.bg_normal, + paddings = {2,2,2,2} + }, + icon = { + width = 25, + height = 25 + } + }, + -- }}} + -- {{{ Menus + generic_menu = { + base = { + spacing = 2, + menu_slide = true + }, + button = { + bg_normal = theme.bg_highlight, + onpress = function(widget) + widget:set_bg(theme.bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.bg_highlight) + end, + forced_height = 20, + forced_width = 160 + }, + }, + -- }}} + -- {{{ Popup activating icons + generic_iconified_widget = { + button = { + margins = 1, + bg_normal = "#00000000", + onpress = function(widget) + widget:set_bg(theme.bg_normal) + end, + onrelease = function(widget) + widget:set_bg("#00000000") + end + } + }, + -- }}} + -- {{{ Bars/Panels/Menu popups + generic_composite_widget = { + base = { + spacing = 2 + } + }, + -- }}} + -- {{{ Status panel widgets + generic_status_widget = { + container = { + margins = 2, + bg_normal = "#00000000", + }, + button = { + margins = 1, + bg_normal = "#00000000", + onpress = function() end, + onrelease = function() end, + } + }, + -- }}} + -- {{{ Various button lists + generic_button_list = { + button = { + bg_normal = theme.bg_highlight, + onpress = function(widget) + widget:set_bg(theme.bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.bg_highlight) + end, + forced_width = 20, + forced_height = 20 + }, + base = { + spacing = 2 + } + }, + -- }}} + -- {{{ All widgets that fit into a single line + generic_oneline_widget = { + container = { + bgimage_normal = theme.bgimage_inset + }, + button = { + margins = 2, + onpress = function(widget) + widget:set_bg(theme.bg_normal) + end, + onrelease = function(widget) + widget:set_bg("#00000000") + end, + bg_normal = "#00000000" + } + }, + -- }}} + -- {{{ All kinds of widget popups + generic_popup = { + button = { + width = 180, + height = 40 + }, + article = { + icon_size = 30 + }, + icon = { + height = 60, + width = 100 + } + }, + -- }}} + soundclown = { + --[[ --Uncomment to leetify that MPC + container = { + bg_normal = "#0c0c0c", + fg_normal = "#00FF00" + }, + ]] + base = { + width = 140 + }, + }, + subpanel = { + container = { + bgimage_normal = theme.bgimage_inset, + bg_normal = theme.bar_bg_inverted_normal, + margins = 0, + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,8) + end + } + }, + taglist = { + base = { + spacing = 2, + layout = require("wibox").layout.flex.horizontal + }, + button = { + bgimage_focus = theme.bgimage_inset, + bgimage_normal = theme.bgimage_outset, + }, + container = { + margins = 3 + } + }, + tasklist = { + icon = { + margins = 2 + }, + button = { + width = 160, + height = wibar_width-4, + margins = 4, + shape_focus = theme.button_shape, + shape_normal = theme.button_shape, + shape_urgent = theme.button_shape, + shape_minimize = theme.button_shape, + shape_border_width_normal = dpi(1), + shape_border_width_focus = dpi(1), + shape_border_width_urgent = dpi(1), + shape_border_width_minimize = dpi(1), + bg_normal = theme.horizontal_button_bg_normal, + bg_focus = theme.horizontal_button_bg_focus, + bg_urgent = theme.bg_urgent, + bg_minimize = theme.bg_minimize, + shape_border_color_normal = theme.horizontal_button_border_bg, + shape_border_color_focus = theme.horizontal_button_border_bg, + shape_border_color_minimize = theme.horizontal_button_border_bg, + shape_border_color_urgent = theme.horizontal_button_border_bg, + vertical = { + margins = 2, + shape_border_width_normal = dpi(1), + shape_border_width_focus = dpi(1), + shape_border_width_urgent = dpi(1), + shape_border_width_minimize = dpi(1), + bg_normal = theme.button_bg_normal, + bg_focus = theme.button_bg_focus, + bg_urgent = theme.bg_urgent, + bg_minimize = theme.bg_minimize, + shape_border_color_normal = theme.bar_border_color, + shape_border_color_focus = theme.bar_border_color, + shape_border_color_urgent = theme.bar_border_color, + shape_border_color_minimize = theme.bar_border_color + } + } + }, + launcher = { + icon = { + width = wibar_width, + height = wibar_width, + margins = 2 + }, + button = { + forced_height = wibar_width, + forced_width = wibar_width, + margins = 2, + bg_normal = theme.horizontal_button_bg_normal, + bg_focus = theme.horizontal_button_bg_focus, + shape_border_width = dpi(1), + shape_border_color = theme.horizontal_button_border_bg, + vertical = { + margins = 1, + bg_normal = theme.button_bg_normal, + bg_focus = theme.button_bg_focus, + shape_border_width = dpi(1), + shape_border_color = theme.bar_border_color, + onpress = function(widget) + widget:set_bg(theme.button_bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.button_bg_normal) + end + }, + onpress = function(widget) + widget:set_bg(theme.horizontal_button_bg_focus) + end, + onrelease = function(widget) + widget:set_bg(theme.horizontal_button_bg_normal) + end + } + }, + lockscreen = { + popup = { + margins = 0 + }, + icon = { + width = 150, + height = 150 + } + }, + lockbar = { + base = { + height = 22 + } + }, + lockpanel = { + base = { + icon_height = 60, + icon_width = 60, + panel_height = 300, + panel_width = 200, + panel_bgimage = theme.bgimage_outset + }, + container = { + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,8) + end, + shape_border_color = theme.bg_highlight, + shape_border_width = dpi(2) + } + }, + systray = { + container = { + margins = 2, + shape = function(cr,width,height) + return gears.shape.rounded_rect(cr,width,height,4) + end, + shape_border_color = theme.bg_normal, + shape_border_width = dpi(2) + } + }, + lock_clock = { + textbox = { + font = "Ubuntu Mono 20" + } + }, + titlebar = { + titlebar_top = { + onfocus = function(titlebar) + local root = titlebar:get_children_by_id("titlebar_root")[1] + root:set_bg(theme.titlebar_bg_focus) + root:set_shape(function(cr,width,height) + return gears.shape.partially_rounded_rect( + cr,width,height, + true,true,false,false,6) end) + end, + onunfocus = function(titlebar) + local root = titlebar:get_children_by_id("titlebar_root")[1] + root:set_bg(theme.titlebar_bg_normal) + root:set_shape(function(cr,width,height) + return gears.shape.partially_rounded_rect( + cr,width,height, + true,true,false,false,6) end) + end, + bg_focus = "#00000000", + bg_normal = "#00000000", + fg_focus = "#FAFAFA", + fg_normal = theme.fg_normal, + size = 22, + spacing = 1 + }, + titlebar_left = { + size = 2, + bg_focus = "#3C3B37", + bg_normal = "#3C3B37", + }, + titlebar_right = { + size = 2, + bg_focus = "#3C3B37", + bg_normal = "#3C3B37", + }, + titlebar_bottom = { + size = 2, + bg_focus = "#3C3B37", + bg_normal = "#3C3B37", + } + }, + wibar = { + wibar_top = { + bg_normal = theme.bar_bg_normal, + fg_normal = theme.fg_normal, + height = 28, + }, + wibar_left = { + bg_normal = "#0D0D0966", + border_width = dpi(1), + border_color = "#26262666" + }, + wibar_bottom = { + bg_normal = theme.bar_bg_normal, + fg_normal = theme.fg_normal, + height = 28, + margins = 0 + }, + wibar_right = { + bg_normal = "#0D0D0966", + border_width = dpi(1), + border_color = "#26262666" + } + } +} + +local wibox = require("wibox") + +theme.templates = { + templates = { + titlebar = function(style) + return function(layout,options) + local margins = style.titlebar.margins + if (style.titlebar.left or + style.titlebar.right or + style.titlebar.bottom or + style.titlebar.top) then + margins = nil + end + return { + { + gears.table.join({ + layout, + margins = margins, + layout = wibox.container.margin, + left = style.titlebar.left, + right = style.titlebar.right, + bottom = style.titlebar.bottom, + top = style.titlebar.top + },options or {}), + bgimage = style.titlebar.root_bgimage_normal, + bg = style.titlebar.root_bg_normal, + fg = style.titlebar.root_fg_normal, + shape = style.titlebar.root_shape, + shape_border_color = style.titlebar.root_shape_border_color, + shape_border_width = style.titlebar.root_shape_border_width, + widget = wibox.container.background, + id = "titlebar_root" + }, + layout = wibox.container.margin, + left = style.titlebar.root_margin_left, + right = style.titlebar.root_margin_right, + top = style.titlebar.root_margin_top, + bottom = style.titlebar.root_margin_bottom + } + end + end, + popup = function(style) + return function(widget,options) + return gears.table.join({ + widget = { + { + widget, + margins = style.popup.margins, + layout = wibox.container.margin + }, + bg = style.popup.bg_normal, + shape = style.popup.root_shape, + widget = wibox.container.background + }, + bg = "#00000000", + shape = style.popup.shape, + visible = false, + ontop = true + },options or {}) + end + end, + } +} + +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/unity_mate/titlebar/close_focus.png b/themes/unity_mate/titlebar/close_focus.png new file mode 100644 index 0000000..51b1a80 Binary files /dev/null and b/themes/unity_mate/titlebar/close_focus.png differ diff --git a/themes/unity_mate/titlebar/close_normal.png b/themes/unity_mate/titlebar/close_normal.png new file mode 100644 index 0000000..f6b83d2 Binary files /dev/null and b/themes/unity_mate/titlebar/close_normal.png differ diff --git a/themes/unity_mate/titlebar/floating_focus_active.png b/themes/unity_mate/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/themes/unity_mate/titlebar/floating_focus_active.png differ diff --git a/themes/unity_mate/titlebar/floating_focus_inactive.png b/themes/unity_mate/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/themes/unity_mate/titlebar/floating_focus_inactive.png differ diff --git a/themes/unity_mate/titlebar/floating_normal_active.png b/themes/unity_mate/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/themes/unity_mate/titlebar/floating_normal_active.png differ diff --git a/themes/unity_mate/titlebar/floating_normal_inactive.png b/themes/unity_mate/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/themes/unity_mate/titlebar/floating_normal_inactive.png differ diff --git a/themes/unity_mate/titlebar/maximized_focus_active.png b/themes/unity_mate/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..189d0f4 Binary files /dev/null and b/themes/unity_mate/titlebar/maximized_focus_active.png differ diff --git a/themes/unity_mate/titlebar/maximized_focus_inactive.png b/themes/unity_mate/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..199b853 Binary files /dev/null and b/themes/unity_mate/titlebar/maximized_focus_inactive.png differ diff --git a/themes/unity_mate/titlebar/maximized_normal_active.png b/themes/unity_mate/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..f3832ad Binary files /dev/null and b/themes/unity_mate/titlebar/maximized_normal_active.png differ diff --git a/themes/unity_mate/titlebar/maximized_normal_inactive.png b/themes/unity_mate/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..7af085e Binary files /dev/null and b/themes/unity_mate/titlebar/maximized_normal_inactive.png differ diff --git a/themes/unity_mate/titlebar/minimize_focus.png b/themes/unity_mate/titlebar/minimize_focus.png new file mode 100644 index 0000000..8ec8e4c Binary files /dev/null and b/themes/unity_mate/titlebar/minimize_focus.png differ diff --git a/themes/unity_mate/titlebar/minimize_normal.png b/themes/unity_mate/titlebar/minimize_normal.png new file mode 100644 index 0000000..9d46d90 Binary files /dev/null and b/themes/unity_mate/titlebar/minimize_normal.png differ diff --git a/themes/unity_mate/titlebar/ontop_focus_active.png b/themes/unity_mate/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/themes/unity_mate/titlebar/ontop_focus_active.png differ diff --git a/themes/unity_mate/titlebar/ontop_focus_inactive.png b/themes/unity_mate/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/themes/unity_mate/titlebar/ontop_focus_inactive.png differ diff --git a/themes/unity_mate/titlebar/ontop_normal_active.png b/themes/unity_mate/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/themes/unity_mate/titlebar/ontop_normal_active.png differ diff --git a/themes/unity_mate/titlebar/ontop_normal_inactive.png b/themes/unity_mate/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/themes/unity_mate/titlebar/ontop_normal_inactive.png differ diff --git a/themes/unity_mate/titlebar/sticky_focus_active.png b/themes/unity_mate/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/themes/unity_mate/titlebar/sticky_focus_active.png differ diff --git a/themes/unity_mate/titlebar/sticky_focus_inactive.png b/themes/unity_mate/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/themes/unity_mate/titlebar/sticky_focus_inactive.png differ diff --git a/themes/unity_mate/titlebar/sticky_normal_active.png b/themes/unity_mate/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/themes/unity_mate/titlebar/sticky_normal_active.png differ diff --git a/themes/unity_mate/titlebar/sticky_normal_inactive.png b/themes/unity_mate/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/themes/unity_mate/titlebar/sticky_normal_inactive.png differ diff --git a/themes/widget_calibration/config/root_menu.json b/themes/widget_calibration/config/root_menu.json index 95a9a1a..370e5ca 100644 --- a/themes/widget_calibration/config/root_menu.json +++ b/themes/widget_calibration/config/root_menu.json @@ -5,18 +5,23 @@ "title":"Reno Unity" } }, - {"widget": "widgets.base.tagswitcher", - "screen":true - }, - {"widget": "widgets.rootcontrols"}, - {"widget": "widgets.xdgmenu", - "options": { - "exclude_category": [ - "Other" - ] - } - }, - {"widget": "widgets.rootbuttons"} + { + "list": [ + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootcontrols"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + }, + {"widget": "widgets.rootbuttons"} + ], + "vertical": true + } ], - "vertical": true + "vertical": false } diff --git a/themes/widget_calibration/theme.lua b/themes/widget_calibration/theme.lua index 07cc0a6..18e123d 100644 --- a/themes/widget_calibration/theme.lua +++ b/themes/widget_calibration/theme.lua @@ -305,7 +305,7 @@ theme.widgets = { return gears.shape.rounded_rect(cr,width,height,0) end, height = 26, - width = 60, + width = bsize+6, margins = 3, stretch = true }, @@ -332,6 +332,10 @@ theme.widgets = { border_color = theme.bg_normal, paddings = {2,2,2,2} }, + icon = { + width = 25, + height = 25 + } }, -- }}} -- {{{ Menus @@ -432,6 +436,10 @@ theme.widgets = { article = { icon_size = 30 }, + icon = { + height = 60, + width = 100 + } }, -- }}} soundclown = { @@ -469,10 +477,13 @@ theme.widgets = { } }, tasklist = { + icon = { + margins = 2 + }, button = { width = 160, - height = 44, - margins = 5, + height = bsize-4, + margins = 2, shape_focus = theme.button_shape, shape_normal = theme.button_shape, shape_urgent = theme.button_shape, @@ -492,8 +503,15 @@ theme.widgets = { } }, launcher = { + icon = { + width = bsize, + height = bsize, + margins = 2 + }, button = { - margins = 5, + forced_height = bsize, + forced_width = bsize, + margins = 2, bg_normal = theme.button_bg_normal, bg_focus = theme.button_bg_focus, shape_border_width = dpi(1), @@ -509,6 +527,10 @@ theme.widgets = { lockscreen = { popup = { margins = 0 + }, + icon = { + width = 150, + height = 150 } }, lockbar = { diff --git a/widgets/base/base.lua b/widgets/base/base.lua index bd07f6f..6273c3b 100644 --- a/widgets/base/base.lua +++ b/widgets/base/base.lua @@ -13,7 +13,7 @@ local awful = require("awful") local beautiful = require("beautiful") return function(args) - local style = awmtk2.create_style("base",awmtk2.default,args.style) + local style = awmtk2.create_style("base",awmtk2.default,args.style,args.vertical) local templates = awmtk2.create_template_lib("base",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(t.textbox({markup = "Why are you loading this widget bruh"}))) diff --git a/widgets/base/clock.lua b/widgets/base/clock.lua index 5b336c7..f75069c 100644 --- a/widgets/base/clock.lua +++ b/widgets/base/clock.lua @@ -17,7 +17,7 @@ local TimeZone = glib.TimeZone return function(args) local style = awmtk2.create_style("clock", - awmtk2.generic.status_widget,args.style) + awmtk2.generic.status_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("clock",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) -- Don't mind me just stealing default library code diff --git a/widgets/base/popuptitle.lua b/widgets/base/popuptitle.lua index f536fd2..57723b0 100644 --- a/widgets/base/popuptitle.lua +++ b/widgets/base/popuptitle.lua @@ -8,14 +8,11 @@ -- 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) args.icon = args.icon or "" local style = awmtk2.create_style("popuptitle", - awmtk2.generic.oneline_widget,args.style) + awmtk2.generic.oneline_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("popuptitle",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget diff --git a/widgets/base/subpanel.lua b/widgets/base/subpanel.lua index 3958681..2a42f01 100644 --- a/widgets/base/subpanel.lua +++ b/widgets/base/subpanel.lua @@ -14,7 +14,7 @@ local beautiful = require("beautiful") return function(args) local style = awmtk2.create_style("subpanel", - awmtk2.generic.composite_widget,args.style) + awmtk2.generic.composite_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("subpanel",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(args.layout)) diff --git a/widgets/base/systray.lua b/widgets/base/systray.lua index ee95267..e4e0dee 100644 --- a/widgets/base/systray.lua +++ b/widgets/base/systray.lua @@ -8,17 +8,29 @@ -- 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("systray", - awmtk2.generic.status_widget,args.style) + awmtk2.generic.status_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("systray",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) - local widget = wibox.widget(t.container({ - widget = wibox.widget.systray - })) + local widget = wibox.widget(t.center(t.container({ + widget = wibox.widget.systray, + id = "systray" + }))) + if args.vertical then + widget:get_children_by_id("systray")[1]:set_horizontal(false) + end + -- Part of a private API + if awesome.systray() == 0 then + widget.visible = false + end + awesome.connect_signal("systray::update",function() + if awesome.systray() == 0 then + widget.visible = false + else + widget.visible = true + end + end) return widget end diff --git a/widgets/base/tagswitcher.lua b/widgets/base/tagswitcher.lua index 816cbb2..d03f6cc 100644 --- a/widgets/base/tagswitcher.lua +++ b/widgets/base/tagswitcher.lua @@ -14,7 +14,7 @@ local beautiful = require("beautiful") return function(args) local style = awmtk2.create_style("taglist", - awmtk2.generic.oneline_widget,args.style) + awmtk2.generic.oneline_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(awful.widget.taglist({ diff --git a/widgets/battery.lua b/widgets/battery.lua index 1e923f6..cf5d642 100644 --- a/widgets/battery.lua +++ b/widgets/battery.lua @@ -60,12 +60,11 @@ return function(args) local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) battery_widget = wibox.widget(t.button({ - { + t.icon({ image = beautiful["battery-missing-symbolic"], resize = true, - widget = wibox.widget.imagebox, id = "virtual_id" - }, + }), (args.percentage and { markup = "0%", id = "percentage_id", diff --git a/widgets/clientbuttons.lua b/widgets/clientbuttons.lua index 4057aed..00fc2a2 100644 --- a/widgets/clientbuttons.lua +++ b/widgets/clientbuttons.lua @@ -21,11 +21,10 @@ return function(args) local ontop_off = beautiful.titlebar_ontop_button_normal_active local sticky_on = beautiful.titlebar_sticky_button_normal_inactive local sticky_off = beautiful.titlebar_sticky_button_normal_active - local floating = wibox.widget(t.button({ + local floating = wibox.widget(t.button(t.icon({ image = (client.focus and client.focus.floating and floating_on) or floating_off, - widget = wibox.widget.imagebox, id = "icon" - },{ + }),{ forced_height = style.button.forced_height, forced_width = style.button.forced_width })) @@ -39,11 +38,10 @@ return function(args) local icon = widget:get_children_by_id("icon")[1] icon.image = (client.focus.floating and floating_on) or floating_off end) - local ontop = wibox.widget(t.button({ + local ontop = wibox.widget(t.button(t.icon({ image = (client.focus and client.focus.ontop and ontop_on) or ontop_off, - widget = wibox.widget.imagebox, id = "icon" - },{ + }),{ forced_height = style.button.forced_height, forced_width = style.button.forced_width })) @@ -57,11 +55,10 @@ return function(args) local icon = widget:get_children_by_id("icon")[1] icon.image = (client.focus.ontop and ontop_on) or ontop_off end) - local sticky = wibox.widget(t.button({ + local sticky = wibox.widget(t.button(t.icon({ image = (client.focus and client.focus.sticky and sticky_on) or sticky_off, - widget = wibox.widget.imagebox, id = "icon" - },{ + }),{ forced_height = style.button.forced_height, forced_width = style.button.forced_width })) diff --git a/widgets/clientmenu/buttons.lua b/widgets/clientmenu/buttons.lua new file mode 100644 index 0000000..6d77f73 --- /dev/null +++ b/widgets/clientmenu/buttons.lua @@ -0,0 +1,88 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Additional client controls, hidden for cleaner UI in the submenu. +local awmtk2 = require("awmtk2") +local wibox = require("wibox") +local beautiful = require("beautiful") + +return function(args) + local style = awmtk2.create_style("client_buttons", + awmtk2.generic.button_list,args.style,args.vertical) + local templates = awmtk2.create_template_lib("client_buttons",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local floating_on = beautiful.titlebar_floating_button_normal_inactive + local floating_off = beautiful.titlebar_floating_button_normal_active + local ontop_on = beautiful.titlebar_ontop_button_normal_inactive + local ontop_off = beautiful.titlebar_ontop_button_normal_active + local sticky_on = beautiful.titlebar_sticky_button_normal_inactive + local sticky_off = beautiful.titlebar_sticky_button_normal_active + local floating = wibox.widget(t.button(t.icon({ + image = (client.focus and client.focus.floating and floating_on) or floating_off, + id = "icon" + }),{ + forced_height = style.button.forced_height, + forced_width = style.button.forced_width + })) + floating:connect_signal("button::press",style.button.onpress) + floating:connect_signal("button::release",style.button.onrelease) + floating:connect_signal("button::press",function(widget) + client.focus.floating = (not client.focus.floating) + widget:emit_signal("widget::update",widget) + end) + floating:connect_signal("widget::update",function(widget) + local icon = widget:get_children_by_id("icon")[1] + icon.image = (client.focus.floating and floating_on) or floating_off + end) + local ontop = wibox.widget(t.button(t.icon({ + image = (client.focus and client.focus.ontop and ontop_on) or ontop_off, + id = "icon" + }),{ + forced_height = style.button.forced_height, + forced_width = style.button.forced_width + })) + ontop:connect_signal("button::press",style.button.onpress) + ontop:connect_signal("button::release",style.button.onrelease) + ontop:connect_signal("button::press",function(widget) + client.focus.ontop = (not client.focus.ontop) + widget:emit_signal("widget::update",widget) + end) + ontop:connect_signal("widget::update",function(widget) + local icon = widget:get_children_by_id("icon")[1] + icon.image = (client.focus.ontop and ontop_on) or ontop_off + end) + local sticky = wibox.widget(t.button(t.icon({ + image = (client.focus and client.focus.sticky and sticky_on) or sticky_off, + id = "icon" + }),{ + forced_height = style.button.forced_height, + forced_width = style.button.forced_width + })) + sticky:connect_signal("button::press",style.button.onpress) + sticky:connect_signal("button::release",style.button.onrelease) + sticky:connect_signal("button::press",function(widget) + client.focus.sticky = (not client.focus.sticky) + widget:emit_signal("widget::update",widget) + end) + sticky:connect_signal("widget::update",function(widget) + local icon = widget:get_children_by_id("icon")[1] + icon.image = (client.focus.sticky and sticky_on) or sticky_off + end) + client.connect_signal("focus",function(c) + sticky:emit_signal("widget::update") + ontop:emit_signal("widget::update") + floating:emit_signal("widget::update") + end) + local widget = wibox.widget({ + floating, + ontop, + sticky, + layout = wibox.layout.fixed.horizontal, + spacing = style.base.spacing + }) + return widget +end diff --git a/widgets/clientmenu/controls.lua b/widgets/clientmenu/controls.lua new file mode 100644 index 0000000..e58a133 --- /dev/null +++ b/widgets/clientmenu/controls.lua @@ -0,0 +1,72 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Basic client control menu +local awmtk2 = require("awmtk2") +local wibox = require("wibox") +local gears = require("gears") +local awful = require("awful") +local beautiful = require("beautiful") +local menugen = require("context_menu") + +return function(args) + local style = awmtk2.create_style("client_controls", + awmtk2.generic.menu,args.style,args.vertical) + local templates = awmtk2.create_template_lib("client_controls",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local move_to_tag = {} + local add_to_tag = {} + awful.screen.connect_for_each_screen(function(s) + table.insert(move_to_tag,{ + "Screen "..s.index, + (function() + local t = {} + for k,v in pairs(s.tags) do + table.insert(t,{v.name,function() + if client.focus then + client.focus:tags({v}) + end + end}) + end + return t + end)() + }) + table.insert(add_to_tag,{ + "Screen "..s.index, + (function() + local t = {} + for k,v in pairs(s.tags) do + table.insert(t,{v.name,function() + if client.focus then + local tags = client.focus:tags() + for k,tag in pairs(tags) do + if v == tag then + table.remove(tags,k) + client.focus:tags(tags) + return + end + end + table.insert(tags,v) + client.focus:tags(tags) + end + end}) + end + return t + end)() + }) + end) + local widget = menugen({ + items = { + { "Kill client", function() client.focus:kill() end }, + { "Raise client", function() client.focus:raise() end}, + { "Lower client", function() client.focus:lower() end}, + { "Move to tag", move_to_tag }, + { "Switch on tag", add_to_tag } + }, + }) + return widget +end diff --git a/widgets/clientmenu/volume.lua b/widgets/clientmenu/volume.lua new file mode 100644 index 0000000..356d1bf --- /dev/null +++ b/widgets/clientmenu/volume.lua @@ -0,0 +1,155 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Pulseaudio per-client volume setting +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk2 = require("awmtk2") +local fastyaml = require("parsers").fast_split_yaml +local beautiful = require("beautiful") +local ask = require("asckey") + +local test_pactl = os.execute("pactl --version") +local result = test_pactl +if _VERSION:match("5.1") then + result = (test_pactl == 0) +end +if not result then + return +end + +local function get_icon(percent) + if percent >= 66 then + return beautiful["volume-high-symbolic"] + elseif percent >= 33 then + return beautiful["volume-medium-symbolic"] + elseif percent > 0 then + return beautiful["volume-low-symbolic"] + else + return beautiful["volume-muted-symbolic"] + end +end + + +return function(args) + local style = awmtk2.create_style("client_volume", + awmtk2.generic.oneline_widget, args.style,args.vertical) + local templates = awmtk2.create_template_lib("client_volume",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local widget = wibox.widget(t.container({ + t.icon({ + id = "client_volume_icon", + resize = true, + }), + (args.vertical and { + t.textbox({ + id = "error" + }), + widget = wibox.container.rotate, + direction = "east" + }) or t.textbox({ + id = "error" + }), + t.slider({ + minimum = 0, + maximum = 100, + id = "client_volume", + value = -1 + }), + layout = (args.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal + })) + local errorbox = widget:get_children_by_id("error")[1] + local icon = widget:get_children_by_id("client_volume_icon")[1] + local slider = widget:get_children_by_id("client_volume")[1] + -- Local tracking value to prevent zero volume on start + local touched = false + -- Attach to focus change + client.connect_signal("update_volume",function(c) + awful.spawn.easy_async("pactl list sink-inputs",function(stdout) + local pactl_data = fastyaml(stdout) + local cl + for _,v in pairs(pactl_data) do + if not c then return end + if v:match("application.process.id = \""..tostring(c.pid).."\"") then + cl = v + end + end + if not cl then + slider.visible = false + errorbox.visible = true + errorbox:set_markup("No sound/Not available") + icon:set_image(beautiful["volume-muted-symbolic"]) + return + end + local volume = tonumber(cl:match("Volume:[^\n]-(%d*)%%")) + slider.visible = true + errorbox.visible = false + icon:set_image(get_icon(volume)) + slider.value = volume + touched = true + end) + end) + client.connect_signal("focus",function(c) + touched = false + c:emit_signal("update_volume") + end) + local update_timer = gears.timer({ + timeout = 0.5, + autostart = true, + callback = function() + if client.focus then + client.focus:emit_signal("update_volume") + end + end + }) + -- Async lock to prevent callback interference + local volume_lock = false + -- Function to set client volume + local function volume(value) + if volume_lock then return end + volume_lock = true + awful.spawn.easy_async("pactl list sink-inputs",function(stdout) + local pactl_data = fastyaml(stdout) + if not (client.focus and client.focus.pid) then + volume_lock = false + return + end + for _,v in pairs(pactl_data) do + if v:match("application.process.id = \""..tostring(client.focus.pid).."\"") then + local sink_id = v:match("^%s*Sink Input #(%d+)") + if sink_id then + print(sink_id, value) + awful.spawn("pactl set-sink-input-volume "..tostring(sink_id).." "..tostring(value).."%") + end + end + end + volume_lock = false + end) + end + -- Attach change to slider + slider:connect_signal("widget::redraw_needed",function() + if touched then + volume(slider.value) + update_timer:again() + end + end) + root.keys(gears.table.join( + root.keys(), + ask.k(":client.volume_up", function() + volume("+5") + end,{description = "increase client volume", group = "client"}), + ask.k(":client.volume_down", function() + volume("-5") + end,{description = "decrease client volume", group = "client"}), + ask.k(":client.volume_mute", function() + volume(0) + end,{description = "mute client", group = "client"}) + )) + return widget +end diff --git a/widgets/clientvolume.lua b/widgets/clientvolume.lua index 8619ba6..acc1863 100644 --- a/widgets/clientvolume.lua +++ b/widgets/clientvolume.lua @@ -42,10 +42,9 @@ return function(args) local templates = awmtk2.create_template_lib("client_volume",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container({ - t.center({ + t.icon({ id = "client_volume_icon", resize = true, - widget = wibox.widget.imagebox }), t.textbox({ id = "error" diff --git a/widgets/desktop/battery.lua b/widgets/desktop/battery.lua new file mode 100644 index 0000000..10057fe --- /dev/null +++ b/widgets/desktop/battery.lua @@ -0,0 +1,310 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Generic battery widget with support for multiple power sources, backlights and backlight control +local awful = require("awful") +local beautiful = require("beautiful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk2 = require("awmtk2") +local syscontrol = require("syscontrol") +local ask = require("asckey") + +local function get_virtual_icon(data) + -- Get an icon from a cumulative total of battery percentages and current charging state + local count = 0 + local cumulative = 0 + local name = "battery-" + for _,v in pairs(data) do + if type(v) == "number" then + cumulative = cumulative + v + count = count + 1 + end + end + local percentage = math.floor((cumulative/(count*100))*100) + if percentage < 15 then + name = name.."caution-" + elseif percentage < 30 then + name = name.."low-" + elseif percentage < 60 then + name = name.."good-" + else + name = name.."full-" + end + if data["charge"] then + name = name.."charging-" + end + return beautiful[name.."symbolic"],percentage +end + +return function(args) + local style = awmtk2.create_style("battery", + awmtk2.generic.popup,args.style,args.vertical) + local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + -- set up popup layout + local layout = wibox.widget({ + layout = wibox.layout.fixed.vertical, + spacing = style.base.spacing + }) + -- create popup + local popup = awful.popup(t.popup(layout)) + local battery_widget + do -- create battery widget + local style = awmtk2.create_style("battery", + awmtk2.generic.status_widget,args.style,args.vertical) + local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + battery_widget = wibox.widget(t.button({ + t.icon({ + image = beautiful["battery-missing-symbolic"], + resize = true, + id = "virtual_id" + }), + (args.percentage and { + markup = "0%", + id = "percentage_id", + widget = wibox.widget.textbox + }), + layout = wibox.layout.fixed.horizontal, + spacing = style.base.spacing + })) + -- make it possible to press the button and make it toggle the popup + battery_widget:connect_signal("button::press",style.button.onpress) + battery_widget:connect_signal("button::release",style.button.onrelease) + battery_widget:connect_signal("button::press",function(_,_,_,button) + if button == 1 then + popup.visible = (not popup.visible) + if popup.visible then + popup:move_next_to(mouse.current_widget_geometry) + end + end + end) + end + -- map widgets to their names to make it easier to update separate components + local widget_map = {} + -- also map current charge state of every device to get the icon for the tray + local percentage_map = {} + -- {{{ Power supply devices + local power_devices = syscontrol.power_supply.enumerate() + for _,device in pairs(power_devices) do + local data = syscontrol.power_supply.read_attribs(device) + if data.type == "Battery" then + widget_map[data.name] = wibox.widget(t.container({ + t.article({ + icon = get_virtual_icon({ + data.capacity, + charge = data.charging + }), + icon_id = "battery_icon", + title = "Battery ("..data.model..")", + }), + t.textbox({ + markup = ("Capacity: %d%%"):format(data.capacity), + id = "capacity_id" + }), + t.textbox({ + markup = ("Quality: %.4f%%"):format(data.quality), + id = "quality_id", + }), + layout = wibox.layout.fixed.vertical + },{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight + })) + layout:add(widget_map[data.name]) + percentage_map[data.name] = data.capacity + elseif data.type == "Mains" then + widget_map[data.name] = wibox.widget(t.container({ + t.article({ + icon = beautiful["ac-adapter-symbolic"], + title = "Power supply", + }), + t.textbox({ + markup = "Powered: "..tostring(data.online), + id = "online_id", + }), + layout = wibox.layout.fixed.vertical + },{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight + })) + layout:add(widget_map[data.name]) + percentage_map["charge"] = data.online + end + end + -- "Virtual" here means a battery that displays the state of a cumulative total of all attached batteries (as if there are any devices that even have more than 1 battery) + local function update_virtual_battery() + local icon = battery_widget:get_children_by_id("virtual_id")[1] + local percentage = battery_widget:get_children_by_id("percentage_id")[1] + local capacity + icon.image,capacity = get_virtual_icon(percentage_map) + if percentage then + percentage:set_markup(tostring(capacity).."%") + end + end + update_virtual_battery() + -- Update loop + local power_update = gears.timer({ + timeout = args.power_polling or 2, + autostart = true, + callback = function() + for _,v in pairs(power_devices) do + local data,err = syscontrol.power_supply.read_attribs(v) + if data and data.type == "Mains" then + local w = widget_map[data.name] + local online = w:get_children_by_id("online_id")[1] + online:set_markup("Powered: "..tostring(data.online)) + percentage_map["charge"] = data.online + elseif data and data.type == "Battery" then + local w = widget_map[data.name] + local icon = w:get_children_by_id("battery_icon")[1] + local capacity = w:get_children_by_id("capacity_id")[1] + local quality = w:get_children_by_id("quality_id")[1] + icon.image = get_virtual_icon({ + data.capacity, + charge = data.charging + }) + capacity:set_markup(("Capacity: %d%%"):format(data.capacity)) + quality:set_markup(("Quality: %.4f%%"):format(data.quality)) + percentage_map[data.name] = data.capacity + else + print(err) + end + update_virtual_battery() + end + end + }) + -- }}} + -- {{{ Backlight + local backlight_devices = syscontrol.backlight.enumerate() + local default_backlight_device + for _,v in pairs(backlight_devices) do + local data = syscontrol.backlight.read_attribs(v) + if data then + widget_map[data.name] = wibox.widget(t.container({ + { + t.article({ + icon = beautiful["backlight-symbolic"], + title = "Backlight", + }), + (data.writable and t.center( + t.checkbox({ + checked = false, + id = "checkbox", + forced_height = style.article.icon_size, + forced_width = style.article.icon_size + }), + { + width = style.checkbox.width, + height = style.checkbox.height + }) + ), + layout = wibox.layout.fixed.horizontal, + spacing = style.base.spacing + }, + t.textbox({ + markup = "Brightness: "..tostring(data.brightness), + id = "brightness_id" + }), + t.textbox({ + markup = "Max brightness: "..tostring(data.max_brightness), + id = "max_brightness" + }), + (data.writable and t.slider({ + minimum = data.max_brightness*0.05, + maximum = data.max_brightness, + value = tonumber(data.brightness), + id = "slider" + })), + layout = wibox.layout.fixed.vertical + },{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight + })) + if data.writable then + local w = widget_map[data.name] + local slider = w:get_children_by_id("slider")[1] + slider:connect_signal("widget::redraw_needed",function(self) + local value = self.value + syscontrol.backlight.set_brightness(data,math.floor(value)) + end) + slider.value = tonumber(data.brightness) + local checkbox = w:get_children_by_id("checkbox")[1] + checkbox:connect_signal("button::press",function() + if default_backlight_device then + local check2 = widget_map[default_backlight_device.name] + :get_children_by_id("checkbox")[1] + check2.checked = true + end + default_backlight_device = data + end) + end + layout:add(widget_map[data.name]) + end + end + -- Update loop + local backlight_update = gears.timer({ + timeout = args.backlight_polling or 2, + autostart = true, + callback = function() + for _,v in pairs(backlight_devices) do + local data,err = syscontrol.backlight.read_attribs(v) + if data then + local w = widget_map[data.name] + local online = w:get_children_by_id("brightness_id")[1] + online:set_markup("Brightness: "..tostring(data.brightness)) + else + print(err) + end + end + end + }) + -- Keybindings + root.keys(gears.table.join( + root.keys(), + ask.k(":battery.brightness_up",function() + if default_backlight_device then + local data = default_backlight_device + local s = widget_map[data.name]:get_children_by_id("slider")[1] + local value = s.value+(data.max_brightness*0.05) + if value > data.max_brightness then + value = data.max_brightness + end + syscontrol.backlight.set_brightness(data,math.floor(value)) + s.value = math.floor(value) + end + end,{description="increase brightness", group = "widgets"}), + ask.k(":battery.brightness_down",function() + if default_backlight_device then + local data = default_backlight_device + local s = widget_map[data.name]:get_children_by_id("slider")[1] + local value = s.value-(data.max_brightness*0.05) + if value < data.max_brightness*0.05 then + value = data.max_brightness*0.05 + end + syscontrol.backlight.set_brightness(data,math.floor(value)) + s.value = math.floor(value) + end + end,{description="decrease brightness", group = "widgets"}) + )) + -- }}} + -- We don't need this widget if we don't have anything to show + local function count(t) + local count = 0 + for k,v in pairs(t) do + count = count + 1 + end + return count + end + if count(widget_map) == 0 then + backlight_update:stop() + power_update:stop() + return + end + return battery_widget +end diff --git a/widgets/desktop/launcher.lua b/widgets/desktop/launcher.lua new file mode 100644 index 0000000..ca89193 --- /dev/null +++ b/widgets/desktop/launcher.lua @@ -0,0 +1,55 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Quick application launcher +local awful = require("awful") +local wibox = require("wibox") +local gears = require("gears") +local awmtk2 = require("awmtk2") +local beautiful = require("beautiful") +local menubar_utils = require("menubar").utils + +local function synchronous_ls(dir) + local filenames = {} + local handler = io.popen("ls -1 "..dir,"r") + handler:read("*a"):gsub("[^\n]+",function(filename) + table.insert(filenames,filename) + end) + return filenames +end + +return function(args) + local style = awmtk2.create_style("launcher", + awmtk2.generic.button_list, args.style, args.vertical) + local templates = awmtk2.create_template_lib("launcher", awmtk2.templates, args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local w = wibox.widget({ + layout = ((args.vertical and + wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal + ), + spacing = style.base.spacing + }) + local path = args.path or root_path.."/links" + if gears.filesystem.dir_readable(path) then + local files = synchronous_ls(path) + for _,v in pairs(files) do + local data = menubar_utils.parse_desktop_file(path.."/"..v) + local new_widget = wibox.widget(t.button(t.icon({ + image = menubar_utils.lookup_icon_uncached(data.Icon), + }))) + local exec = data.Exec:gsub("%%%w","") + new_widget:connect_signal("button::press",style.button.onpress) + new_widget:connect_signal("button::release",style.button.onrelease) + new_widget:connect_signal("button::press",function() + awful.spawn(exec) + end) + w:add(new_widget) + end + end + return w +end diff --git a/widgets/desktop/notifications.lua b/widgets/desktop/notifications.lua new file mode 100644 index 0000000..fba29ab --- /dev/null +++ b/widgets/desktop/notifications.lua @@ -0,0 +1,110 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Notifications pager +local awful = require("awful") +local pager = require("pager") +local beautiful = require("beautiful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk2 = require("awmtk2") +local naughty = require("naughty") + +return function(args) + local style = awmtk2.create_style("notifications", + awmtk2.generic.popup,args.style,args.vertical) + local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local layout = wibox.widget({ + layout = wibox.layout.fixed.vertical, + spacing = style.base.spacing + }) + local pager = pager(layout,{},args.max_notifications or 8) + local test_xclip = os.execute("xclip -version") + local result = test_xclip + if _VERSION:match("5.1") then + result = (test_xclip == 0) + end + local count = 0 + local popup = awful.popup(t.popup({ + t.textbox({ + markup = "Click to copy text" + }), + ((not result) and t.textbox({ + markup = "(xclip is not installed)" + })), + t.container(layout,{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight + }), + t.textbox({ + id = "page_id", + markup = "Page 0/0" + }), + layout = wibox.layout.fixed.vertical + },{ + visible = false + })) + naughty.config.notify_callback = function(update_args) + count = count + 1 + local w = wibox.widget(t.button(t.article({ + icon = update_args.icon, + title = update_args.title or "(No title)", + description = update_args.text + }),{ + forced_height = style.button.height, + forced_width = style.button.width + })) + local page_index = popup.widget:get_children_by_id("page_id")[1] + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(count/(args.max_notifications or 8)))) + w:connect_signal("button::press",style.button.onpress) + w:connect_signal("button::release",style.button.onrelease) + w:connect_signal("button::press",function(self,x,y,button) + if button == 1 then + clip = io.open("/tmp/clip","w") + clip:write(update_args.text) + clip:close() + awful.spawn.with_shell("cat /tmp/clip | xclip -selection clipboard") + elseif button == 4 then + pager:prev() + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(count/(args.max_notifications or 8)))) + elseif button == 5 then + pager:next() + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(count/(args.max_notifications or 8)))) + end + end) + table.insert(pager.list,1,w) + pager:update() + return update_args + end + -- create popup button + local clip_widget + do + local style = awmtk2.create_style("notifications", + awmtk2.generic.iconified_widget,args.style,args.vertical) + local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + clip_widget = wibox.widget(t.button(t.icon({ + image = beautiful["notifications-area-symbolic"], + resize = true, + }))) + clip_widget:connect_signal("button::press",style.button.onpress) + clip_widget:connect_signal("button::release",style.button.onrelease) + clip_widget:connect_signal("button::press",function(self,x,y,button) + if button == 1 then + popup.visible = (not popup.visible) + if popup.visible then + popup:move_next_to(mouse.current_widget_geometry) + end + end + end) + end + return clip_widget +end diff --git a/widgets/desktop/soundclown.lua b/widgets/desktop/soundclown.lua new file mode 100644 index 0000000..fc12005 --- /dev/null +++ b/widgets/desktop/soundclown.lua @@ -0,0 +1,145 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Widget for interacting with mpd +-- MPC IS REQUIRED +local awmtk2 = require("awmtk2") +local wibox = require("wibox") +local gears = require("gears") +local awful = require("awful") +local beautiful = require("beautiful") +local ask = require("asckey") + +return function(args) + local style = awmtk2.create_style("soundclown", + awmtk2.generic.oneline_widget,args.style,args.vertical) + local templates = awmtk2.create_template_lib("soundclown",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local test = os.execute("mpc help") + if type(test) == "number" then + test = (test == 0) + end + if not test then + return + end + local controls_widget = { + t.button(t.icon({ + image = beautiful["mpc-previous-symbolic"], + }),{ + id = "prev" + }), + t.button(t.icon({ + image = beautiful["mpc-play-symbolic"], + id = "statusicon" + }),{ + id = "play" + }), + t.button(t.icon({ + image = beautiful["mpc-next-symbolic"], + }),{ + id = "next" + }), + spacing = style.base.spacing, + layout = wibox.layout.flex.horizontal + } + local display_widget = t.container({ + { + t.textbox({ + markup = "MPC Loading..", + id = "display" + }), + widget = wibox.container.scroll.horizontal, + step_function = wibox.container.scroll.step_functions + .linear_back_and_forth, + speed = 50, + }, + widget = wibox.container.constraint, + height = style.base.height, + width = style.base.width, + strategy = "exact" + }) + local widget = wibox.widget({ + display_widget, + ((not args.hide_controls) and controls_widget), + spacing = style.base.spacing, + layout = (args.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal + }) + local display = widget:get_children_by_id("display")[1] + local bprev = widget:get_children_by_id("prev")[1] + bprev:connect_signal("button::press",style.button.onpress) + bprev:connect_signal("button::release",style.button.onrelease) + local function prev() + awful.spawn("mpc cdprev") + end + bprev:connect_signal("button::press",prev) + local pause_state = true + local icon = widget:get_children_by_id("statusicon")[1] + local bplay = widget:get_children_by_id("play")[1] + bplay:connect_signal("button::press",style.button.onpress) + bplay:connect_signal("button::release",style.button.onrelease) + local function play() + pause_state = (not pause_state) + if pause_state == false then + icon.image = beautiful["mpc-pause-symbolic"] + awful.spawn("mpc pause") + else + icon.image = beautiful["mpc-play-symbolic"] + awful.spawn("mpc play") + end + end + bplay:connect_signal("button::press",play) + local bnext = widget:get_children_by_id("next")[1] + bnext:connect_signal("button::press",style.button.onpress) + bnext:connect_signal("button::release",style.button.onrelease) + local function nextb() + awful.spawn("mpc next") + end + bnext:connect_signal("button::press",nextb) + local update_ready = true + local function update_mpd_status() + awful.spawn.easy_async("mpc",function(out) + local status = " " + if not out:match("playing") then + if not out:match("paused") then + pause_state = true + icon.image = beautiful["mpc-play-symbolic"] + display:set_markup(status) + update_ready = true + return + else + status = status.."[PAUSED] " + end + end + status = status..out:match("#%d*").." ".. + out:match("[^\n]*").." ".. + out:match("%d*:%d*/%d*:%d*%s*%(%d*%%%)") + display:set_markup(status) + update_ready = true + end) + end + update_mpd_status() + gears.timer { + timeout = args.polling_delay or 1, + autostart = true, + callback = function() + if not update_ready then return end + update_ready = false + update_mpd_status() + end + } + root.keys(gears.table.join( + root.keys(), + ask.k(":mpc.prev",prev, + {description = "switch to previous MPD track",group="widgets"}), + ask.k(":mpc.play",play, + {description = "play/pause MPD",group="widgets"}), + ask.k(":mpc.next",nextb, + {description = "switch to next MPD track",group="widgets"}) + )) + return widget +end diff --git a/widgets/desktop/tasklist.lua b/widgets/desktop/tasklist.lua new file mode 100644 index 0000000..74f842d --- /dev/null +++ b/widgets/desktop/tasklist.lua @@ -0,0 +1,136 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- awful.widget.tasklist but it can change geometry based on "vertical" property +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.generic.oneline_widget, args.style, args.vertical) + local templates = awmtk2.create_template_lib("tasklist", awmtk2.templates, args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local button = t.button({ + { + { + id = "clienticon", + widget = awful.widget.clienticon + }, + (not args.vertical) and t.textbox({ + id = "text_role" + }), + layout = wibox.layout.fixed.horizontal, + spacing = style.button.spacing + }, + 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) + if client.focus == c then + onfocus() + else + onunfocus() + end + 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 diff --git a/widgets/desktop/volume.lua b/widgets/desktop/volume.lua new file mode 100644 index 0000000..9c91522 --- /dev/null +++ b/widgets/desktop/volume.lua @@ -0,0 +1,135 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Pulseaudio per-client volume setting +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk2 = require("awmtk2") +local beautiful = require("beautiful") +local ask = require("asckey") + +local test_pactl = os.execute("pactl --version") +local pactl_found = test_pactl +if _VERSION:match("5.1") then + pactl_found = (test_pactl == 0) +end +local test_amixer = os.execute("amixer --version") +local amixer_found = test_amixer +if _VERSION:match("5.1") then + amixer_found = (test_amixer == 0) +end +if (not (amixer_found or pactl_found)) then + return +end + +local try_launch = "pavucontrol" +local function get_icon(percent) + if percent >= 66 then + return beautiful["volume-high-symbolic"] + elseif percent >= 33 then + return beautiful["volume-medium-symbolic"] + elseif percent > 0 then + return beautiful["volume-low-symbolic"] + else + return beautiful["volume-muted-symbolic"] + end +end + +return function(args) + local style = awmtk2.create_style("volume", + awmtk2.generic.oneline_widget, args.style,args.vertical) + local templates = awmtk2.create_template_lib("volume",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local slider_part = wibox.widget( + t.container({ + t.slider({ + minimum = 0, + maximum = 100, + id = "volume", + value = -1 + }), + layout = (args.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal + },{ + visible = false, + id = "slidercontainer" + }) + ) + local widget = wibox.widget({ + t.button(t.icon({ + image = get_icon(0), + id = "volume_icon", + resize = true, + })), + id = "volume_widget_root", + layout = (args.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal + }) + local icon = widget:get_children_by_id("volume_icon")[1] + local slider = slider_part:get_children_by_id("volume")[1] + local container = slider_part:get_children_by_id("slidercontainer")[1] + -- Alsa master handle + args.device = args.device or "default" + local update_timer = gears.timer { + autostart = true, + timeout = 0.5, + call_now = true, + callback = function() + awful.spawn.easy_async_with_shell("amixer -D "..args.device.." sget Master",function(stdout) + local volume_percent = stdout:match("%[(%d+)%%%]") + volume_percent = tonumber(volume_percent) + if not volume_percent then + return + end + slider.value = volume_percent + if stdout:match("%[off%]") then + volume_percent = 0 + end + icon.image = get_icon(volume_percent) + end) + end + } + slider:connect_signal("widget::redraw_needed",function() + awful.spawn("amixer -D "..args.device.." sset Master "..slider.value.."%") + update_timer:again() + icon.image = get_icon(slider.value) + end) + icon:connect_signal("button::press",function(_,_,_,button) + if button == 1 then + container.visible = not container.visible + local children = widget:get_children_by_id("volume_widget_root")[1] + if container.visible then + children:add(slider_part) + else + children:remove_widgets(slider_part) + end + end + if button == 3 then + awful.spawn.with_shell(args.mixer or try_launch) + end + if button == 4 then + awful.spawn("amixer -D "..args.device.." sset Master 5%+") + end + if button == 5 then + awful.spawn("amixer -D "..args.device.." sset Master 5%-") + end + end) + root.keys(gears.table.join( + root.keys(), + ask.k(":root.volume_up",function() + awful.spawn("amixer -D "..args.device.." sset Master 5%+") + end,{description = "increase master volume",group = "widgets"}), + ask.k(":root.volume_down",function() + awful.spawn("amixer -D "..args.device.." sset Master 5%-") + end,{description = "decrease master volume",group = "widgets"}), + ask.k(":root.volume_mute",function() + awful.spawn("amixer -D "..args.device.." sset Master toggle") + end,{description = "mute master volume", group = "widgets"}) + )) + return widget +end diff --git a/widgets/desktop/wallpapers.lua b/widgets/desktop/wallpapers.lua new file mode 100644 index 0000000..9753158 --- /dev/null +++ b/widgets/desktop/wallpapers.lua @@ -0,0 +1,146 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Wallpaper list widget +local awful = require("awful") +local pager = require("pager") +local beautiful = require("beautiful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk2 = require("awmtk2") +local thumbnailer = require("thumbnail") + +local function ls(path) + local ls_data = io.popen("find "..path.." -maxdepth 1 -type f \\( -name \\*.jpg -o -name \\*.png \\) -exec realpath {} \\;") + local output = {} + if ls_data then + ls_data:read("*a"):gsub("[^\n]+",function(capt) + table.insert(output,capt) + end) + ls_data:close() + return output + end + error("Failed to process directory "..path) +end + +return function(args) + local style = awmtk2.create_style("wallpapers", + awmtk2.generic.popup,args.style,args.vertical) + local templates = awmtk2.create_template_lib("wallpapers",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + -- set wallpaper + local fhandler = io.open(root_path.."/wallpaper.txt","r") + if fhandler then + local wallpaper_path = fhandler:read("*a") + gears.wallpaper.maximized(wallpaper_path,args.screen) + else + -- try to set wallpaper from theme settings + if beautiful.wallpaper then + gears.wallpaper.maximized(beautiful.wallpaper,args.screen) + end + end + -- update wallpaper preference and set wallpaper + local function set_wallpaper(s) + local handler = io.open(root_path.."/wallpaper.txt","w") + handler:write(s) + handler:close() + gears.wallpaper.maximized(s,args.screen) + end + if not args.path then + args.path = os.getenv("HOME")..".local/share/wallpapers/" + end + args.path = args.path:gsub("$HOME",os.getenv("HOME")) + -- read wallpapers from wallpaper directory + local image_list = ls(args.path) + -- generate thumbnails to save memory + thumbnailer.generate(args.path,args.path.."/.thumbnails",60) + -- create a layout for wallpaper buttons + local layout = wibox.widget({ + layout = wibox.layout.grid, + forced_num_cols = args.columns or 4, + homogenous = true, + expand = true, + orientation = "vertical", + spacing = style.base.spacing + }) + -- create layout popup + local popup = awful.popup(t.popup({ + t.container(layout,{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight + }), + t.textbox({ + markup = "Page 0/0", + id = "page_index" + }), + layout = wibox.layout.fixed.vertical + },{ + visible = false + })) + local page_index = popup.widget:get_children_by_id("page_index")[1] + -- set up a pager for having multiple pages of wallpapers + local pager_size = ((args.rows and args.columns) and args.rows*args.columns) or 20 + local pager = pager(layout,{},pager_size) + -- add wallpaper buttons + for _,v in pairs(image_list) do + local new_button = wibox.widget(t.button(t.icon({ + image = args.path.."/.thumbnails/"..v:match("/[^/]*$"), + resize = true, + height = args.height or 60, + width = args.width or 100 + }))) + new_button:connect_signal("button::press",style.button.onpress) + new_button:connect_signal("button::release",style.button.onrelease) + new_button:connect_signal("button::press",function(self,x,y,button) + if button == 1 then + set_wallpaper(v) + elseif button == 4 then + pager:prev() + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(#image_list/pager_size))) + elseif button == 5 then + pager:next() + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(#image_list/pager_size))) + end + end) + table.insert(pager.list,new_button) + end + page_index:set_markup("Page "..tostring(pager.index+1).."/".. + tostring(math.ceil(#image_list/pager_size))) + -- update pager + pager:update() + -- make popup togglable + popup:connect_signal("button::press",function(self,x,y,button) + if button == 3 then + popup.visible = false + end + end) + -- create popup button + local clip_widget + do + local style = awmtk2.create_style("wallpapers", + awmtk2.generic.iconified_widget,args.style,args.vertical) + local templates = awmtk2.create_template_lib("wallpapers",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + clip_widget = wibox.widget(t.button(t.icon({ + image = beautiful.wallpapers_icon, + resize = true, + }))) + clip_widget:connect_signal("button::press",style.button.onpress) + clip_widget:connect_signal("button::release",style.button.onrelease) + clip_widget:connect_signal("button::press",function(self,x,y,button) + if button == 1 then + popup.visible = (not popup.visible) + if popup.visible then + popup:move_next_to(mouse.current_widget_geometry) + end + end + end) + end + return clip_widget +end diff --git a/widgets/dismal.lua b/widgets/dismal.lua index 4177cdc..e95a39f 100644 --- a/widgets/dismal.lua +++ b/widgets/dismal.lua @@ -30,7 +30,7 @@ end return function(args) local style = awmtk2.create_style("dismal", - awmtk2.generic.popup,args.style) + awmtk2.generic.popup,args.style,args.vertical) local templates = awmtk2.create_template_lib("dismal",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local dismal = awful.popup(t.popup({ diff --git a/widgets/launcher.lua b/widgets/launcher.lua index 4c5aad1..b224b64 100644 --- a/widgets/launcher.lua +++ b/widgets/launcher.lua @@ -37,11 +37,10 @@ return function(args) local path = args.path or root_path.."/links" if gears.filesystem.dir_readable(path) then local files = synchronous_ls(path) - for k,v in pairs(files) do + for _,v in pairs(files) do local data = menubar_utils.parse_desktop_file(path.."/"..v) - local new_widget = wibox.widget(t.button(t.center({ + local new_widget = wibox.widget(t.button(t.icon({ image = menubar_utils.lookup_icon_uncached(data.Icon), - widget = wibox.widget.imagebox, }))) local exec = data.Exec:gsub("%%%w","") new_widget:connect_signal("button::press",style.button.onpress) diff --git a/widgets/lock/clock.lua b/widgets/lock/clock.lua index 4632b3a..bbd852d 100644 --- a/widgets/lock/clock.lua +++ b/widgets/lock/clock.lua @@ -17,7 +17,7 @@ local TimeZone = glib.TimeZone return function(args) local style = awmtk2.create_style("lock_clock", - awmtk2.generic.status_widget,args.style) + awmtk2.generic.status_widget,args.style,args.vertical) local templates = awmtk2.create_template_lib("lock_clock",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) -- Don't mind me just stealing default library code diff --git a/widgets/lockscreen.lua b/widgets/lockscreen.lua index b1318ca..bb9fa0a 100644 --- a/widgets/lockscreen.lua +++ b/widgets/lockscreen.lua @@ -32,7 +32,7 @@ local function _preload(args) local config_path = root_path.."/themes/"..global.theme.."/config/lockbar.json" if readable(config_path) then local style = awmtk2.create_style("lockbar", - awmtk2.generic.composite_widget, args.style) + awmtk2.generic.composite_widget, args.style,args.vertical) local templates = awmtk2.create_template_lib("lockbar",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local config_file = io.open(config_path,"r") @@ -52,7 +52,7 @@ local function _preload(args) end -- }}} do -- {{{ Lock widget local style = awmtk2.create_style("lockpanel", - awmtk2.generic.composite_widget, args.style) + awmtk2.generic.composite_widget, args.style,args.vertical) local templates = awmtk2.create_template_lib("lockpanel",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local config_path = root_path.."/themes/"..global.theme.."/config/lockpanel.json" @@ -89,13 +89,9 @@ local function _preload(args) { t.container({ { - (readable(os.getenv("HOME").."./.face") and t.center(t.container({ - widget = wibox.widget.imagebox, + (readable(os.getenv("HOME").."./.face") and t.icon({ resize = true, image = "./.face", - }),{ - height = style.base.icon_height, - width = style.base.icon_width })), t.container(t.textbox({ markup = "Logged in as "..os.getenv("USER") @@ -157,7 +153,7 @@ local function _preload(args) end) end -- }}} do -- {{{ Lock screen root - local style = awmtk2.create_style("lockscreen", awmtk2.default, args.style) + local style = awmtk2.create_style("lockscreen", awmtk2.default, args.style,args.vertical) local templates = awmtk2.create_template_lib("lockscreen",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local wallpaper diff --git a/widgets/notifications.lua b/widgets/notifications.lua index 99787df..5e106cc 100644 --- a/widgets/notifications.lua +++ b/widgets/notifications.lua @@ -91,11 +91,10 @@ return function(args) awmtk2.generic.iconified_widget,args.style) local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) - clip_widget = wibox.widget(t.button({ + clip_widget = wibox.widget(t.button(t.icon({ image = beautiful["notifications-area-symbolic"], resize = true, - widget = wibox.widget.imagebox, - })) + }))) clip_widget:connect_signal("button::press",style.button.onpress) clip_widget:connect_signal("button::release",style.button.onrelease) clip_widget:connect_signal("button::press",function(self,x,y,button) diff --git a/widgets/rootbuttons.lua b/widgets/rootbuttons.lua index a288e58..923504e 100644 --- a/widgets/rootbuttons.lua +++ b/widgets/rootbuttons.lua @@ -17,10 +17,9 @@ return function(args) awmtk2.generic.button_list,args.style) local templates = awmtk2.create_template_lib("root_buttons",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) - local poweroff = wibox.widget(t.button({ + local poweroff = wibox.widget(t.button(t.icon({ image = beautiful["action-poweroff-symbolic"], - widget = wibox.widget.imagebox, - },{ + }),{ forced_width = style.button.forced_width, forced_height = style.button.forced_height })) @@ -30,10 +29,9 @@ return function(args) awful.spawn("systemctl poweroff") -- Works only with systemd awful.spawn("loginctl poweroff") -- Works only with elogind end) - local lock = wibox.widget(t.button({ + local lock = wibox.widget(t.button(t.icon({ image = beautiful["action-lock-screen-symbolic"], - widget = wibox.widget.imagebox, - },{ + }),{ forced_width = style.button.forced_width, forced_height = style.button.forced_height })) @@ -42,10 +40,9 @@ return function(args) lock:connect_signal("button::press",function() awesome.emit_signal("lock_screen") end) - local suspend = wibox.widget(t.button({ + local suspend = wibox.widget(t.button(t.icon({ image = beautiful["action-suspend-symbolic"], - widget = wibox.widget.imagebox, - },{ + }),{ forced_width = style.button.forced_width, forced_height = style.button.forced_height })) diff --git a/widgets/rootmenu/buttons.lua b/widgets/rootmenu/buttons.lua new file mode 100644 index 0000000..39c99a0 --- /dev/null +++ b/widgets/rootmenu/buttons.lua @@ -0,0 +1,63 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Power/lock/suspend buttons for the global context menu +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("root_buttons", + awmtk2.generic.button_list,args.style,args.vertical) + local templates = awmtk2.create_template_lib("root_buttons",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local poweroff = wibox.widget(t.button(t.icon({ + image = beautiful["action-poweroff-symbolic"], + }),{ + forced_width = style.button.forced_width, + forced_height = style.button.forced_height + })) + poweroff:connect_signal("button::press",style.button.onpress) + poweroff:connect_signal("button::release",style.button.onrelease) + poweroff:connect_signal("button::press",function() + awful.spawn("systemctl poweroff") -- Works only with systemd + awful.spawn("loginctl poweroff") -- Works only with elogind + end) + local lock = wibox.widget(t.button(t.icon({ + image = beautiful["action-lock-screen-symbolic"], + }),{ + forced_width = style.button.forced_width, + forced_height = style.button.forced_height + })) + lock:connect_signal("button::press",style.button.onpress) + lock:connect_signal("button::release",style.button.onrelease) + lock:connect_signal("button::press",function() + awesome.emit_signal("lock_screen") + end) + local suspend = wibox.widget(t.button(t.icon({ + image = beautiful["action-suspend-symbolic"], + }),{ + forced_width = style.button.forced_width, + forced_height = style.button.forced_height + })) + suspend:connect_signal("button::press",style.button.onpress) + suspend:connect_signal("button::release",style.button.onrelease) + suspend:connect_signal("button::press",function() + awful.spawn("systemctl suspend") + awful.spawn("loginctl suspend") + end) + local widget = wibox.widget { + poweroff, + lock, + suspend, + layout = wibox.layout.fixed.horizontal, + spacing = style.base.spacing + } + return widget +end diff --git a/widgets/rootmenu/controls.lua b/widgets/rootmenu/controls.lua new file mode 100644 index 0000000..47f0186 --- /dev/null +++ b/widgets/rootmenu/controls.lua @@ -0,0 +1,33 @@ +-- This file is part of Reno desktop. +-- +-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +-- +-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . +-- Simple global context menu controls +local awmtk2 = require("awmtk2") +local wibox = require("wibox") +local gears = require("gears") +local awful = require("awful") +local beautiful = require("beautiful") +local menugen = require("context_menu") + +return function(args) + local style = awmtk2.create_style("root_menu", + awmtk2.generic.menu,args.style,args.vertical) + local templates = awmtk2.create_template_lib("root_menu",awmtk2.templates,args.templates) + local t = awmtk2.build_templates(templates,style,args.vertical) + local widget = menugen({ + items = { + {"Awesome", { + {"open config dir", "xdg-open "..root_path}, + {"open docs", "xdg-open https://awesomewm.org/doc/api/"}, + {"restart", function() awesome.restart() end}, + {"quit", function() awesome.quit() end} + }, beautiful.awesome_icon}, + {"open terminal", global.terminal}, + }, + }) + return widget +end diff --git a/widgets/soundclown.lua b/widgets/soundclown.lua index a74e556..183ff27 100644 --- a/widgets/soundclown.lua +++ b/widgets/soundclown.lua @@ -44,23 +44,20 @@ return function(args) strategy = "exact" }), ((not args.hide_controls) and { - t.button({ + t.button(t.icon({ image = beautiful["mpc-previous-symbolic"], - widget = wibox.widget.imagebox - },{ + }),{ id = "prev" }), - t.button({ + t.button(t.icon({ image = beautiful["mpc-play-symbolic"], - widget = wibox.widget.imagebox, id = "statusicon" - },{ + }),{ id = "play" }), - t.button({ + t.button(t.icon({ image = beautiful["mpc-next-symbolic"], - widget = wibox.widget.imagebox - },{ + }),{ id = "next" }), spacing = style.base.spacing, diff --git a/widgets/volume.lua b/widgets/volume.lua index 614d9ac..8265fcd 100644 --- a/widgets/volume.lua +++ b/widgets/volume.lua @@ -47,12 +47,11 @@ return function(args) local templates = awmtk2.create_template_lib("volume",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget({ - t.button({ + t.button(t.icon({ image = get_icon(0), id = "volume_icon", resize = true, - widget = wibox.widget.imagebox - }), + })), t.container({ t.slider({ minimum = 0, diff --git a/widgets/wallpapers.lua b/widgets/wallpapers.lua index 4da7018..cd71b99 100644 --- a/widgets/wallpapers.lua +++ b/widgets/wallpapers.lua @@ -86,12 +86,10 @@ return function(args) local pager_size = ((args.rows and args.columns) and args.rows*args.columns) or 20 local pager = pager(layout,{},pager_size) -- add wallpaper buttons - for k,v in pairs(image_list) do - local new_button = wibox.widget(t.button(t.center({ + for _,v in pairs(image_list) do + local new_button = wibox.widget(t.button(t.icon({ image = args.path.."/.thumbnails/"..v:match("/[^/]*$"), resize = true, - widget = wibox.widget.imagebox - },{ height = args.height or 60, width = args.width or 100 }))) @@ -129,11 +127,10 @@ return function(args) awmtk2.generic.iconified_widget,args.style) local templates = awmtk2.create_template_lib("wallpapers",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) - clip_widget = wibox.widget(t.button({ + clip_widget = wibox.widget(t.button(t.icon({ image = beautiful.wallpapers_icon, resize = true, - widget = wibox.widget.imagebox - })) + }))) clip_widget:connect_signal("button::press",style.button.onpress) clip_widget:connect_signal("button::release",style.button.onrelease) clip_widget:connect_signal("button::press",function(self,x,y,button) diff --git a/widgets/xdgmenu.lua b/widgets/xdgmenu.lua index e718d71..f348b96 100644 --- a/widgets/xdgmenu.lua +++ b/widgets/xdgmenu.lua @@ -22,7 +22,7 @@ end return function(args) local style = awmtk2.create_style("xdg_menu", - awmtk2.generic.menu,args.style) + awmtk2.generic.menu,args.style,args.vertical) local templates = awmtk2.create_template_lib("xdg_menu",awmtk2.templates,args.templates) local t = awmtk2.build_templates(templates,style,args.vertical) -- Add a "loading" indicator while XDG is still parsing data @@ -32,7 +32,7 @@ return function(args) widget = wibox.widget.textbox }), layout = wibox.layout.fixed.vertical, - spacing = style.base.spacing, + spacing = 0, id = "xdg_menu_root" }) local function exclude(name) @@ -99,6 +99,11 @@ return function(args) })) appswitch:connect_signal("button::press",function(self) menu.visible = (not menu.visible) + if not menu.visible then + xdg_menu_root.spacing = 0 + else + xdg_menu_root.spacing = style.base.spacing + end local textbox = appswitch:get_children_by_id("apptext")[1] if menu.visible then style.button.onpress(self)