diff --git a/Rakefile b/Rakefile index 4bf9e60..d01a891 100644 --- a/Rakefile +++ b/Rakefile @@ -48,13 +48,10 @@ end desc "Install extras" task "install-extra" do - if Process.euid != 0 - raise Exception, "You need to be root to install extras" - end cp "./extra/udev/backlight.rules", "/etc/udev/rules.d" mkdir "#{ConfigPath}/autostart" begin - cp "/usr/share/applications/picom.desktop", "#{ConfigPath}/autostart/" + sh "sudo cp /usr/share/applications/picom.desktop #{ConfigPath}/autostart/" rescue puts "picom not installed - ignoring" else @@ -68,14 +65,6 @@ task :clean do rm_rf "#{ConfigPath}/awesome" end -desc "Install dependencies for code cleaner" -task "install-janitor-deps" do - if Process.euid != 0 - raise Exception, "You need to be root to install gems" - end - Gem.install "language_server-protocol" -end - desc "Wipe configuration and reinstall from scratch" task reinstall: [:clean,:install] diff --git a/libs/awmtk2.lua b/libs/awmtk2.lua index d524cdf..0f03274 100644 --- a/libs/awmtk2.lua +++ b/libs/awmtk2.lua @@ -64,10 +64,10 @@ awmtk.create_template_lib = function(name,parent,overrides) ) end -awmtk.build_templates = function(templates,style) +awmtk.build_templates = function(templates,style,vertical) local new_templates = {} for name,template in pairs(awmtk.proto_templates) do - new_templates[name] = templates[name](style) + new_templates[name] = templates[name](style,vertical) end return new_templates end @@ -232,7 +232,7 @@ awmtk.proto_templates = { },options or {}) end end, - + button = function(style) -- self explanatory. notice that this does not bear any function - -- only the visual part of the button. by design, onpress and onrelease diff --git a/libs/builder.lua b/libs/builder.lua index f319c6e..25d76b0 100644 --- a/libs/builder.lua +++ b/libs/builder.lua @@ -45,16 +45,16 @@ return function(description,opts) local buttons = opts.buttons -- Build a layout given a JSON description, a style and client -- (if applicable) - local layout = {} local test,err = json.decode(description) if not test then error("Builder failure: "..err) end - local function inner_builder(struct) + local function inner_builder(struct,vertical) if struct.widget then -- External widget descriptions return require(struct.widget)(gears.table.join({ layout = (struct.layout and inner_builder(struct.layout)), client = (struct.client and c), - screen = (struct.screen and s) + screen = (struct.screen and s), + vertical = vertical },struct.options or {},opts.passthrough or {})) elseif struct.list then -- List descriptions local list = { @@ -64,11 +64,11 @@ return function(description,opts) )], spacing = style.spacing } - for k,v in pairs(struct.list) do + for _,v in pairs(struct.list) do if v.draggable then list.buttons = buttons else - local new_obj = inner_builder(v) + local new_obj = inner_builder(v,struct.vertical) if new_obj then table.insert(list,new_obj) end @@ -101,7 +101,7 @@ return function(description,opts) if obj.draggable then list[k].buttons = buttons else - local new_obj = inner_builder(obj) + local new_obj = inner_builder(obj,struct.vertical) if new_obj then table.insert(list[k],new_obj) end @@ -120,12 +120,12 @@ return function(description,opts) return builtins[struct.builtin](gears.table.join({ client = (struct.client and c) },struct.options or {})) - end + end -- If this gets interpreted it's safe to say none of the constructions -- above got matched. print("Object where the error occured: ") - gears.debug.dump(struct) + gears.debug.dump(struct) error("Builder error: invalid object description") end - return inner_builder(test,layout),test.context_options + return inner_builder(test),test.context_options end diff --git a/modules/xdg_data.lua b/modules/xdg_data.lua index 87db66d..a2cc0fc 100644 --- a/modules/xdg_data.lua +++ b/modules/xdg_data.lua @@ -6,29 +6,30 @@ -- -- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see . -- Asynchronous XDG data aggregator +local start_human = os.time() +local start_computer = os.clock() local menu_utils = require("menubar.utils") local menu_gen = require("menubar.menu_gen") local awful = require("awful") local gears = require("gears") +local json = require("dkjson") menu_utils.wm_name = "" -- Directories to scan for .desktop files local desktop_dirs = {} local desktop_dirs_complete = 0 -local icon_dirs = {} -((table.concat(gears.filesystem.get_xdg_data_dirs(),":") or - "/usr/share:/usr/local/share")..":"..os.getenv("HOME").."/.local/share"):gsub("[^:]*",function(path) +local _ = ((table.concat(gears.filesystem.get_xdg_data_dirs(),":") or +"/usr/share:/usr/local/share")..":"..os.getenv("HOME").."/.local/share"):gsub("[^:]*",function(path) if gears.filesystem.dir_readable(path.."/applications") then table.insert(desktop_dirs, path.."/applications") end - if gears.filesystem.dir_readable(path.."/icons") then - table.insert(icon_dirs, path.."/icons") - end end) --- Global xdg data cache -xdg = { +-- Global xdg data struct +_G.xdg = { + directory_integrity = {}, + directory_listings = {}, apps = {}, categories = { Other = { @@ -42,7 +43,16 @@ xdg = { } } -for k,v in pairs(menu_gen.all_categories) do +-- Load cached applications +local cache_file = io.open(gears.filesystem.get_xdg_cache_home()..".reno_xdg_cache.json","r") +local cache +if cache_file then + cache = json.decode(cache_file:read("*a")) + cache_file:close() +end + +-- Add missing category entries as defined by awesome +for _,v in pairs(menu_gen.all_categories) do xdg.categories[v.app_type] = { name = v.name, icon = v.icon_name, @@ -51,58 +61,83 @@ for k,v in pairs(menu_gen.all_categories) do end -- Asynchronous scanning process -for k,v in pairs(desktop_dirs) do - awful.spawn.with_line_callback("find "..tostring(v).." -name *.desktop",{ - stdout = function(line) - local data = menu_utils.parse_desktop_file(line) - if data.NoDisplay then - return - end - local appdata = { - name = data.Name, - category = "Other", - exec = data.Exec, - icon = (data.Icon and menu_utils.lookup_icon(data.Icon)), - description = data.Comment - } - -- Match first available cateogry for sorting - for k,v in pairs(data.Categories or {"Other"}) do - if xdg.categories[v] then - appdata.category = v - break +for _,v in pairs(desktop_dirs) do + xdg.directory_listings[v] = {} + awful.spawn.with_line_callback("find "..tostring(v).." -maxdepth 1 -name *.desktop",{ + stdout = function(line) + -- Assume the cache is valid for a listed file + if cache and cache.directory_listings[v][line] then + xdg.directory_listings[v][line] = true + xdg.apps[line] = cache.apps[line] + xdg.categories[cache.apps[line].category].apps[line] = cache.apps[line] + return end - -- Oh how do I love those Wine applications and their categories - if v:match("^Wine") then + local data = menu_utils.parse_desktop_file(line) + if data.NoDisplay then + return + end + local appdata = { + name = data.Name, + category = "Other", + exec = data.Exec, + icon = (data.Icon and menu_utils.lookup_icon(data.Icon)), + description = data.Comment + } + -- Match first available cateogry for sorting + for _,vv in pairs(data.Categories or {"Other"}) do + if xdg.categories[vv] then + appdata.category = vv + break + end + -- Oh how do I love those Wine applications and their categories + if vv:match("^Wine") then + appdata.category = "Wine" + break + end + end + -- Open terminal apps in the terminal (duh) + if data.Terminal then + appdata.exec = global.terminal.." -e "..appdata.exec + end + -- Just for you, Wine - special case because you're being a shit + if (appdata.exec and appdata.exec:find("%W?wine ")) then appdata.category = "Wine" - break end + xdg.apps[line] = appdata + xdg.categories[appdata.category].apps[line] = appdata + -- Add the file to the listing of cached ones + xdg.directory_listings[v][line] = true + end, + output_done = function() + -- Save directory listing hash + desktop_dirs_complete = desktop_dirs_complete + 1 + -- Call a global signal + awesome.emit_signal("xdg::dir_finished",v) end - -- Open terminal apps in the terminal (duh) - if data.Terminal then - appdata.exec = global.terminal.." -e "..appdata.exec - end - -- Just for you, Wine - special case because you're being a shit - if (exec and exec:find("%W?wine ")) then - appdata.category = "Wine" - end - table.insert(xdg.apps,appdata) - table.insert(xdg.categories[appdata.category].apps,appdata) - end, - output_done = function() - -- Call a global signal - desktop_dirs_complete = desktop_dirs_complete + 1 - awesome.emit_signal("xdg::dir_finished",v) - end - }) + }) +end + +local count = function(t) + local n = 0 + for _,_ in pairs(t) do + n = n + 1 + end + return n end + awesome.connect_signal("xdg::dir_finished",function(dir) + -- We only send the all_finished signal when all directories finished processing if desktop_dirs_complete == #desktop_dirs then - awesome.emit_signal("xdg::all_finished") -- Clean up empty categories for k,v in pairs(xdg.categories) do - if #v.apps == 0 then + if count(v.apps) == 0 then xdg.categories[k] = nil end 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 end) diff --git a/themes/widget_calibration/COPYING.txt b/themes/widget_calibration/COPYING.txt new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/themes/widget_calibration/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/widget_calibration/WARNING.txt b/themes/widget_calibration/WARNING.txt new file mode 100644 index 0000000..dd1c576 --- /dev/null +++ b/themes/widget_calibration/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/widget_calibration/background.png b/themes/widget_calibration/background.png new file mode 100644 index 0000000..2ff7836 Binary files /dev/null and b/themes/widget_calibration/background.png differ diff --git a/themes/widget_calibration/config/client_menu.json b/themes/widget_calibration/config/client_menu.json new file mode 100644 index 0000000..a09013b --- /dev/null +++ b/themes/widget_calibration/config/client_menu.json @@ -0,0 +1,8 @@ +{ + "list": [ + {"widget": "widgets.clientvolume"}, + {"widget": "widgets.clientcontrols"}, + {"widget": "widgets.clientbuttons"} + ], + "vertical":true +} diff --git a/themes/widget_calibration/config/global.json b/themes/widget_calibration/config/global.json new file mode 100644 index 0000000..dab1382 --- /dev/null +++ b/themes/widget_calibration/config/global.json @@ -0,0 +1,9 @@ +{ + "widgets.dismal":{ + "x":0, + "y":26 + }, + "widgets.rootmenu":{}, + "widgets.lockscreen":{}, + "widgets.base.keypopup":{} +} diff --git a/themes/widget_calibration/config/lockpanel.json b/themes/widget_calibration/config/lockpanel.json new file mode 100644 index 0000000..9c8ee56 --- /dev/null +++ b/themes/widget_calibration/config/lockpanel.json @@ -0,0 +1,5 @@ +{ + "widgets.lock.clock":{ + "format": "%a %b %d\n %H: %M" + } +} diff --git a/themes/widget_calibration/config/root_menu.json b/themes/widget_calibration/config/root_menu.json new file mode 100644 index 0000000..95a9a1a --- /dev/null +++ b/themes/widget_calibration/config/root_menu.json @@ -0,0 +1,22 @@ +{ + "list": [ + {"widget": "widgets.base.popuptitle", + "options":{ + "title":"Reno Unity" + } + }, + {"widget": "widgets.base.tagswitcher", + "screen":true + }, + {"widget": "widgets.rootcontrols"}, + {"widget": "widgets.xdgmenu", + "options": { + "exclude_category": [ + "Other" + ] + } + }, + {"widget": "widgets.rootbuttons"} + ], + "vertical": true +} diff --git a/themes/widget_calibration/config/root_menu_test.json b/themes/widget_calibration/config/root_menu_test.json new file mode 100644 index 0000000..61e9d2f --- /dev/null +++ b/themes/widget_calibration/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/widget_calibration/config/titlebar_top.json b/themes/widget_calibration/config/titlebar_top.json new file mode 100644 index 0000000..d4a2c11 --- /dev/null +++ b/themes/widget_calibration/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/widget_calibration/config/wibar_bottom.json b/themes/widget_calibration/config/wibar_bottom.json new file mode 100644 index 0000000..f5a276d --- /dev/null +++ b/themes/widget_calibration/config/wibar_bottom.json @@ -0,0 +1,18 @@ +{ + "align": { + "left": [ + { + "widget": "widgets.tasklist", + "screen": true + } + ], + "center": [ + + ], + "right": [ + { + "widget": "widgets.launcher" + } + ] + } +} diff --git a/themes/widget_calibration/config/wibar_left.json b/themes/widget_calibration/config/wibar_left.json new file mode 100644 index 0000000..c24d8b8 --- /dev/null +++ b/themes/widget_calibration/config/wibar_left.json @@ -0,0 +1,19 @@ +{ + "align": { + "left": [ + { + "widget": "widgets.tasklist", + "screen": true + } + ], + "center": [ + + ], + "right": [ + { + "widget": "widgets.launcher" + } + ] + }, + "vertical": true +} diff --git a/themes/widget_calibration/config/wibar_right.json b/themes/widget_calibration/config/wibar_right.json new file mode 100644 index 0000000..9ea59e3 --- /dev/null +++ b/themes/widget_calibration/config/wibar_right.json @@ -0,0 +1,26 @@ +{ + "align": { + "left": [ + { "widget": "widgets.soundclown" } + ], + "center": [ + + ], + "right": [ + { "widget":"widgets.volume" }, + { "widget": "widgets.notifications", + "screen": true + }, + { "widget": "widgets.wallpapers", + "screen": true, + "options": { + "path": "$HOME/Pictures/Wallpapers" + } + }, + { "widget": "widgets.battery" }, + { "widget": "widgets.base.systray" }, + { "widget": "widgets.base.clock" } + ] + }, + "vertical":true +} diff --git a/themes/widget_calibration/config/wibar_top.json b/themes/widget_calibration/config/wibar_top.json new file mode 100644 index 0000000..3dbed26 --- /dev/null +++ b/themes/widget_calibration/config/wibar_top.json @@ -0,0 +1,25 @@ +{ + "align": { + "left": [ + { "widget": "widgets.soundclown" } + ], + "center": [ + + ], + "right": [ + { "widget":"widgets.volume" }, + { "widget": "widgets.notifications", + "screen": true + }, + { "widget": "widgets.wallpapers", + "screen": true, + "options": { + "path": "$HOME/Pictures/Wallpapers" + } + }, + { "widget": "widgets.battery" }, + { "widget": "widgets.base.systray" }, + { "widget": "widgets.base.clock" } + ] + } +} diff --git a/themes/widget_calibration/icons/README b/themes/widget_calibration/icons/README new file mode 100644 index 0000000..7023132 --- /dev/null +++ b/themes/widget_calibration/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/widget_calibration/icons/ac-adapter-symbolic.png b/themes/widget_calibration/icons/ac-adapter-symbolic.png new file mode 100644 index 0000000..a1a4b07 Binary files /dev/null and b/themes/widget_calibration/icons/ac-adapter-symbolic.png differ diff --git a/themes/widget_calibration/icons/action-lock-screen-symbolic.png b/themes/widget_calibration/icons/action-lock-screen-symbolic.png new file mode 100644 index 0000000..cc3cdab Binary files /dev/null and b/themes/widget_calibration/icons/action-lock-screen-symbolic.png differ diff --git a/themes/widget_calibration/icons/action-poweroff-symbolic.png b/themes/widget_calibration/icons/action-poweroff-symbolic.png new file mode 100644 index 0000000..94be34c Binary files /dev/null and b/themes/widget_calibration/icons/action-poweroff-symbolic.png differ diff --git a/themes/widget_calibration/icons/action-suspend-symbolic.png b/themes/widget_calibration/icons/action-suspend-symbolic.png new file mode 100644 index 0000000..1000808 Binary files /dev/null and b/themes/widget_calibration/icons/action-suspend-symbolic.png differ diff --git a/themes/widget_calibration/icons/backlight-symbolic.png b/themes/widget_calibration/icons/backlight-symbolic.png new file mode 100644 index 0000000..4bd29bc Binary files /dev/null and b/themes/widget_calibration/icons/backlight-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-caution-charging-symbolic.png b/themes/widget_calibration/icons/battery-caution-charging-symbolic.png new file mode 100644 index 0000000..6b282dc Binary files /dev/null and b/themes/widget_calibration/icons/battery-caution-charging-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-caution-symbolic.png b/themes/widget_calibration/icons/battery-caution-symbolic.png new file mode 100644 index 0000000..72909e7 Binary files /dev/null and b/themes/widget_calibration/icons/battery-caution-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-empty-charging-symbolic.png b/themes/widget_calibration/icons/battery-empty-charging-symbolic.png new file mode 100644 index 0000000..6628ab9 Binary files /dev/null and b/themes/widget_calibration/icons/battery-empty-charging-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-empty-symbolic.png b/themes/widget_calibration/icons/battery-empty-symbolic.png new file mode 100644 index 0000000..7b88252 Binary files /dev/null and b/themes/widget_calibration/icons/battery-empty-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-full-charged-symbolic.png b/themes/widget_calibration/icons/battery-full-charged-symbolic.png new file mode 100644 index 0000000..1091689 Binary files /dev/null and b/themes/widget_calibration/icons/battery-full-charged-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-full-charging-symbolic.png b/themes/widget_calibration/icons/battery-full-charging-symbolic.png new file mode 100644 index 0000000..8783dae Binary files /dev/null and b/themes/widget_calibration/icons/battery-full-charging-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-full-symbolic.png b/themes/widget_calibration/icons/battery-full-symbolic.png new file mode 100644 index 0000000..1091689 Binary files /dev/null and b/themes/widget_calibration/icons/battery-full-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-good-charging-symbolic.png b/themes/widget_calibration/icons/battery-good-charging-symbolic.png new file mode 100644 index 0000000..8f28dcb Binary files /dev/null and b/themes/widget_calibration/icons/battery-good-charging-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-good-symbolic.png b/themes/widget_calibration/icons/battery-good-symbolic.png new file mode 100644 index 0000000..e6f21da Binary files /dev/null and b/themes/widget_calibration/icons/battery-good-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-low-charging-symbolic.png b/themes/widget_calibration/icons/battery-low-charging-symbolic.png new file mode 100644 index 0000000..e98269d Binary files /dev/null and b/themes/widget_calibration/icons/battery-low-charging-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-low-symbolic.png b/themes/widget_calibration/icons/battery-low-symbolic.png new file mode 100644 index 0000000..1b2f9e3 Binary files /dev/null and b/themes/widget_calibration/icons/battery-low-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery-missing-symbolic.png b/themes/widget_calibration/icons/battery-missing-symbolic.png new file mode 100644 index 0000000..37d01b3 Binary files /dev/null and b/themes/widget_calibration/icons/battery-missing-symbolic.png differ diff --git a/themes/widget_calibration/icons/battery.png b/themes/widget_calibration/icons/battery.png new file mode 100644 index 0000000..4735283 Binary files /dev/null and b/themes/widget_calibration/icons/battery.png differ diff --git a/themes/widget_calibration/icons/mpc-next-symbolic.png b/themes/widget_calibration/icons/mpc-next-symbolic.png new file mode 100644 index 0000000..8d94bc7 Binary files /dev/null and b/themes/widget_calibration/icons/mpc-next-symbolic.png differ diff --git a/themes/widget_calibration/icons/mpc-pause-symbolic.png b/themes/widget_calibration/icons/mpc-pause-symbolic.png new file mode 100644 index 0000000..8e8a97f Binary files /dev/null and b/themes/widget_calibration/icons/mpc-pause-symbolic.png differ diff --git a/themes/widget_calibration/icons/mpc-play-symbolic.png b/themes/widget_calibration/icons/mpc-play-symbolic.png new file mode 100644 index 0000000..5a1cfaf Binary files /dev/null and b/themes/widget_calibration/icons/mpc-play-symbolic.png differ diff --git a/themes/widget_calibration/icons/mpc-previous-symbolic.png b/themes/widget_calibration/icons/mpc-previous-symbolic.png new file mode 100644 index 0000000..73120bf Binary files /dev/null and b/themes/widget_calibration/icons/mpc-previous-symbolic.png differ diff --git a/themes/widget_calibration/icons/notifications-area-symbolic.png b/themes/widget_calibration/icons/notifications-area-symbolic.png new file mode 100644 index 0000000..24341ea Binary files /dev/null and b/themes/widget_calibration/icons/notifications-area-symbolic.png differ diff --git a/themes/widget_calibration/icons/reno.png b/themes/widget_calibration/icons/reno.png new file mode 100644 index 0000000..a5a3fe7 Binary files /dev/null and b/themes/widget_calibration/icons/reno.png differ diff --git a/themes/widget_calibration/icons/unknown-app.png b/themes/widget_calibration/icons/unknown-app.png new file mode 100644 index 0000000..26976ec Binary files /dev/null and b/themes/widget_calibration/icons/unknown-app.png differ diff --git a/themes/widget_calibration/icons/volume-high-symbolic.png b/themes/widget_calibration/icons/volume-high-symbolic.png new file mode 100644 index 0000000..c4638c2 Binary files /dev/null and b/themes/widget_calibration/icons/volume-high-symbolic.png differ diff --git a/themes/widget_calibration/icons/volume-low-symbolic.png b/themes/widget_calibration/icons/volume-low-symbolic.png new file mode 100644 index 0000000..312a08f Binary files /dev/null and b/themes/widget_calibration/icons/volume-low-symbolic.png differ diff --git a/themes/widget_calibration/icons/volume-medium-symbolic.png b/themes/widget_calibration/icons/volume-medium-symbolic.png new file mode 100644 index 0000000..e3e75b4 Binary files /dev/null and b/themes/widget_calibration/icons/volume-medium-symbolic.png differ diff --git a/themes/widget_calibration/icons/volume-muted-symbolic.png b/themes/widget_calibration/icons/volume-muted-symbolic.png new file mode 100644 index 0000000..727b87c Binary files /dev/null and b/themes/widget_calibration/icons/volume-muted-symbolic.png differ diff --git a/themes/widget_calibration/icons/volume.png b/themes/widget_calibration/icons/volume.png new file mode 100644 index 0000000..31cb3f6 Binary files /dev/null and b/themes/widget_calibration/icons/volume.png differ diff --git a/themes/widget_calibration/icons/wallpapers.png b/themes/widget_calibration/icons/wallpapers.png new file mode 100644 index 0000000..26b98a8 Binary files /dev/null and b/themes/widget_calibration/icons/wallpapers.png differ diff --git a/themes/widget_calibration/layouts/cornerne.png b/themes/widget_calibration/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/themes/widget_calibration/layouts/cornerne.png differ diff --git a/themes/widget_calibration/layouts/cornernew.png b/themes/widget_calibration/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/themes/widget_calibration/layouts/cornernew.png differ diff --git a/themes/widget_calibration/layouts/cornernw.png b/themes/widget_calibration/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/themes/widget_calibration/layouts/cornernw.png differ diff --git a/themes/widget_calibration/layouts/cornernww.png b/themes/widget_calibration/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/themes/widget_calibration/layouts/cornernww.png differ diff --git a/themes/widget_calibration/layouts/cornerse.png b/themes/widget_calibration/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/themes/widget_calibration/layouts/cornerse.png differ diff --git a/themes/widget_calibration/layouts/cornersew.png b/themes/widget_calibration/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/themes/widget_calibration/layouts/cornersew.png differ diff --git a/themes/widget_calibration/layouts/cornersw.png b/themes/widget_calibration/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/themes/widget_calibration/layouts/cornersw.png differ diff --git a/themes/widget_calibration/layouts/cornersww.png b/themes/widget_calibration/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/themes/widget_calibration/layouts/cornersww.png differ diff --git a/themes/widget_calibration/layouts/dwindle.png b/themes/widget_calibration/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/themes/widget_calibration/layouts/dwindle.png differ diff --git a/themes/widget_calibration/layouts/dwindlew.png b/themes/widget_calibration/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/themes/widget_calibration/layouts/dwindlew.png differ diff --git a/themes/widget_calibration/layouts/fairh.png b/themes/widget_calibration/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/themes/widget_calibration/layouts/fairh.png differ diff --git a/themes/widget_calibration/layouts/fairhw.png b/themes/widget_calibration/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/themes/widget_calibration/layouts/fairhw.png differ diff --git a/themes/widget_calibration/layouts/fairv.png b/themes/widget_calibration/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/themes/widget_calibration/layouts/fairv.png differ diff --git a/themes/widget_calibration/layouts/fairvw.png b/themes/widget_calibration/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/themes/widget_calibration/layouts/fairvw.png differ diff --git a/themes/widget_calibration/layouts/floating.png b/themes/widget_calibration/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/themes/widget_calibration/layouts/floating.png differ diff --git a/themes/widget_calibration/layouts/floatingw.png b/themes/widget_calibration/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/themes/widget_calibration/layouts/floatingw.png differ diff --git a/themes/widget_calibration/layouts/fullscreen.png b/themes/widget_calibration/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/themes/widget_calibration/layouts/fullscreen.png differ diff --git a/themes/widget_calibration/layouts/fullscreenw.png b/themes/widget_calibration/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/themes/widget_calibration/layouts/fullscreenw.png differ diff --git a/themes/widget_calibration/layouts/magnifier.png b/themes/widget_calibration/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/themes/widget_calibration/layouts/magnifier.png differ diff --git a/themes/widget_calibration/layouts/magnifierw.png b/themes/widget_calibration/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/themes/widget_calibration/layouts/magnifierw.png differ diff --git a/themes/widget_calibration/layouts/max.png b/themes/widget_calibration/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/themes/widget_calibration/layouts/max.png differ diff --git a/themes/widget_calibration/layouts/maxw.png b/themes/widget_calibration/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/themes/widget_calibration/layouts/maxw.png differ diff --git a/themes/widget_calibration/layouts/spiral.png b/themes/widget_calibration/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/themes/widget_calibration/layouts/spiral.png differ diff --git a/themes/widget_calibration/layouts/spiralw.png b/themes/widget_calibration/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/themes/widget_calibration/layouts/spiralw.png differ diff --git a/themes/widget_calibration/layouts/tile.png b/themes/widget_calibration/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/themes/widget_calibration/layouts/tile.png differ diff --git a/themes/widget_calibration/layouts/tilebottom.png b/themes/widget_calibration/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/themes/widget_calibration/layouts/tilebottom.png differ diff --git a/themes/widget_calibration/layouts/tilebottomw.png b/themes/widget_calibration/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/themes/widget_calibration/layouts/tilebottomw.png differ diff --git a/themes/widget_calibration/layouts/tileleft.png b/themes/widget_calibration/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/themes/widget_calibration/layouts/tileleft.png differ diff --git a/themes/widget_calibration/layouts/tileleftw.png b/themes/widget_calibration/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/themes/widget_calibration/layouts/tileleftw.png differ diff --git a/themes/widget_calibration/layouts/tiletop.png b/themes/widget_calibration/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/themes/widget_calibration/layouts/tiletop.png differ diff --git a/themes/widget_calibration/layouts/tiletopw.png b/themes/widget_calibration/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/themes/widget_calibration/layouts/tiletopw.png differ diff --git a/themes/widget_calibration/layouts/tilew.png b/themes/widget_calibration/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/themes/widget_calibration/layouts/tilew.png differ diff --git a/themes/widget_calibration/submenu.png b/themes/widget_calibration/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/themes/widget_calibration/submenu.png differ diff --git a/themes/widget_calibration/taglist/squarefw.png b/themes/widget_calibration/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/themes/widget_calibration/taglist/squarefw.png differ diff --git a/themes/widget_calibration/taglist/squarew.png b/themes/widget_calibration/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/themes/widget_calibration/taglist/squarew.png differ diff --git a/themes/widget_calibration/theme.lua b/themes/widget_calibration/theme.lua new file mode 100644 index 0000000..07cc0a6 --- /dev/null +++ b/themes/widget_calibration/theme.lua @@ -0,0 +1,671 @@ +-- 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 bsize = 50 + +theme.button_bg_focus = { + type = "radial", + from = {bsize/2,-0.5*bsize,bsize/10}, + to = {bsize/2,-0.5*bsize,bsize*2}, + stops = { + { 0 , "#FFFFFFBB"}, + { 0.45, "#DF744E99"}, + { 0.55, "#DF744E99"}, + { 1, "#FFFFFF44"} + } +} + +theme.button_bg_normal = { + type = "radial", + from = {bsize/2,-0.5*bsize,bsize/10}, + to = {bsize/2,-0.2*bsize,bsize*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 = {bsize/2,bsize/(-3),bsize/8}, + to = {bsize/2,bsize/(-5),bsize*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 k,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 k,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 = 26, + width = 60, + 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} + }, + }, + -- }}} + -- {{{ 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 + }, + }, + -- }}} + 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 = { + button = { + width = 160, + height = 44, + margins = 5, + 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), + } + }, + launcher = { + button = { + margins = 5, + 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 + } + }, + lockscreen = { + popup = { + margins = 0 + } + }, + 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, + size = 22, + }, + wibar_left = { + 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/widget_calibration/titlebar/close_focus.png b/themes/widget_calibration/titlebar/close_focus.png new file mode 100644 index 0000000..51b1a80 Binary files /dev/null and b/themes/widget_calibration/titlebar/close_focus.png differ diff --git a/themes/widget_calibration/titlebar/close_normal.png b/themes/widget_calibration/titlebar/close_normal.png new file mode 100644 index 0000000..f6b83d2 Binary files /dev/null and b/themes/widget_calibration/titlebar/close_normal.png differ diff --git a/themes/widget_calibration/titlebar/floating_focus_active.png b/themes/widget_calibration/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/themes/widget_calibration/titlebar/floating_focus_active.png differ diff --git a/themes/widget_calibration/titlebar/floating_focus_inactive.png b/themes/widget_calibration/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/themes/widget_calibration/titlebar/floating_focus_inactive.png differ diff --git a/themes/widget_calibration/titlebar/floating_normal_active.png b/themes/widget_calibration/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/themes/widget_calibration/titlebar/floating_normal_active.png differ diff --git a/themes/widget_calibration/titlebar/floating_normal_inactive.png b/themes/widget_calibration/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/themes/widget_calibration/titlebar/floating_normal_inactive.png differ diff --git a/themes/widget_calibration/titlebar/maximized_focus_active.png b/themes/widget_calibration/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..189d0f4 Binary files /dev/null and b/themes/widget_calibration/titlebar/maximized_focus_active.png differ diff --git a/themes/widget_calibration/titlebar/maximized_focus_inactive.png b/themes/widget_calibration/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..199b853 Binary files /dev/null and b/themes/widget_calibration/titlebar/maximized_focus_inactive.png differ diff --git a/themes/widget_calibration/titlebar/maximized_normal_active.png b/themes/widget_calibration/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..f3832ad Binary files /dev/null and b/themes/widget_calibration/titlebar/maximized_normal_active.png differ diff --git a/themes/widget_calibration/titlebar/maximized_normal_inactive.png b/themes/widget_calibration/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..7af085e Binary files /dev/null and b/themes/widget_calibration/titlebar/maximized_normal_inactive.png differ diff --git a/themes/widget_calibration/titlebar/minimize_focus.png b/themes/widget_calibration/titlebar/minimize_focus.png new file mode 100644 index 0000000..8ec8e4c Binary files /dev/null and b/themes/widget_calibration/titlebar/minimize_focus.png differ diff --git a/themes/widget_calibration/titlebar/minimize_normal.png b/themes/widget_calibration/titlebar/minimize_normal.png new file mode 100644 index 0000000..9d46d90 Binary files /dev/null and b/themes/widget_calibration/titlebar/minimize_normal.png differ diff --git a/themes/widget_calibration/titlebar/ontop_focus_active.png b/themes/widget_calibration/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/themes/widget_calibration/titlebar/ontop_focus_active.png differ diff --git a/themes/widget_calibration/titlebar/ontop_focus_inactive.png b/themes/widget_calibration/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/themes/widget_calibration/titlebar/ontop_focus_inactive.png differ diff --git a/themes/widget_calibration/titlebar/ontop_normal_active.png b/themes/widget_calibration/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/themes/widget_calibration/titlebar/ontop_normal_active.png differ diff --git a/themes/widget_calibration/titlebar/ontop_normal_inactive.png b/themes/widget_calibration/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/themes/widget_calibration/titlebar/ontop_normal_inactive.png differ diff --git a/themes/widget_calibration/titlebar/sticky_focus_active.png b/themes/widget_calibration/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/themes/widget_calibration/titlebar/sticky_focus_active.png differ diff --git a/themes/widget_calibration/titlebar/sticky_focus_inactive.png b/themes/widget_calibration/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/themes/widget_calibration/titlebar/sticky_focus_inactive.png differ diff --git a/themes/widget_calibration/titlebar/sticky_normal_active.png b/themes/widget_calibration/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/themes/widget_calibration/titlebar/sticky_normal_active.png differ diff --git a/themes/widget_calibration/titlebar/sticky_normal_inactive.png b/themes/widget_calibration/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/themes/widget_calibration/titlebar/sticky_normal_inactive.png differ diff --git a/widgets/base/base.lua b/widgets/base/base.lua index 08383f2..bd07f6f 100644 --- a/widgets/base/base.lua +++ b/widgets/base/base.lua @@ -15,7 +15,7 @@ local beautiful = require("beautiful") return function(args) local style = awmtk2.create_style("base",awmtk2.default,args.style) local templates = awmtk2.create_template_lib("base",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(t.textbox({markup = "Why are you loading this widget bruh"}))) return widget end diff --git a/widgets/base/clock.lua b/widgets/base/clock.lua index 964dd06..5b336c7 100644 --- a/widgets/base/clock.lua +++ b/widgets/base/clock.lua @@ -19,7 +19,7 @@ return function(args) local style = awmtk2.create_style("clock", awmtk2.generic.status_widget,args.style) local templates = awmtk2.create_template_lib("clock",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- Don't mind me just stealing default library code local format = args.format or "%a %b %d, %H:%M" local refresh = args.refresh or 60 diff --git a/widgets/base/popuptitle.lua b/widgets/base/popuptitle.lua index 5fb70cb..f536fd2 100644 --- a/widgets/base/popuptitle.lua +++ b/widgets/base/popuptitle.lua @@ -17,7 +17,7 @@ return function(args) local style = awmtk2.create_style("popuptitle", awmtk2.generic.oneline_widget,args.style) local templates = awmtk2.create_template_lib("popuptitle",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget if not args.vertical then widget = wibox.widget(t.container(t.article({ diff --git a/widgets/base/subpanel.lua b/widgets/base/subpanel.lua index 867200d..3958681 100644 --- a/widgets/base/subpanel.lua +++ b/widgets/base/subpanel.lua @@ -16,7 +16,7 @@ return function(args) local style = awmtk2.create_style("subpanel", awmtk2.generic.composite_widget,args.style) local templates = awmtk2.create_template_lib("subpanel",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(args.layout)) return widget end diff --git a/widgets/base/systray.lua b/widgets/base/systray.lua index 97dbf18..ee95267 100644 --- a/widgets/base/systray.lua +++ b/widgets/base/systray.lua @@ -16,7 +16,7 @@ return function(args) local style = awmtk2.create_style("systray", awmtk2.generic.status_widget,args.style) local templates = awmtk2.create_template_lib("systray",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container({ widget = wibox.widget.systray })) diff --git a/widgets/base/tagswitcher.lua b/widgets/base/tagswitcher.lua index 9acebb3..816cbb2 100644 --- a/widgets/base/tagswitcher.lua +++ b/widgets/base/tagswitcher.lua @@ -16,7 +16,7 @@ return function(args) local style = awmtk2.create_style("taglist", awmtk2.generic.oneline_widget,args.style) local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container(awful.widget.taglist({ screen = args.screen, filter = awful.widget.taglist.filter.all, diff --git a/widgets/battery.lua b/widgets/battery.lua index f0f3384..1e923f6 100644 --- a/widgets/battery.lua +++ b/widgets/battery.lua @@ -45,7 +45,7 @@ return function(args) local style = awmtk2.create_style("battery", awmtk2.generic.popup,args.style) local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- set up popup layout local layout = wibox.widget({ layout = wibox.layout.fixed.vertical, @@ -58,7 +58,7 @@ return function(args) local style = awmtk2.create_style("battery", awmtk2.generic.status_widget,args.style) local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) battery_widget = wibox.widget(t.button({ { image = beautiful["battery-missing-symbolic"], diff --git a/widgets/clientbuttons.lua b/widgets/clientbuttons.lua index 6eec232..4057aed 100644 --- a/widgets/clientbuttons.lua +++ b/widgets/clientbuttons.lua @@ -14,7 +14,7 @@ return function(args) local style = awmtk2.create_style("client_buttons", awmtk2.generic.button_list,args.style) local templates = awmtk2.create_template_lib("client_buttons",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + 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 diff --git a/widgets/clientcontrols.lua b/widgets/clientcontrols.lua index 28fc832..1af37d3 100644 --- a/widgets/clientcontrols.lua +++ b/widgets/clientcontrols.lua @@ -17,7 +17,7 @@ return function(args) local style = awmtk2.create_style("client_controls", awmtk2.generic.menu,args.style) local templates = awmtk2.create_template_lib("client_controls",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + 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) diff --git a/widgets/clientmenu.lua b/widgets/clientmenu.lua index 5a3b5e9..e5c54da 100644 --- a/widgets/clientmenu.lua +++ b/widgets/clientmenu.lua @@ -8,15 +8,12 @@ -- Client context menu base 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") local builder = require("builder") local style = awmtk2.create_style("client_menu", awmtk2.generic.composite_widget,{}) local templates = awmtk2.create_template_lib("client_menu",awmtk2.templates,{}) -local t = awmtk2.build_templates(templates,style) +local t = awmtk2.build_templates(templates,style,false) -- Create a global context menu for clients first -- This saves us memory on not creating separate menus for every client diff --git a/widgets/clientvolume.lua b/widgets/clientvolume.lua index 19e53b2..8619ba6 100644 --- a/widgets/clientvolume.lua +++ b/widgets/clientvolume.lua @@ -40,7 +40,7 @@ return function(args) local style = awmtk2.create_style("client_volume", awmtk2.generic.oneline_widget, args.style) local templates = awmtk2.create_template_lib("client_volume",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.container({ t.center({ id = "client_volume_icon", @@ -68,7 +68,7 @@ return function(args) awful.spawn.easy_async("pactl list sink-inputs",function(stdout) local pactl_data = fastyaml(stdout) local cl - for k,v in pairs(pactl_data) do + 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 diff --git a/widgets/dismal.lua b/widgets/dismal.lua index 4c67664..4177cdc 100644 --- a/widgets/dismal.lua +++ b/widgets/dismal.lua @@ -11,16 +11,17 @@ local awmtk2 = require("awmtk2") local wibox = require("wibox") local gears = require("gears") local awful = require("awful") -local beautiful = require("beautiful") local ask = require("asckey") local xdg_search = function(name,rlimit) local results = {} - for k,v in pairs(xdg.apps) do + local count = 0 + for _,v in pairs(xdg.apps) do if v.name:lower():find(name,nil,true) then + count = count + 1 table.insert(results,v) end - if rlimit <= #results then + if rlimit <= count then break end end @@ -31,29 +32,11 @@ return function(args) local style = awmtk2.create_style("dismal", awmtk2.generic.popup,args.style) local templates = awmtk2.create_template_lib("dismal",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) - local launchpad = awful.popup(t.popup({ - t.container { - t.textbox({ - text = "", - id = "inputbox" - }), - layout = wibox.layout.fixed.vertical, - }, - t.container({ - id = "resultbox", - layout = wibox.layout.fixed.vertical, - spacing = style.container.spacing - },{ - bg = style.container.bg_highlight, - bgimage = style.container.bgimage_highlight, - forced_width = style.button.width or 180 - }), - t.textbox({ - markup = "Enter - run\nCtrl+Enter - run in terminal" - }), - spacing = style.container.spacing, - layout = wibox.layout.fixed.vertical + local t = awmtk2.build_templates(templates,style,args.vertical) + local dismal = awful.popup(t.popup({ + id = "dismal_root", + layout = wibox.layout.fixed.horizontal, + spacing = style.container.spacing })) local button_cache = gears.cache(function(name,exec,description,icon) -- beacause apparently cache doesn't allow nil values @@ -64,11 +47,11 @@ return function(args) resize = true, title = name, description = description, - icon_size = (style.button.height and - (style.button.height-style.button.margins)) or - 34-style.button.margins + icon_size = (style.button.height and + (style.button.height-style.button.margins)) or + (34-style.button.margins) }),{ - forced_height = style.button.height or 30 + forced_height = style.button.height or 30 })) local exec = exec:gsub("%%%w","") -- theme-declared highlight function, because why not @@ -80,13 +63,13 @@ return function(args) gears.table.join( awful.button({},1,function() awful.spawn(exec) - launchpad.visible = false + dismal.visible = false -- i know it's deprecated, you literally give me no option awful.keygrabber.stop() end), awful.button({"Control"},1,function() awful.spawn({global.terminal,"-e",exec}) - launchpad.visible = false + dismal.visible = false awful.keygrabber.stop() end), awful.button({},3,function() @@ -99,54 +82,96 @@ return function(args) ) return widget end) - local modifiers = {} - local results_list = launchpad.widget:get_children_by_id("resultbox")[1] - local input_field = launchpad.widget:get_children_by_id("inputbox")[1] - root.keys(gears.table.join( - root.keys(), - ask.k(":dismal.run", function() - results_list:reset() - launchpad.visible = true - launchpad.x = args.x or 0 - launchpad.y = args.y or 0 - if launchpad.visible then - awful.prompt.run { - prompt = "Run: ", - textbox = input_field, - hooks = { - { { "Control" }, "Return", function(cmd) - awful.spawn({global.terminal, "-e", cmd}) - end}, - { { }, "Return", function(cmd) - awful.spawn.with_shell(cmd) - end}, - { {}, 'Escape', function(cmd) - input_field.markup = "" - end}, - }, - done_callback = function() - launchpad.visible = false - end, - changed_callback = function(command) - local results = xdg_search(command,args.result_limit or 5) - results_list:reset() - for k,v in pairs(results) do - results_list:insert(1,button_cache:get( - v.name, - v.exec, - v.description or "", - v.icon or "" - )) - end - end, - completion_callback = function(before,after,ncomp) - return awful.completion.shell(before,after,ncomp,global.shell) - end, - history_path = "/tmp/.dismal_history", - history_max = 50 - } - end - end,{description = "open run menu", group = "widgets"}) - )) - return launchpad + local launchpad + do -- Primary area + launchpad = wibox.widget({ + t.container { + t.textbox({ + text = "", + id = "inputbox" + }), + layout = wibox.layout.fixed.vertical, + }, + t.container({ + id = "resultbox", + layout = wibox.layout.fixed.vertical, + spacing = style.container.spacing + },{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight, + forced_width = style.button.width or 180 + }), + t.textbox({ + markup = "Enter - run\nCtrl+Enter - run in terminal" + }), + spacing = style.container.spacing, + layout = wibox.layout.fixed.vertical + }) + local results_list = launchpad:get_children_by_id("resultbox")[1] + local input_field = launchpad:get_children_by_id("inputbox")[1] + root.keys(gears.table.join( + root.keys(), + ask.k(":dismal.run", function() + results_list:reset() + launchpad.visible = true + launchpad.x = args.x or 0 + launchpad.y = args.y or 0 + if launchpad.visible then + awful.prompt.run { + prompt = "Run: ", + textbox = input_field, + hooks = { + { { "Control" }, "Return", function(cmd) + awful.spawn({global.terminal, "-e", cmd}) + end}, + { { }, "Return", function(cmd) + awful.spawn.with_shell(cmd) + end}, + { {}, 'Escape', function() + input_field.markup = "" + end}, + }, + done_callback = function() + dismal:emit_signal("sorted_refresh") + launchpad.visible = false + end, + changed_callback = function(command) + local results = xdg_search(command,args.result_limit or 5) + results_list:reset() + for _,v in pairs(results) do + results_list:insert(1,button_cache:get( + v.name, + v.exec, + v.description or "", + v.icon or "" + )) + end + end, + completion_callback = function(before,after,ncomp) + return awful.completion.shell(before,after,ncomp,global.shell) + end, + history_path = (gears.filesystem.get_xdg_cache_home() or "/tmp/")..".dismal_history", + history_max = 50 + } + end + end,{description = "open run menu", group = "widgets"}) + )) + end + local sorted + do -- sorting tab + sorted = wibox.widget({ + t.container({ + id = "sortingbox", + layout = wibox.layout.fixed.vertical, + spacing = style.container.spacing + },{ + bg = style.container.bg_highlight, + bgimage = style.container.bgimage_highlight, + forced_width = style.button.width or 180 + }), + spacing = style.container.spacing, + layout = wibox.layout.fixed.vertical + }) + end + return dismal end diff --git a/widgets/launcher.lua b/widgets/launcher.lua index 5b1322c..4c5aad1 100644 --- a/widgets/launcher.lua +++ b/widgets/launcher.lua @@ -26,7 +26,7 @@ return function(args) local style = awmtk2.create_style("launcher", awmtk2.generic.button_list, args.style) local templates = awmtk2.create_template_lib("launcher", awmtk2.templates, args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local w = wibox.widget({ layout = ((args.vertical and wibox.layout.fixed.vertical) or diff --git a/widgets/lock/clock.lua b/widgets/lock/clock.lua index 82df2e9..4632b3a 100644 --- a/widgets/lock/clock.lua +++ b/widgets/lock/clock.lua @@ -19,7 +19,7 @@ return function(args) local style = awmtk2.create_style("lock_clock", awmtk2.generic.status_widget,args.style) local templates = awmtk2.create_template_lib("lock_clock",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- Don't mind me just stealing default library code local format = args.format or "%a %b %d, %H:%M" local refresh = args.refresh or 60 diff --git a/widgets/lockscreen.lua b/widgets/lockscreen.lua index 7fa110b..b1318ca 100644 --- a/widgets/lockscreen.lua +++ b/widgets/lockscreen.lua @@ -34,7 +34,7 @@ local function _preload(args) local style = awmtk2.create_style("lockbar", awmtk2.generic.composite_widget, args.style) local templates = awmtk2.create_template_lib("lockbar",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local config_file = io.open(config_path,"r") local config = config_file:read("*a") config_file:close() @@ -54,7 +54,7 @@ local function _preload(args) local style = awmtk2.create_style("lockpanel", awmtk2.generic.composite_widget, args.style) local templates = awmtk2.create_template_lib("lockpanel",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local config_path = root_path.."/themes/"..global.theme.."/config/lockpanel.json" local lockpanel if readable(config_path) then @@ -159,7 +159,7 @@ local function _preload(args) do -- {{{ Lock screen root local style = awmtk2.create_style("lockscreen", awmtk2.default, args.style) local templates = awmtk2.create_template_lib("lockscreen",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local wallpaper if readable(root_path.."/wallpaper.txt") then wallpaper_f = io.open(root_path.."/wallpaper.txt","r") diff --git a/widgets/notifications.lua b/widgets/notifications.lua index 303ec19..99787df 100644 --- a/widgets/notifications.lua +++ b/widgets/notifications.lua @@ -18,7 +18,7 @@ return function(args) local style = awmtk2.create_style("notifications", awmtk2.generic.popup,args.style) local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local layout = wibox.widget({ layout = wibox.layout.fixed.vertical, spacing = style.base.spacing @@ -90,7 +90,7 @@ return function(args) local style = awmtk2.create_style("notifications", awmtk2.generic.iconified_widget,args.style) local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) clip_widget = wibox.widget(t.button({ image = beautiful["notifications-area-symbolic"], resize = true, diff --git a/widgets/rootbuttons.lua b/widgets/rootbuttons.lua index 3cb9bce..a288e58 100644 --- a/widgets/rootbuttons.lua +++ b/widgets/rootbuttons.lua @@ -16,7 +16,7 @@ return function(args) local style = awmtk2.create_style("root_buttons", 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) + local t = awmtk2.build_templates(templates,style,args.vertical) local poweroff = wibox.widget(t.button({ image = beautiful["action-poweroff-symbolic"], widget = wibox.widget.imagebox, diff --git a/widgets/rootcontrols.lua b/widgets/rootcontrols.lua index 0bd2a88..e502ded 100644 --- a/widgets/rootcontrols.lua +++ b/widgets/rootcontrols.lua @@ -17,7 +17,7 @@ return function(args) local style = awmtk2.create_style("root_menu", awmtk2.generic.menu,args.style) local templates = awmtk2.create_template_lib("root_menu",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = menugen({ items = { {"Awesome", { diff --git a/widgets/rootmenu.lua b/widgets/rootmenu.lua index ffe2fc5..033ff13 100644 --- a/widgets/rootmenu.lua +++ b/widgets/rootmenu.lua @@ -17,7 +17,7 @@ return function(args) local style = awmtk2.create_style("root_menu", awmtk2.generic.composite_widget,{}) local templates = awmtk2.create_template_lib("root_menu",awmtk2.templates,{}) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local config_file = io.open(root_path.."/themes/"..global.theme.."/config/root_menu.json","r") local config if config_file then diff --git a/widgets/soundclown.lua b/widgets/soundclown.lua index 59bf704..a74e556 100644 --- a/widgets/soundclown.lua +++ b/widgets/soundclown.lua @@ -18,7 +18,7 @@ return function(args) local style = awmtk2.create_style("soundclown", awmtk2.generic.oneline_widget,args.style) local templates = awmtk2.create_template_lib("soundclown",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local test = os.execute("mpc help") if type(test) == "number" then test = (test == 0) diff --git a/widgets/start/xdgmenu.lua b/widgets/start/xdgmenu.lua index d252ca2..cde99f2 100644 --- a/widgets/start/xdgmenu.lua +++ b/widgets/start/xdgmenu.lua @@ -18,7 +18,7 @@ return function(args) local style = awmtk2.create_style("xdg_menu", awmtk2.generic.menu,args.style) local templates = awmtk2.create_template_lib("xdg_menu",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- Add a "loading" indicator while XDG is still parsing data local widget = wibox.widget({ t.container({ diff --git a/widgets/startbutton.lua b/widgets/startbutton.lua index 2a4b447..a9bcdfc 100644 --- a/widgets/startbutton.lua +++ b/widgets/startbutton.lua @@ -19,7 +19,7 @@ return function(args) local style = awmtk2.create_style("startbutton", awmtk2.generic.popup,args.style) local templates = awmtk2.create_template_lib("startbutton",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local config_file = io.open(root_path.."/themes/"..global.theme.."/config/startbutton.lua","r") local config if config_file then @@ -61,7 +61,7 @@ return function(args) local style = awmtk2.create_style("startbutton", awmtk2.generic.iconified_widget,args.style) local templates = awmtk2.create_template_lib("startbutton",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget(t.button(t.article({ icon = style.article.icon, title = style.article.title or "Start" diff --git a/widgets/tasklist.lua b/widgets/tasklist.lua index 39f3368..eac94dd 100644 --- a/widgets/tasklist.lua +++ b/widgets/tasklist.lua @@ -34,7 +34,7 @@ return function(args) local style = awmtk2.create_style("tasklist", awmtk2.generic.oneline_widget, args.style) local templates = awmtk2.create_template_lib("tasklist", awmtk2.templates, args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local button = t.button({ { { diff --git a/widgets/volume.lua b/widgets/volume.lua index 6e467f4..614d9ac 100644 --- a/widgets/volume.lua +++ b/widgets/volume.lua @@ -10,15 +10,13 @@ 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 pactl_data = {} local test_pactl = os.execute("pactl --version") local pactl_found = test_pactl if _VERSION:match("5.1") then - pactl_found = (test_pactl == 0) + pactl_found = (test_pactl == 0) end local test_amixer = os.execute("amixer --version") local amixer_found = test_amixer @@ -47,7 +45,7 @@ return function(args) local style = awmtk2.create_style("volume", awmtk2.generic.oneline_widget, args.style) local templates = awmtk2.create_template_lib("volume",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) local widget = wibox.widget({ t.button({ image = get_icon(0), @@ -62,12 +60,17 @@ return function(args) id = "volume", value = -1 }), - layout = wibox.layout.fixed.horizontal + layout = (args.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal },{ visible = false, id = "slidercontainer" }), - layout = wibox.layout.fixed.horizontal + t.textbox({ + markup = "nassal" + }), + layout = (args.veritcal and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal }) local icon = widget:get_children_by_id("volume_icon")[1] local slider = widget:get_children_by_id("volume")[1] diff --git a/widgets/wallpapers.lua b/widgets/wallpapers.lua index 8eb4b43..4da7018 100644 --- a/widgets/wallpapers.lua +++ b/widgets/wallpapers.lua @@ -31,7 +31,7 @@ return function(args) local style = awmtk2.create_style("wallpapers", awmtk2.generic.popup,args.style) local templates = awmtk2.create_template_lib("wallpapers",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- set wallpaper local fhandler = io.open(root_path.."/wallpaper.txt","r") if fhandler then @@ -128,7 +128,7 @@ return function(args) local style = awmtk2.create_style("wallpapers", awmtk2.generic.iconified_widget,args.style) local templates = awmtk2.create_template_lib("wallpapers",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) clip_widget = wibox.widget(t.button({ image = beautiful.wallpapers_icon, resize = true, diff --git a/widgets/xdgmenu.lua b/widgets/xdgmenu.lua index 4c812d4..e718d71 100644 --- a/widgets/xdgmenu.lua +++ b/widgets/xdgmenu.lua @@ -9,16 +9,22 @@ 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") local menuutils = require("menubar").utils +local count = function(t) + local n = 0 + for _,_ in pairs(t) do + n = n + 1 + end + return n +end + return function(args) local style = awmtk2.create_style("xdg_menu", awmtk2.generic.menu,args.style) local templates = awmtk2.create_template_lib("xdg_menu",awmtk2.templates,args.templates) - local t = awmtk2.build_templates(templates,style) + local t = awmtk2.build_templates(templates,style,args.vertical) -- Add a "loading" indicator while XDG is still parsing data local widget = wibox.widget({ t.container({ @@ -29,9 +35,8 @@ return function(args) spacing = style.base.spacing, id = "xdg_menu_root" }) - local function exclude(name) - for k,v in pairs(args.exclude or {}) do + for _,v in pairs(args.exclude or {}) do if name:match(v) then return true end @@ -44,12 +49,12 @@ return function(args) local items = {} for k,v in pairs(xdg.categories) do local noprocess = false - for k2,v2 in pairs(args.exclude_category or {}) do + for _,v2 in pairs(args.exclude_category or {}) do if k == v2 then noprocess = true end end - if (not noprocess) and (#v.apps > 0) then + if (not noprocess) and (count(v.apps) > 0) then local category = {k,{},menuutils.lookup_icon_uncached(v.icon)} for _,item in pairs(v.apps) do if not exclude(item.name) then @@ -70,7 +75,7 @@ return function(args) items = items, })) local menu_root = menu:get_children_by_id("menu_root")[1] - for k,v in pairs(menu_root.children) do + for _,v in pairs(menu_root.children) do v:connect_signal("cascade::kill",function() args.parent.visible = false end)