Yessiest
1 year ago
31 changed files with 583 additions and 51 deletions
-
4README.md
-
42desktop.conf
-
44libs/asckey.lua
-
11libs/imagemagick_blur.lua
-
16macros/macro1
-
5macros/macro2
-
5macros/macro3
-
2modules/autostart.lua
-
5modules/base.lua
-
52modules/binds.lua
-
156modules/macros.lua
-
12modules/rules_stub.lua
-
8modules/static_tags.lua
-
12modules/tiling.lua
-
2modules/xdg_data.lua
-
2rc.lua
-
1themes/reno98/config/wibar_top.json
-
2themes/reno98/theme.lua
-
1themes/serenity/config/wibar_top.json
-
2themes/serenity/theme.lua
-
3themes/unity/config/wibar_top.json
-
2themes/unity/theme.lua
-
3themes/unity_mate/config/global.json
-
3themes/unity_mate/config/supermenu.json
-
3themes/unity_mate/config/wibar_top.json
-
2themes/unity_mate/theme.lua
-
2widgets/base/layout.lua
-
6widgets/desktop/soundclown.lua
-
43widgets/desktop/volume.lua
-
114widgets/supermenu.lua
-
69widgets/supermenu/applications-tab.lua
@ -0,0 +1,11 @@ |
|||||
|
-- If possible, try to blur the image and return its path via callback. Relies on ImageMagick |
||||
|
local awful = require("awful") |
||||
|
return function(image_path,callback) |
||||
|
local blurred_wallpaper_path = "/tmp/.blur_"..image_path:match("[^/]$") |
||||
|
if select(3,os.execute("convert -version")) == 0 then |
||||
|
awful.spawn.easy_async("convert "..image_path.." -blur 0x10 "..blurred_wallpaper_path,function() |
||||
|
callback(blurred_wallpaper_path) |
||||
|
end) |
||||
|
end |
||||
|
return image_path |
||||
|
end |
@ -0,0 +1,16 @@ |
|||||
|
loop=false |
||||
|
delay=10 |
||||
|
-KP_Left |
||||
|
-Right |
||||
|
+Right |
||||
|
-Right |
||||
|
+BackSpace |
||||
|
-BackSpace |
||||
|
+p |
||||
|
-p |
||||
|
+space |
||||
|
-space |
||||
|
+- |
||||
|
-- |
||||
|
+r |
||||
|
-r |
@ -0,0 +1,5 @@ |
|||||
|
loop=true |
||||
|
delay=10 |
||||
|
-KP_Begin |
||||
|
+v |
||||
|
-v |
@ -0,0 +1,5 @@ |
|||||
|
loop=true |
||||
|
delay=10 |
||||
|
-KP_Right |
||||
|
+c |
||||
|
-c |
@ -0,0 +1,156 @@ |
|||||
|
local awful = require("awful") |
||||
|
local gears = require("gears") |
||||
|
local ask = require("asckey") |
||||
|
local fs = gears.filesystem |
||||
|
|
||||
|
_G.MacroTimer = {} |
||||
|
_G.MacroActive = {} |
||||
|
|
||||
|
local mconf = config.macros |
||||
|
|
||||
|
local macro_loop = false |
||||
|
local macro_delay = mconf.step or 10 |
||||
|
local macro_base_dir = mconf.base_dir or (root_path.."/macros/") |
||||
|
|
||||
|
if not fs.dir_readable(root_path.."/macros/") then |
||||
|
fs.make_directories(root_path.."/macros/") |
||||
|
end |
||||
|
|
||||
|
awesome.connect_signal("macro::record",function(filename) |
||||
|
if not filename then return end |
||||
|
local timeline = "loop="..tostring(macro_loop).."\n".. |
||||
|
"delay="..tostring(macro_delay).."\n" |
||||
|
require("naughty").notify({title = |
||||
|
"Recording macro ".. |
||||
|
tostring(filename).. |
||||
|
" (Escape to stop)" |
||||
|
}) |
||||
|
awful.keygrabber { |
||||
|
autostart = true, |
||||
|
stop_key = "Escape", |
||||
|
keypressed_callback = function(self, mod, key, event) |
||||
|
if key == " " then |
||||
|
key = "space" |
||||
|
end |
||||
|
timeline = timeline.."+"..key.."\n" |
||||
|
end, |
||||
|
keyreleased_callback = function(self, mod, key, event) |
||||
|
if key == " " then |
||||
|
key = "space" |
||||
|
end |
||||
|
timeline = timeline.."-"..key.."\n" |
||||
|
end, |
||||
|
stop_callback = function() |
||||
|
local macrofile = io.open(filename,"w") |
||||
|
if macrofile then |
||||
|
macrofile:write(timeline) |
||||
|
macrofile:close() |
||||
|
require("naughty").notify({title="Macro saved as "..tostring(filename)}) |
||||
|
else |
||||
|
require("naughty").notify({title="Failed to save macro"}) |
||||
|
end |
||||
|
-- For some reason after keygrabber is done input doesn't work |
||||
|
gears.timer.delayed_call(function() |
||||
|
awful.keygrabber:stop() |
||||
|
end) |
||||
|
end |
||||
|
} |
||||
|
end) |
||||
|
|
||||
|
awesome.connect_signal("macro::play",function(filename) |
||||
|
if (not filename) or (not fs.file_readable(filename)) then |
||||
|
return |
||||
|
end |
||||
|
local macrofile = io.open(filename,"r") |
||||
|
local macrodata = macrofile:read("*a") |
||||
|
macrofile:close() |
||||
|
local macro = {} |
||||
|
local step = 0 |
||||
|
macrodata:gsub("([^\n]+)",function(line) |
||||
|
table.insert(macro,line) |
||||
|
end) |
||||
|
local delay = tonumber(macro[2]:match("delay=(%d+)")) |
||||
|
_G.MacroActive[filename] = (macro[1]:match("loop=(.+)") == "true") |
||||
|
table.remove(macro,2) |
||||
|
table.remove(macro,1) |
||||
|
local macro_length = #macro |
||||
|
_G.MacroTimer[filename] = gears.timer.start_new((1/1000)*delay,function() |
||||
|
step = step + 1 |
||||
|
local instruction = macro[step] |
||||
|
local event = (instruction:match("^%+") and "key_press") or "key_release" |
||||
|
root.fake_input(event,instruction:match("^[%+%-](.*)")) |
||||
|
if (step == macro_length) and (_G.MacroActive[filename]) then |
||||
|
step = 0 |
||||
|
return true |
||||
|
elseif (step < macro_length) then |
||||
|
return true |
||||
|
else |
||||
|
_G.MacroTimer[filename] = nil |
||||
|
_G.MacroActive[filename] = nil |
||||
|
return false |
||||
|
end |
||||
|
end) |
||||
|
end) |
||||
|
|
||||
|
|
||||
|
root.keys(gears.table.join( |
||||
|
root.keys(), |
||||
|
ask.k(":macro.record_1", function() |
||||
|
awesome.emit_signal("macro::record",macro_base_dir.."macro1") |
||||
|
end,{group="macros",description="Record macro 1"}), |
||||
|
ask.k(":macro.record_2", function() |
||||
|
awesome.emit_signal("macro::record",macro_base_dir.."macro2") |
||||
|
end,{group="macros",description="Record macro 2"}), |
||||
|
ask.k(":macro.record_3", function() |
||||
|
awesome.emit_signal("macro::record",macro_base_dir.."macro3") |
||||
|
end,{group="macros",description="Record macro 3"}), |
||||
|
ask.k(":macro.record_4", function() |
||||
|
awesome.emit_signal("macro::record",macro_base_dir.."macro4") |
||||
|
end,{group="macros",description="Record macro 4"}), |
||||
|
ask.k(":macro.record_5", function() |
||||
|
awesome.emit_signal("macro::record",macro_base_dir.."macro5") |
||||
|
end,{group="macros",description="Record macro 5"}), |
||||
|
ask.k(":macro.play_1", function() |
||||
|
if not _G.MacroActive[macro_base_dir.."macro1"] then |
||||
|
awesome.emit_signal("macro::play",macro_base_dir.."macro1") |
||||
|
else |
||||
|
_G.MacroActive[macro_base_dir.."macro1"] = false |
||||
|
end |
||||
|
end,{group="macros",description="Play macro 1",release_pre=true}), |
||||
|
ask.k(":macro.play_2", function() |
||||
|
if not _G.MacroActive[macro_base_dir.."macro2"] then |
||||
|
awesome.emit_signal("macro::play",macro_base_dir.."macro2") |
||||
|
else |
||||
|
_G.MacroActive[macro_base_dir.."macro2"] = false |
||||
|
end |
||||
|
end,{group="macros",description="Play macro 2",release_pre=true}), |
||||
|
ask.k(":macro.play_3", function() |
||||
|
if not _G.MacroActive[macro_base_dir.."macro3"] then |
||||
|
awesome.emit_signal("macro::play",macro_base_dir.."macro3") |
||||
|
else |
||||
|
_G.MacroActive[macro_base_dir.."macro3"] = false |
||||
|
end |
||||
|
end,{group="macros",description="Play macro 3",release_pre=true}), |
||||
|
ask.k(":macro.play_4", function() |
||||
|
if not _G.MacroActive[macro_base_dir.."macro4"] then |
||||
|
awesome.emit_signal("macro::play",macro_base_dir.."macro4") |
||||
|
else |
||||
|
_G.MacroActive[macro_base_dir.."macro4"] = false |
||||
|
end |
||||
|
end,{group="macros",description="Play macro 4",release_pre=true}), |
||||
|
ask.k(":macro.play_5", function() |
||||
|
if not _G.MacroActive[macro_base_dir.."macro5"] then |
||||
|
awesome.emit_signal("macro::play",macro_base_dir.."macro5") |
||||
|
else |
||||
|
_G.MacroActive[macro_base_dir.."macro5"] = false |
||||
|
end |
||||
|
end,{group="macros",description="Play macro 5",release_pre=true}), |
||||
|
ask.k(":macro.loop",function() |
||||
|
macro_loop = not macro_loop |
||||
|
if macro_loop then |
||||
|
require("naughty").notify({title="Macro looping turned on"}) |
||||
|
else |
||||
|
require("naughty").notify({title="Macro looping turned off"}) |
||||
|
end |
||||
|
end,{group="macros",description="turn looping on/off"}) |
||||
|
)) |
@ -0,0 +1,12 @@ |
|||||
|
local awful = require("awful") |
||||
|
|
||||
|
awful.layout.layouts = { |
||||
|
awful.layout.suit.floating, |
||||
|
awful.layout.suit.tile, |
||||
|
awful.layout.suit.tile.left, |
||||
|
awful.layout.suit.tile.bottom, |
||||
|
awful.layout.suit.tile.top, |
||||
|
awful.layout.suit.fair, |
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"widgets.supermenu.applications-tab":{} |
||||
|
} |
@ -0,0 +1,2 @@ |
|||||
|
local awful = require("awful") |
||||
|
return function(args) return awful.widget.layoutbox(args.screen) end |
@ -0,0 +1,114 @@ |
|||||
|
-- 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") |
||||
|
local gears = require("gears") |
||||
|
local awmtk2 = require("awmtk2") |
||||
|
local beautiful = require("beautiful") |
||||
|
local wibox = require("wibox") |
||||
|
local json = require("dkjson") |
||||
|
local try_blur = require("imagemagick_blur") |
||||
|
|
||||
|
local bgimagegen = function(path) |
||||
|
return function(cont,cr,width,height) |
||||
|
local s = gears.surface.load_uncached_silently( |
||||
|
path |
||||
|
) |
||||
|
local bg_width,bg_height = gears.surface.get_size(s) |
||||
|
local scale = height/bg_height |
||||
|
if width/bg_width > scale then |
||||
|
scale = width/bg_width |
||||
|
end |
||||
|
cr:translate((width - (bg_width*scale))/2,(height - (bg_height*scale))/2) |
||||
|
cr:rectangle(0,0, (bg_width*scale), (bg_height*scale)) |
||||
|
cr:clip() |
||||
|
cr:scale(scale,scale) |
||||
|
cr:set_source_surface(s) |
||||
|
cr:paint() |
||||
|
end |
||||
|
end |
||||
|
local function _preload(args) |
||||
|
local style = awmtk2.create_style("supermenu", |
||||
|
awmtk2.generic.composite_widget,{}) |
||||
|
local templates = awmtk2.create_template_lib("supermenu",awmtk2.templates,{}) |
||||
|
local t = awmtk2.build_templates(templates,style,args.vertical) |
||||
|
local wallpaper |
||||
|
if gears.filesystem.file_readable(root_path.."/wallpaper.txt") then |
||||
|
local wallpaper_f = io.open(root_path.."/wallpaper.txt","r") |
||||
|
wallpaper = wallpaper_f:read("*a") |
||||
|
wallpaper_f:close() |
||||
|
end |
||||
|
supermenu = awful.popup(t.popup({ |
||||
|
{ |
||||
|
{ |
||||
|
widget = wibox.container.background |
||||
|
}, |
||||
|
{ |
||||
|
layout = wibox.layout.fixed.vertical, |
||||
|
id = "contents" |
||||
|
}, |
||||
|
{ |
||||
|
t.container({ |
||||
|
id = "buttonlist", |
||||
|
layout = wibox.layout.fixed.vertical |
||||
|
},{ |
||||
|
bg = style.container.bg_highlight |
||||
|
}), |
||||
|
valign = "center", |
||||
|
halign = "right", |
||||
|
fill_vertical = true, |
||||
|
fill_horizontal = false, |
||||
|
widget = wibox.container.place |
||||
|
}, |
||||
|
layout = wibox.layout.align.horizontal |
||||
|
}, |
||||
|
widget = wibox.container.background, |
||||
|
forced_width = args.screen.workarea.width-style.container.margins, |
||||
|
forced_height = args.screen.workarea.height-style.container.margins, |
||||
|
id = "supermenu_root" |
||||
|
},{ |
||||
|
x = args.screen.workarea.x, |
||||
|
y = args.screen.workarea.y, |
||||
|
visible = true |
||||
|
})) |
||||
|
local supermenu_root = supermenu.widget:get_children_by_id("supermenu_root")[1] |
||||
|
supermenu_root.bgimage = bgimagegen(try_blur(wallpaper or beautiful.wallpaper, |
||||
|
function(path) |
||||
|
supermenu_root.bgimage = bgimagegen(path) |
||||
|
end)) |
||||
|
args.screen:connect_signal("property::workarea",function() |
||||
|
supermenu.x = args.screen.workarea.x |
||||
|
supermenu.y = args.screen.workarea.y |
||||
|
supermenu_root.forced_width = args.screen.workarea.width-style.container.margins*2 |
||||
|
supermenu_root.forced_height = args.screen.workarea.height-style.container.margins*2 |
||||
|
end) |
||||
|
supermenu:connect_signal("button::press",function(self,x,y,button) |
||||
|
if button == 3 then |
||||
|
supermenu.visible = false |
||||
|
end |
||||
|
end) |
||||
|
local tabsfile = io.open(root_path.."/themes/"..global.theme..'/config/supermenu.json',"r") |
||||
|
local tabs = {} |
||||
|
if tabsfile then |
||||
|
for k,v in pairs(json.decode(tabsfile:read("*a"))) do |
||||
|
table.insert(tabs,require(k)(v)) |
||||
|
end |
||||
|
end |
||||
|
local contents = supermenu.widget:get_children_by_id("contents")[1] |
||||
|
if tabs[1] then |
||||
|
contents:add(tabs[1]) |
||||
|
end |
||||
|
return supermenu |
||||
|
end |
||||
|
return function(args) |
||||
|
for s in screen do |
||||
|
s.lock = _preload(gears.table.join(args,{ |
||||
|
screen = s |
||||
|
})) |
||||
|
end |
||||
|
end |
||||
|
|
@ -0,0 +1,69 @@ |
|||||
|
local awful = require("awful") |
||||
|
local gears = require("gears") |
||||
|
local awmtk2 = require("awmtk2") |
||||
|
local wibox = require("wibox") |
||||
|
local beautiful = require("beautiful") |
||||
|
|
||||
|
return function(args) |
||||
|
local style = awmtk2.create_style("applications_tab", |
||||
|
awmtk2.generic.menu, args.style, args.vertical) |
||||
|
local templates = awmtk2.create_template_lib("applications_tab", |
||||
|
awmtk2.templates,args.templates) |
||||
|
local t = awmtk2.build_templates(templates,style,args.vertical) |
||||
|
local widget = wibox.widget({ |
||||
|
{ |
||||
|
t.center(t.container(t.container({ |
||||
|
widget = wibox.widget.textbox, |
||||
|
markup = "Search area", |
||||
|
id = "searchtext" |
||||
|
},{ |
||||
|
id = "searchbox", |
||||
|
bg = style.container.bg_highlight, |
||||
|
forced_width = 240 |
||||
|
}) |
||||
|
)), |
||||
|
{ |
||||
|
{ |
||||
|
layout = wibox.layout.grid, |
||||
|
forced_num_cols = args.columns or 4, |
||||
|
homogenous = true, |
||||
|
expand = true, |
||||
|
orientation = "veritcal", |
||||
|
spacing = style.base.spacing, |
||||
|
id = "appgrid" |
||||
|
}, |
||||
|
margins = 20, |
||||
|
widget = wibox.container.margin |
||||
|
}, |
||||
|
layout = wibox.layout.fixed.vertical, |
||||
|
spacing = style.base.spacing, |
||||
|
id = "root_ratio" |
||||
|
}, |
||||
|
widget = wibox.container.margin, |
||||
|
margins = 20 |
||||
|
}) |
||||
|
local appgrid = widget:get_children_by_id("appgrid")[1] |
||||
|
local gen_icon = function(appdata) |
||||
|
local appicon = wibox.widget({ |
||||
|
t.icon({ |
||||
|
image = appdata.icon or beautiful.icon_default, |
||||
|
}), |
||||
|
{ |
||||
|
markup = appdata.title, |
||||
|
widget = wibox.widget.textbox, |
||||
|
align = "center" |
||||
|
}, |
||||
|
spacing = style.base.spacing, |
||||
|
layout = wibox.layout.fixed.vertical |
||||
|
}) |
||||
|
appicon:connect_signal("button::press",function(_,_,_,button) |
||||
|
if button == 1 then |
||||
|
awful.spawn(appdata.exec) |
||||
|
end |
||||
|
end) |
||||
|
return appicon |
||||
|
end |
||||
|
awesome.connect_signal("xdg::all_finished",function() |
||||
|
end) |
||||
|
return widget |
||||
|
end |
Write
Preview
Loading…
Cancel
Save
Reference in new issue