add new calendar widget with ics file support, fix some bugs and added some game rules so steam games fullscreen isn't as annoying
This commit is contained in:
@@ -130,11 +130,46 @@ return function(s)
|
||||
widget = wibox.container.place,
|
||||
}
|
||||
|
||||
local rubato = require("src.lib.rubato")
|
||||
|
||||
local rubato_timed = rubato.timed { duration = 1, pos = 0 }
|
||||
|
||||
local toggle_button = wibox.widget {
|
||||
{
|
||||
left_button,
|
||||
right_button,
|
||||
widget = wibox.layout.flex.horizontal
|
||||
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
|
||||
}
|
||||
},
|
||||
active = false,
|
||||
widget = wibox.container.background,
|
||||
@@ -152,22 +187,20 @@ return function(s)
|
||||
"button::press",
|
||||
function()
|
||||
if toggle_button.active then
|
||||
left_button.visible = true
|
||||
right_button.visible = false
|
||||
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
|
||||
left_button.visible = false
|
||||
right_button.visible = true
|
||||
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
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
local dnd = wibox.widget { -- Clear all button
|
||||
local dnd = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -348,12 +381,22 @@ return function(s)
|
||||
end
|
||||
)
|
||||
|
||||
local function mouse_leave()
|
||||
notification_center.visible = false
|
||||
end
|
||||
|
||||
awesome.connect_signal("notification_center::block_mouse_events", function()
|
||||
notification_center:disconnect_signal("mouse::leave", mouse_leave)
|
||||
end)
|
||||
|
||||
awesome.connect_signal("notification_center::unblock_mouse_events", function()
|
||||
notification_center:connect_signal("mouse::leave", mouse_leave)
|
||||
end)
|
||||
|
||||
-- Hide notification_center when mouse leaves it
|
||||
notification_center:connect_signal(
|
||||
"mouse::leave",
|
||||
function()
|
||||
notification_center.visible = false
|
||||
end
|
||||
mouse_leave
|
||||
)
|
||||
|
||||
-- Clear all notifications on button press
|
||||
|
||||
@@ -15,7 +15,7 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/notifications/"
|
||||
local nl = {}
|
||||
|
||||
nl.notification_list = { layout = require("src.lib.overflow_widget.overflow").vertical, scrollbar_width = 0,
|
||||
step = dpi(20), spacing = dpi(20) }
|
||||
step = dpi(100), spacing = dpi(20) }
|
||||
|
||||
-- @param {table} notification
|
||||
-- @return {widget} notifications_list
|
||||
|
||||
@@ -90,6 +90,14 @@ return function()
|
||||
margins = dpi(10)
|
||||
}
|
||||
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
|
||||
awesome.connect_signal(
|
||||
"update::cpu_usage",
|
||||
function(cpu_usage)
|
||||
@@ -160,7 +168,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"update::cpu_temp",
|
||||
function(cpu_temp)
|
||||
@@ -239,7 +253,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"update::ram_widget",
|
||||
function(MemTotal, _, MemAvailable)
|
||||
@@ -312,7 +332,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"update::gpu_usage",
|
||||
function(gpu_usage)
|
||||
@@ -383,7 +409,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"update::gpu_temp",
|
||||
function(gpu_temp)
|
||||
@@ -472,7 +504,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"audio::get",
|
||||
function(muted, volume)
|
||||
@@ -563,7 +601,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"microphone::get",
|
||||
function(muted, volume)
|
||||
@@ -647,22 +691,20 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"brightness::get",
|
||||
function(brightness)
|
||||
local icon = icondir .. "brightness/brightness"
|
||||
if brightness >= 0 and brightness < 34 then
|
||||
icon = icon .. "-low"
|
||||
elseif brightness >= 34 and brightness < 67 then
|
||||
icon = icon .. "-medium"
|
||||
elseif brightness >= 67 then
|
||||
icon = icon .. "-high"
|
||||
end
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(icon .. ".svg",
|
||||
"update::backlight",
|
||||
function(backlight, backlight_icon)
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(backlight_icon,
|
||||
Theme_config.notification_center.status_bar.backlight_color)
|
||||
tooltip.text = "Backlight: " .. brightness .. "%"
|
||||
rubato_timer.target = brightness
|
||||
tooltip.text = "Backlight: " .. backlight .. "%"
|
||||
rubato_timer.target = backlight
|
||||
end
|
||||
)
|
||||
elseif widget == "battery" then
|
||||
@@ -728,7 +770,13 @@ return function()
|
||||
preferred_alignments = "middle",
|
||||
margins = dpi(10)
|
||||
}
|
||||
w:connect_signal("mouse::enter", function()
|
||||
awesome.emit_signal("notification_center::block_mouse_events")
|
||||
end)
|
||||
|
||||
w:connect_signal("mouse::leave", function()
|
||||
awesome.emit_signal("notification_center::unblock_mouse_events")
|
||||
end)
|
||||
awesome.connect_signal(
|
||||
"update::battery_widget",
|
||||
function(battery, battery_icon)
|
||||
|
||||
Reference in New Issue
Block a user