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:
Hydroxycarbamide 2023-03-20 09:51:48 +01:00
parent 4f850f7173
commit 2401cfcee2
56 changed files with 2040 additions and 858 deletions

View file

@ -25,6 +25,8 @@ mylauncher = wibox.container.margin(mylauncher, dpi(0), dpi(0), dpi(6), dpi(6))
-- ~~~~~~~~~~~
-- # Sidebar button :
local sidebar_button = require('ui.widgets.sidebar_button')
-- # notifications_list button :
local notifications_list_button = require('ui.widgets.notifications_list_button')
-- # Systray :
local systray = require('ui.widgets.systray')
-- # Clock :
@ -109,6 +111,7 @@ local function get_bar(s)
systray,
sidebar_button,
layoutbox(s),
notifications_list_button,
layout = wibox.layout.fixed.horizontal,
spacing = dpi(10)
},
@ -140,8 +143,8 @@ local function get_bar(s)
c.screen.mywibar.visible = true
end
end
client.connect_signal("property::fullscreen", remove_wibar)
client.connect_signal("request::unmanage", add_wibar)
--client.connect_signal("property::fullscreen", remove_wibar)
--client.connect_signal("request::unmanage", add_wibar)
end

View file

@ -9,15 +9,16 @@ local wibox = require("wibox")
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local naughty = require("naughty")
-- # Libs :
-- ~~~~~~~~
local helpers = require("libs.helpers")
-- Tags :
--awful.util.tagnames = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
awful.util.tagnames = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
--awful.util.tagnames = { "", "", "", "", "", "", "", "", ""} -- font size : 14
awful.util.tagnames = {"", "", "", "", "", "", "", "", ""}
--awful.util.tagnames = { "", "", "", "", "", "", "", "", "" }
-- Each screen has its own tag table.
screen.connect_signal("request::desktop_decoration", function(s)
@ -25,68 +26,88 @@ screen.connect_signal("request::desktop_decoration", function(s)
end)
local function update_tag(item, tag, index)
if tag.selected then
item.markup = helpers.colorize_text(" 󰮯 ", colors.main_scheme)
elseif tag.urgent then
item.markup = helpers.colorize_text("", colors.red)
elseif #tag:clients() > 0 then
item.markup = helpers.colorize_text("", colors.white)
else
item.markup = helpers.colorize_text(" 󱙝 ", colors.white)
end
if tag.selected then
item.markup = helpers.colorize_text(" 󰮯 ", colors.main_scheme)
elseif tag.urgent then
item.markup = helpers.colorize_text("", colors.red)
elseif #tag:clients() > 0 then
item.markup = helpers.colorize_text("", colors.white)
else
item.markup = helpers.colorize_text(" 󱙝 ", colors.white)
end
end
local modkey = "Mod4"
return function(s)
-- Taglist buttons
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
-- Taglist buttons
local taglist_buttons = gears.table.join(
awful.button({}, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end)
--awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end),
--awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end),
--awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end),
--awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end),
)
-- Create a taglist widget
local taglist = awful.widget.taglist {
screen = s,
screen = s,
--filter = awful.widget.taglist.filter.all,
filter = function (t) return t.selected or #t:clients() > 0 end, -- Show only used Tags
buttons = taglist_buttons,
layout = {
filter = function(t) return t.selected or #t:clients() > 0 end, -- Show only used Tags
buttons = taglist_buttons,
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
style = {
style = {
spacing = dpi(-4),
},
widget_template = {
id = "tag",
font = theme.ui_font,
widget = wibox.widget.textbox,
create_callback = function(self, c3, index, object)
update_tag(self, c3, index)
end,
update_callback = function(self, c3, index, object)
self:connect_signal('mouse::enter', function()
-- BLING: Only show widget when there are clients in the tag
if #c3:clients() > 0 then
-- BLING: Update the widget with the new tag
awesome.emit_signal("bling::tag_preview::update", c3)
-- BLING: Show the widget
awesome.emit_signal("bling::tag_preview::visibility", s, true)
end
if self.bg ~= '#ff0000' then
self.backup = self.bg
self.has_backup = true
end
self.bg = '#ff0000'
end)
self:connect_signal('mouse::leave', function()
-- BLING: Turn the widget off
awesome.emit_signal("bling::tag_preview::visibility", s, false)
if self.has_backup then self.bg = self.backup end
end)
end,
update_callback = function(self, c3, index, object)
update_tag(self, c3, index)
end
}
}
tags = wibox.widget{
tags = wibox.widget {
{
{
taglist,
@ -99,7 +120,7 @@ return function(s)
bg = colors.container,
shape = helpers.rrect(theme.rounded - 4),
widget = wibox.container.background
},
},
top = dpi(4),
bottom = dpi(4),
left = dpi(0),
@ -108,6 +129,5 @@ return function(s)
}
--return taglist
return tags
return tags
end

View file

@ -14,78 +14,93 @@ local dpi = xresources.apply_dpi
-- ~~~~~~~~
local helpers = require("libs.helpers")
return function(s)
-- Tasklist buttons
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c) c:activate { context = "tasklist", action = "toggle_minimization" } end),
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({ }, 4, function() awful.client.focus.byidx(-1) end),
awful.button({ }, 5, function() awful.client.focus.byidx( 1) end)
)
return function(s)
-- Tasklist buttons
local tasklist_buttons = gears.table.join(
awful.button({}, 1, function(c) c:activate { context = "tasklist", action = "toggle_minimization" } end),
awful.button({}, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({}, 4, function() awful.client.focus.byidx(-1) end),
awful.button({}, 5, function() awful.client.focus.byidx(1) end)
)
-- Create a tasklist widget
local tasklist = awful.widget.tasklist
{
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons,
style = {
font = theme.font,
bg_normal = colors.container,
bg_focus = colors.container,
bg_minimize = colors.black ,
shape = helpers.rrect(dpi(4)),
},
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
widget_template = {
local tasklist = awful.widget.tasklist
{
{
{
{
awful.widget.clienticon,
forced_height = dpi(15),
forced_width = dpi(15),
halign = "center",
valign = "center",
widget = wibox.container.place,
},
margins = dpi(2),
widget = wibox.container.margin,
},
{
nil,
nil,
{
nil,
{
widget = wibox.container.background,
id = "pointer",
bg = colors.main_scheme,
shape = gears.shape.rounded_bar,
forced_height = dpi(2),
forced_width = dpi(20)
},
expand = "none",
layout = wibox.layout.align.horizontal
},
layout = wibox.layout.align.vertical
},
layout = wibox.layout.stack,
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons,
style = {
font = theme.font,
bg_normal = colors.container,
bg_focus = colors.container,
bg_minimize = colors.black,
shape = helpers.rrect(dpi(4)),
},
forced_width = dpi(40),
id = "background_role",
widget = wibox.container.background,
},
top = dpi(4),
bottom = dpi(4),
left = dpi(2),
right = dpi(2),
widget = wibox.container.margin
}
}
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
widget_template = {
create_callback = function(self, c, index, objects) --luacheck: no unused args
--self:get_children_by_id('clienticon')[1].client = c
-- BLING: Toggle the popup on hover and disable it off hover
self:connect_signal('mouse::enter', function()
awesome.emit_signal("bling::task_preview::visibility", s,
true, c)
end)
self:connect_signal('mouse::leave', function()
awesome.emit_signal("bling::task_preview::visibility", s,
false, c)
end)
end,
{
{
{
{
id = 'clienticon',
awful.widget.clienticon,
forced_height = dpi(15),
forced_width = dpi(15),
halign = "center",
valign = "center",
widget = wibox.container.place,
},
margins = dpi(2),
widget = wibox.container.margin,
},
{
nil,
nil,
{
nil,
{
widget = wibox.container.background,
id = "pointer",
bg = colors.main_scheme,
shape = gears.shape.rounded_bar,
forced_height = dpi(2),
forced_width = dpi(20)
},
expand = "none",
layout = wibox.layout.align.horizontal
},
layout = wibox.layout.align.vertical
},
nil,
layout = wibox.layout.stack,
},
forced_width = dpi(40),
id = "background_role",
widget = wibox.container.background,
},
top = dpi(4),
bottom = dpi(4),
left = dpi(2),
right = dpi(2),
widget = wibox.container.margin
},
}
return tasklist
end