a lot of stuff and added dbus_proxy as sub module
This commit is contained in:
@@ -389,7 +389,6 @@ local function create_tasks()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return tasks
|
||||
end
|
||||
|
||||
@@ -405,7 +404,7 @@ local selected_day = {
|
||||
|
||||
return function(s)
|
||||
-- The calendar grid
|
||||
local calendar_matrix = wibox.widget { layout = wibox.layout.grid }
|
||||
local calendar_matrix = wibox.widget { layout = wibox.layout.grid, spacing = dpi(2) }
|
||||
|
||||
local weeks = wibox.widget { layout = wibox.layout.fixed.vertical }
|
||||
|
||||
@@ -541,7 +540,7 @@ return function(s)
|
||||
border_color = border,
|
||||
border_width = Theme_config.calendar.day.border_width,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(0))
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
@@ -642,7 +641,7 @@ return function(s)
|
||||
border_color = border,
|
||||
border_width = Theme_config.calendar.day.border_width,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(0))
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
@@ -752,7 +751,7 @@ return function(s)
|
||||
border_color = border,
|
||||
border_width = Theme_config.calendar.day.border_width,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(0))
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
|
||||
1005
awesome/src/modules/calendar/init.lua
Normal file
1005
awesome/src/modules/calendar/init.lua
Normal file
File diff suppressed because it is too large
Load Diff
125
awesome/src/modules/calendar/task_info.lua
Normal file
125
awesome/src/modules/calendar/task_info.lua
Normal file
@@ -0,0 +1,125 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gcolor = require("gears.color")
|
||||
local gtable = require("gears.table")
|
||||
local gshape = require("gears.shape")
|
||||
local gobject = require("gears.object")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/calendar/"
|
||||
|
||||
local task_info = { mt = {} }
|
||||
task_info._private = {}
|
||||
|
||||
function task_info.new(args)
|
||||
args = args or {}
|
||||
if not args.task then return end
|
||||
args.screen = args.screen or awful.screen.focused()
|
||||
local ret = gobject {}
|
||||
gtable.crush(ret, task_info, true)
|
||||
|
||||
local task_info_widget = wibox.widget {
|
||||
{
|
||||
{ -- Task detail
|
||||
{ -- Calendar color
|
||||
widget = wibox.container.background,
|
||||
shape = function(cr, _, height)
|
||||
gshape.rounded_rect(cr, dpi(10), height, dpi(8))
|
||||
end,
|
||||
},
|
||||
{
|
||||
{ -- Summary
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.summary,
|
||||
valign = "center",
|
||||
align = "left",
|
||||
id = "summary",
|
||||
},
|
||||
{ -- Date long
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.date_long,
|
||||
valign = "center",
|
||||
align = "right",
|
||||
id = "date_long",
|
||||
},
|
||||
{ -- From - To
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.from_to,
|
||||
valign = "center",
|
||||
align = "left",
|
||||
id = "from_to",
|
||||
},
|
||||
{ -- Repeat information
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.repeat_info,
|
||||
valign = "center",
|
||||
align = "right",
|
||||
id = "repeat_info",
|
||||
},
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
{ -- Location
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(icondir .. "location.svg", Theme_config.calendar.task_info.location_icon_color),
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
},
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.location,
|
||||
valign = "center",
|
||||
align = "left",
|
||||
id = "location",
|
||||
},
|
||||
id = "location_container",
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
{ -- Alarm
|
||||
{
|
||||
widget = wibox.widget.imagebox,
|
||||
image = gcolor.recolor_image(icondir .. "alarm.svg", Theme_config.calendar.task_info.alarm_icon_color),
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
},
|
||||
{
|
||||
widget = wibox.widget.textbox,
|
||||
text = ret.alarm,
|
||||
valign = "center",
|
||||
align = "left",
|
||||
id = "alarm",
|
||||
},
|
||||
id = "alarm_container",
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "task_detail",
|
||||
layout = wibox.layout.fixed.vertical
|
||||
},
|
||||
bg = Theme_config.calendar.task_info.bg,
|
||||
fg = Theme_config.calendar.task_info.fg,
|
||||
shape = Theme_config.calendar.task_info.shape,
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
|
||||
ret.widget = awful.popup {
|
||||
widget = task_info_widget,
|
||||
ontop = true,
|
||||
visible = true,
|
||||
bg = "#00000000",
|
||||
x = mouse.coords().x,
|
||||
y = mouse.coords().y,
|
||||
screen = args.screen
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
function task_info.mt:__call(...)
|
||||
task_info.new(...)
|
||||
end
|
||||
|
||||
return setmetatable(task_info, task_info.mt)
|
||||
@@ -3,7 +3,6 @@
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local async = require("async")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local Gio = require("lgi").Gio
|
||||
local gears = require("gears")
|
||||
@@ -170,9 +169,12 @@ return function(screen)
|
||||
local indicators = { layout = wibox.layout.flex.horizontal, spacing = dpi(5) }
|
||||
local col = Theme_config.dock.indicator_bg
|
||||
for _, c in ipairs(client.get()) do
|
||||
local icon_name = pr.icon
|
||||
if icon_name:match(string.lower(c.class or c.name)) or c.class:match(string.lower(icon_name)) or
|
||||
c.name:match(string.lower(icon_name)) then
|
||||
local icon_name = string.lower(pr.icon)
|
||||
if not c or not c.valid then return end
|
||||
if not c.class then c.class = "" end
|
||||
local class = string.lower(c.class)
|
||||
icon_name = string.match(icon_name, ".*/(.*)%.[svg|png]")
|
||||
if class == icon_name or class:match(icon_name) or icon_name:match(class) then
|
||||
if c == client.focus then
|
||||
col = Theme_config.dock.indicator_focused_bg
|
||||
elseif c.urgent then
|
||||
|
||||
@@ -27,6 +27,6 @@ awful.screen.connect_for_each_screen(
|
||||
require("src.modules.notification-center.init")(s)
|
||||
require("src.modules.window_switcher.init")(s)
|
||||
require("src.modules.application_launcher.init")(s)
|
||||
require("src.modules.calendar.calendar")(s)
|
||||
require("src.modules.calendar.init") { screen = s }
|
||||
end
|
||||
)
|
||||
|
||||
@@ -8,6 +8,8 @@ local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local rubato = require("src.lib.rubato")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/notifications/"
|
||||
|
||||
@@ -84,92 +86,44 @@ return function(s)
|
||||
halign = "right",
|
||||
}
|
||||
|
||||
local left_button = wibox.widget {
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = Theme_config.notification_center.dnd.disabled,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
forced_height = dpi(30),
|
||||
forced_width = dpi(30),
|
||||
id = "circle"
|
||||
},
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
visible = true,
|
||||
valign = "center",
|
||||
halign = "left",
|
||||
widget = wibox.container.place,
|
||||
}
|
||||
local color = Theme_config.notification_center.dnd.disabled
|
||||
|
||||
local right_button = wibox.widget {
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = Theme_config.notification_center.dnd.border_enabled,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
forced_height = dpi(30),
|
||||
forced_width = dpi(30),
|
||||
id = "circle"
|
||||
},
|
||||
left = dpi(5),
|
||||
right = dpi(5),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
valign = "center",
|
||||
halign = "right",
|
||||
visible = false,
|
||||
widget = wibox.container.place,
|
||||
}
|
||||
local function toggle_animation(pos)
|
||||
if pos > 43 then return end
|
||||
return function(_, _, cr, width, height)
|
||||
cr:set_source(gears.color(Theme_config.notification_center.dnd.bg));
|
||||
cr:paint();
|
||||
cr:set_source(gears.color(color))
|
||||
cr:move_to(pos, 0)
|
||||
local x = pos
|
||||
local y = 5
|
||||
local newwidth = width / 2 - 10
|
||||
local newheight = height - 10
|
||||
|
||||
local rubato = require("src.lib.rubato")
|
||||
local radius = height / 6.0
|
||||
local degrees = math.pi / 180.0;
|
||||
|
||||
local rubato_timed = rubato.timed { duration = 1, pos = 0 }
|
||||
cr:new_sub_path()
|
||||
cr:arc(x + newwidth - radius, y + radius, radius, -90 * degrees, 0 * degrees)
|
||||
cr:arc(x + newwidth - radius, y + newheight - radius, radius, 0 * degrees, 90 * degrees)
|
||||
cr:arc(x + radius, y + newheight - radius, radius, 90 * degrees, 180 * degrees)
|
||||
cr:arc(x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
|
||||
cr:close_path()
|
||||
cr:fill()
|
||||
end
|
||||
end
|
||||
|
||||
local rubato_timed
|
||||
|
||||
local toggle_button = wibox.widget {
|
||||
{
|
||||
id = "background",
|
||||
widget = wibox.widget {
|
||||
fit = function(_, width, height)
|
||||
return width, height
|
||||
end,
|
||||
draw = function(_, _, cr, width, height)
|
||||
-- Clear for next drawing
|
||||
--cr:set_operator(cairo.Operator.CLEAR);
|
||||
local function move_dnd()
|
||||
cr:set_source(gears.color(Theme_config.notification_center.dnd.bg));
|
||||
cr:paint();
|
||||
cr:set_source(gears.color(Theme_config.notification_center.dnd.disabled))
|
||||
cr:move_to(rubato_timed.pos, 0)
|
||||
local x = rubato_timed.pos
|
||||
local y = 5
|
||||
local newwidth = width / 2 - 10
|
||||
local newheight = height - 10
|
||||
|
||||
local radius = height / 6.0
|
||||
local degrees = math.pi / 180.0;
|
||||
|
||||
cr:new_sub_path()
|
||||
cr:arc(x + newwidth - radius, y + radius, radius, -90 * degrees, 0 * degrees)
|
||||
cr:arc(x + newwidth - radius, y + newheight - radius, radius, 0 * degrees, 90 * degrees)
|
||||
cr:arc(x + radius, y + newheight - radius, radius, 90 * degrees, 180 * degrees)
|
||||
cr:arc(x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
|
||||
cr:close_path()
|
||||
cr:fill()
|
||||
end
|
||||
|
||||
rubato_timed:subscribe(move_dnd)
|
||||
rubato_timed.target = width / 2 + 5
|
||||
end
|
||||
}
|
||||
draw = toggle_animation(0, Theme_config.notification_center.dnd.disabled),
|
||||
},
|
||||
id = "background",
|
||||
},
|
||||
active = false,
|
||||
widget = wibox.container.background,
|
||||
@@ -183,23 +137,36 @@ return function(s)
|
||||
end,
|
||||
}
|
||||
|
||||
toggle_button:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
if toggle_button.active then
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_disabled
|
||||
User_config.dnd = false
|
||||
rubato_timed.target = 5
|
||||
else
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_enabled
|
||||
User_config.dnd = true
|
||||
rubato_timed.target = 50
|
||||
toggle_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
if toggle_button.active then
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_disabled
|
||||
color = Theme_config.notification_center.dnd.disabled
|
||||
User_config.dnd = false
|
||||
rubato_timed.target = 5
|
||||
else
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_enabled
|
||||
color = Theme_config.notification_center.dnd.enabled
|
||||
User_config.dnd = true
|
||||
rubato_timed.target = 43
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
rubato_timed = rubato.timed {
|
||||
duration = 0.5,
|
||||
pos = 5,
|
||||
subscribed = function(pos)
|
||||
toggle_button:get_children_by_id("background")[1].draw = toggle_animation(pos)
|
||||
toggle_button:emit_signal("widget::redraw_needed")
|
||||
end
|
||||
}
|
||||
|
||||
local dnd = wibox.widget {
|
||||
{
|
||||
{
|
||||
|
||||
@@ -482,7 +482,8 @@ return function(s)
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function()
|
||||
get_spotify_metadata()
|
||||
--!Rewrite entire playerctl module for better performance
|
||||
--get_spotify_metadata()
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user