Add revelation
Update and add bling task_preview, tag_preview and window_switcher Add catppuccin-macchiato Use my weather key Update keybindings Update autorun Fix sliders
This commit is contained in:
parent
4f850f7173
commit
2401cfcee2
56 changed files with 2040 additions and 858 deletions
108
home/.config/awesome/ui/notifications-list/init.lua
Normal file
108
home/.config/awesome/ui/notifications-list/init.lua
Normal file
|
@ -0,0 +1,108 @@
|
|||
-- ## Sidebar ##
|
||||
-- ~~~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require ("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
-- # Libs :
|
||||
-- ~~~~~~~~
|
||||
local helpers = require("libs.helpers")
|
||||
local rubato = require("libs.rubato")
|
||||
|
||||
local function box_widget(widgets, width, height)
|
||||
return wibox.widget {
|
||||
{
|
||||
{
|
||||
widgets,
|
||||
margins = dpi(16),
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
forced_width = dpi(width),
|
||||
forced_height = dpi(height),
|
||||
shape = helpers.rrect(theme.rounded),
|
||||
bg = colors.container,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
margins = {left = dpi(20), right = dpi(20)},
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
end
|
||||
|
||||
-- Get widgets
|
||||
local notifications_list_core = require("ui.notifications-list.list")
|
||||
local notifications_widget = notifications_list_core.widget
|
||||
|
||||
-- Combine some widgets
|
||||
local notifications = box_widget(notifications_widget, 380, 150)
|
||||
|
||||
-- Sidebar
|
||||
local notifications_list = wibox {
|
||||
type = "dock",
|
||||
visible = false,
|
||||
ontop = true,
|
||||
width = dpi(420),
|
||||
height = dpi(836),
|
||||
y = dpi(8),
|
||||
bg = theme.bg,
|
||||
shape = helpers.rrect(18),
|
||||
|
||||
}
|
||||
|
||||
-- Sidebar widget setup
|
||||
notifications_list : setup {
|
||||
{
|
||||
notifications,
|
||||
spacing = dpi(20),
|
||||
layout = wibox.layout.flex.vertical,
|
||||
},
|
||||
margins = { top = dpi(20), bottom = dpi(20)},
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
|
||||
-- Slide animation
|
||||
local slide = rubato.timed {
|
||||
pos = helpers.screen.geometry.height,
|
||||
rate = 60,
|
||||
intro = 0.05,
|
||||
duration = 0.2,
|
||||
easing = rubato.quadratic,
|
||||
subscribed = function(pos)
|
||||
notifications_list.y = helpers.screen.geometry.y + pos
|
||||
end
|
||||
}
|
||||
|
||||
-- Timer of sidebar's death
|
||||
notifications_list.timer = gears.timer {
|
||||
timeout = 0.5,
|
||||
single_shot = true,
|
||||
callback = function()
|
||||
notifications_list.visible = not notifications_list.visible
|
||||
end
|
||||
}
|
||||
|
||||
-- Toggle function
|
||||
notifications_list.toggle = function()
|
||||
if notifications_list.visible then
|
||||
slide.target = helpers.screen.geometry.y - notifications_list.height
|
||||
notifications_list.timer:start()
|
||||
else
|
||||
slide.target = helpers.screen.geometry.y + dpi(10)
|
||||
notifications_list.visible = not notifications_list.visible
|
||||
end
|
||||
|
||||
end
|
||||
awful.placement.top_right(notifications_list, {honor_workarea = true, margins = beautiful.useless_gap * 3})
|
||||
|
||||
notifications_list.core = notifications_list_core
|
||||
|
||||
-- Get signal to execute the function (if that makes sense)
|
||||
awesome.connect_signal("notifications_list::toggle", function()
|
||||
notifications_list.toggle()
|
||||
end)
|
||||
|
||||
return notifications_list
|
147
home/.config/awesome/ui/notifications-list/list.lua
Normal file
147
home/.config/awesome/ui/notifications-list/list.lua
Normal file
|
@ -0,0 +1,147 @@
|
|||
-- ## Clock ##
|
||||
-- ~~~~~~~~~~~
|
||||
|
||||
-- Requirements :
|
||||
-- ~~~~~~~~~~~~~~
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local naughty = require("naughty")
|
||||
local beautiful = require("beautiful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local notifbox_layout = wibox.widget {
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
spacing = dpi(7)
|
||||
}
|
||||
|
||||
local function create_notifcation(n)
|
||||
local icon_visibility
|
||||
|
||||
if n.icon == nil then
|
||||
icon_visibility = false
|
||||
else
|
||||
icon_visibility = true
|
||||
end
|
||||
|
||||
-- Action widget
|
||||
local action_widget = {
|
||||
{
|
||||
{
|
||||
id = "text_role",
|
||||
align = "center",
|
||||
font = "Roboto Mono 10",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
margins = { left = dpi(6), right = dpi(6) },
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
|
||||
-- Apply action widget ^
|
||||
local actions = wibox.widget {
|
||||
notification = n,
|
||||
base_layout = wibox.widget {
|
||||
spacing = dpi(8),
|
||||
layout = wibox.layout.flex.horizontal,
|
||||
},
|
||||
widget_template = action_widget,
|
||||
widget = naughty.list.actions,
|
||||
}
|
||||
|
||||
local function space_h(length, circumstances)
|
||||
return wibox.widget {
|
||||
forced_width = length,
|
||||
visible = circumstances,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
}
|
||||
end
|
||||
|
||||
-- Make other widgets
|
||||
local title = wibox.widget.textbox()
|
||||
title.font = "Roboto bold 14"
|
||||
title.align = 'left'
|
||||
title.markup = n.title
|
||||
|
||||
local message = wibox.widget.textbox()
|
||||
message.font = "Roboto Medium 11"
|
||||
message.align = 'left'
|
||||
message.markup = n.message
|
||||
|
||||
local icon = wibox.widget {
|
||||
nil,
|
||||
{
|
||||
{
|
||||
image = n.icon or n.app_icon,
|
||||
visible = icon_visibility,
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
strategy = "max",
|
||||
width = dpi(30),
|
||||
height = dpi(30),
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
expand = 'none',
|
||||
layout = wibox.layout.align.vertical,
|
||||
}
|
||||
|
||||
local container = wibox.widget {
|
||||
{
|
||||
title,
|
||||
{
|
||||
icon,
|
||||
space_h(dpi(10), icon_visibility),
|
||||
message,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
actions,
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
margins = dpi(20),
|
||||
widget = wibox.container.margin,
|
||||
}
|
||||
|
||||
notifbox_layout:insert(
|
||||
1,
|
||||
container
|
||||
)
|
||||
end
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
create_notifcation(n)
|
||||
end)
|
||||
|
||||
local notif_core = {}
|
||||
|
||||
notif_core.is_read = true
|
||||
|
||||
notif_core.widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
text = "Dismiss all",
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
buttons = gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
notifbox_layout:reset()
|
||||
end)
|
||||
),
|
||||
forced_width = 75,
|
||||
shape = gears.shape.rounded_bar,
|
||||
shape_border_width = 1,
|
||||
shape_border_color = beautiful.bg_highlight,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
notifbox_layout,
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
spacing = dpi(4),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
}
|
||||
|
||||
return notif_core
|
Loading…
Add table
Add a link
Reference in a new issue