8 Commits
Author | SHA1 | Message | Date |
---|---|---|---|
Yessiest | e4ed68daf0 |
Hotfix: removed debugging messages
|
8 months ago |
Yessiest | c7d942050c |
Fixed client volume widget; Added dynamic slider creation for media types
|
8 months ago |
Yessiest | 25c44f100a |
Fixed a couple links in the README
|
9 months ago |
Yessiest | 3fdad6db65 |
Added some extra guidelines on styling your apps
|
9 months ago |
Yessiest | f9e933bebf |
Fixed README.md, fixed multiple typos, set sensible defaults for desktop.conf
|
9 months ago |
Yessiest | 1b7cc116dc |
updated desktop file to be more TOML compliant
|
10 months ago |
Yessiest | fc811359ae |
more compliant conf parser and smart autominimization of apps on boot
|
10 months ago |
Yessiest | 08c4d52480 |
Button to reload xdg cache + licensing stuff
|
11 months ago |
27 changed files with 713 additions and 326 deletions
-
23README.md
-
128desktop.conf
-
4extra/README.md
-
12libs/awmtk2.lua
-
8libs/digger.lua
-
7libs/imagemagick_blur.lua
-
29libs/parser_test.lua
-
98libs/parsers.lua
-
137libs/xdg_data.lua
-
85modules/autostart.lua
-
7modules/macros.lua
-
2modules/powermanX.lua
-
12modules/rules_stub.lua
-
7modules/tiling.lua
-
99modules/xdg_data.lua
-
2rc.lua
-
2themes/reno98/theme.lua
-
3themes/unity_mate/theme.lua
-
7widgets/base/layout.lua
-
2widgets/base/systray.lua
-
280widgets/clientmenu/volume.lua
-
4widgets/desktop/battery.lua
-
17widgets/desktop/tasklist.lua
-
4widgets/lock/clock.lua
-
2widgets/rootmenu.lua
-
51widgets/rootmenu/controls.lua
-
7widgets/supermenu/applications-tab.lua
@ -0,0 +1,137 @@ |
|||
-- 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 <https://www.gnu.org/licenses/>. |
|||
-- Asynchronous XDG data aggregator (library) |
|||
local menu_utils = require("menubar.utils") |
|||
local awful = require("awful") |
|||
local gears = require("gears") |
|||
local json = require("dkjson") |
|||
local lib = {} |
|||
|
|||
function lib.init_xdg_struct() |
|||
-- Global xdg data struct |
|||
local xdg = { |
|||
directory_integrity = {}, |
|||
directory_listings = {}, |
|||
apps = {}, |
|||
categories = { |
|||
Other = { |
|||
icon = "applications-other", |
|||
apps = {} |
|||
}, |
|||
Wine = { |
|||
icon = "wine", |
|||
apps = {} |
|||
} |
|||
} |
|||
} |
|||
return xdg |
|||
end |
|||
|
|||
function lib.load_xdg_cache() |
|||
-- 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 |
|||
return cache |
|||
end |
|||
|
|||
function lib.add_categories(xdg, categories) |
|||
-- Add missing category entries as defined by awesome |
|||
for _,v in pairs(categories) do |
|||
xdg.categories[v.app_type] = { |
|||
name = v.name, |
|||
icon = v.icon_name, |
|||
apps = {} |
|||
} |
|||
end |
|||
end |
|||
|
|||
function lib.async_process_dirs(xdg, dirs, cache, on_dir_done) |
|||
-- Asynchronous scanning process |
|||
for _,v in pairs(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 |
|||
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" |
|||
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(...) on_dir_done(v,...) end |
|||
}) |
|||
end |
|||
end |
|||
|
|||
function lib.generate_meta_patch(xdg) |
|||
local patch = {apps = {}} |
|||
for k,v in pairs(xdg.apps) do |
|||
patch.apps[k] = {} |
|||
for kk,vv in pairs(v) do |
|||
patch.apps[k][kk] = vv |
|||
end |
|||
patch.apps[k].name = nil |
|||
patch.apps[k].category = nil |
|||
patch.apps[k].exec = nil |
|||
patch.apps[k].icon = nil |
|||
patch.apps[k].description = nil |
|||
end |
|||
return patch |
|||
end |
|||
|
|||
function lib.apply_meta_patch(xdg,patch) |
|||
for k,v in pairs(patch.apps) do |
|||
if xdg.apps[k] then |
|||
for kk,vv in pairs(v) do |
|||
xdg.apps[k][kk] = vv |
|||
end |
|||
end |
|||
end |
|||
end |
|||
|
|||
return lib |
@ -1,2 +1,9 @@ |
|||
-- 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 <https://www.gnu.org/licenses/>. |
|||
local awful = require("awful") |
|||
return function(args) return awful.widget.layoutbox(args.screen) end |
Write
Preview
Loading…
Cancel
Save
Reference in new issue