From fe159655c37a1bf9db67079d342a2fd97e29862e Mon Sep 17 00:00:00 2001 From: Hydroxycarbamide Date: Sat, 8 Oct 2022 12:25:10 +0200 Subject: [PATCH] Add reveletaion + rename bottom right to bottom left --- ...ttom_right_bar.lua => bottom_left_bar.lua} | 6 +- crylia_bar/init.lua | 2 +- mappings/global_keys.lua | 16 ++++ src/widgets/notification_list.lua | 80 +++++++++++++++++++ 4 files changed, 100 insertions(+), 4 deletions(-) rename crylia_bar/{bottom_right_bar.lua => bottom_left_bar.lua} (96%) create mode 100644 src/widgets/notification_list.lua diff --git a/crylia_bar/bottom_right_bar.lua b/crylia_bar/bottom_left_bar.lua similarity index 96% rename from crylia_bar/bottom_right_bar.lua rename to crylia_bar/bottom_left_bar.lua index 1aa6aec..d051f29 100644 --- a/crylia_bar/bottom_right_bar.lua +++ b/crylia_bar/bottom_left_bar.lua @@ -11,7 +11,7 @@ local wibox = require("wibox") return function(s, widgets) - local bottom_right = awful.popup { + local bottom_left = awful.popup { widget = wibox.container.background, ontop = false, bg = color["Grey900"], @@ -24,7 +24,7 @@ return function(s, widgets) end } - bottom_right:struts { + bottom_left:struts { bottom = 65 } @@ -76,7 +76,7 @@ return function(s, widgets) return layout end - bottom_right:setup { + bottom_left:setup { nil, nil, prepare_widgets(widgets), diff --git a/crylia_bar/init.lua b/crylia_bar/init.lua index 1600e8f..17cc083 100644 --- a/crylia_bar/init.lua +++ b/crylia_bar/init.lua @@ -61,7 +61,7 @@ awful.screen.connect_for_each_screen( require("crylia_bar.left_bar")(s, { s.layoutlist, s.taglist }) require("crylia_bar.center_bar")(s, { s.tasklist }) require("crylia_bar.right_bar")(s, { s.gpu_temp, s.cpu_temp, s.ram_info, s.kblayout, s.bluetooth, s.network, s.clock, s.powerbutton }) - require("crylia_bar.bottom_right_bar")(s, { s.mpris }) + require("crylia_bar.bottom_left_bar")(s, { s.mpris }) end end ) diff --git a/mappings/global_keys.lua b/mappings/global_keys.lua index 9898de0..65604f1 100644 --- a/mappings/global_keys.lua +++ b/mappings/global_keys.lua @@ -6,6 +6,8 @@ local ruled = require("ruled") local modkey = user_vars.modkey local switcher = require("src.modules.awesome_switcher") +local revelation = require("src.modules.revelation") +revelation.init() return gears.table.join( awful.key( @@ -49,6 +51,12 @@ return gears.table.join( end, { description = "Focus previous client by index", group = "Client" } ), + awful.key( + { modkey, "Shift" }, + "w", + revelation, + { description = "Focus previous client by index", group = "Client" } + ), --awful.key( -- { "Mod1" }, -- "#23", @@ -209,6 +217,14 @@ return gears.table.join( end, { descripton = "Client switcher (alt+tab)", group = "Application" } ), + awful.key( + { modkey }, + "#25", + function() + awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi") + end, + { descripton = "Client switcher (alt+tab)", group = "Application" } + ), awful.key( { modkey }, "#26", diff --git a/src/widgets/notification_list.lua b/src/widgets/notification_list.lua new file mode 100644 index 0000000..0462f8a --- /dev/null +++ b/src/widgets/notification_list.lua @@ -0,0 +1,80 @@ +--------------------------------- +-- This is the mPris2 widget -- +--------------------------------- + +-- Awesome Libs +local awful = require("awful") +local naughty = require("naughty") +local color = require("src.theme.colors") +local cat = require("src.theme.catppuccin") +local dpi = require("beautiful").xresources.apply_dpi +local gears = require("gears") +local wibox = require("wibox") +require("src.core.signals") + +-- Icon directory path +local icon_dir = awful.util.getdir("config") .. "src/assets/icons/mpris/" + +-- Returns the mPris widget +return function() + + local notification_list = wibox.widget { + { + { + { + { + { + id = "icon", + image = gears.color.recolor_image(icon_dir .. "disc" .. ".png", cat["Crust"]), + widget = wibox.widget.imagebox, + resize = true + }, + id = "icon_layout", + widget = wibox.container.place + }, + widget = wibox.container.margin, + id = "icon_margin" + }, + spacing = dpi(10), + { + { + { + id = "title", + font = "UbuntuMono Nerd Font, Bold 11", + align = "left", + widget = wibox.widget.textbox + }, + { + id = "desc", + font = "UbuntuMono Nerd Font, Bold 8", + align = "left", + widget = wibox.widget.textbox + }, + id = "label", + layout = wibox.layout.fixed.vertical + }, + id = "label_margin", + top = dpi(2), + widget = wibox.container.margin + }, + id = "mpris_layout", + layout = wibox.layout.fixed.horizontal + }, + id = "container", + right = dpi(10), + widget = wibox.container.margin + }, + bg = cat["Lavender"], + fg = cat["Crust"], + shape = function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, 5) + end, + forced_height = 65, + widget = wibox.container.background + } + + Hover_signal(notification_list, cat["Lavender"], cat["Crust"]) + + return notification_list +end +