Add application launcher and rewritten window switcher, remove rofi as its no longer needed and replaced by widgets. Fixed a lot of bugs and weird behaviour
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
screen.connect_signal(
|
||||
"added",
|
||||
@@ -30,6 +31,9 @@ client.connect_signal(
|
||||
gears.shape.rounded_rect(cr, width, height, 10)
|
||||
end
|
||||
end
|
||||
if c.class == "Brave-browser" then
|
||||
c.floating = false
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@@ -78,25 +82,33 @@ client.connect_signal(
|
||||
)
|
||||
|
||||
--- Takes a wibox.container.background and connects four signals to it
|
||||
---@diagnostic disable-next-line: undefined-doc-name
|
||||
---@param widget widget.container.background
|
||||
---@param bg string
|
||||
---@param fg string
|
||||
function Hover_signal(widget, bg, fg)
|
||||
local old_wibox, old_cursor, old_bg, old_fg
|
||||
---@param widget wibox.container.background
|
||||
---@param bg string | nil
|
||||
---@param fg string | nil
|
||||
---@param border_color string | nil
|
||||
function Hover_signal(widget, bg, fg, border_color)
|
||||
local old_wibox, old_cursor, old_bg, old_fg, old_border
|
||||
|
||||
local r, g, b
|
||||
|
||||
bg = bg or nil
|
||||
fg = fg or nil
|
||||
border_color = border_color or nil
|
||||
|
||||
local mouse_enter = function()
|
||||
if bg then
|
||||
old_bg = widget.bg
|
||||
if string.len(bg) == 7 then
|
||||
widget.bg = bg .. 'dd'
|
||||
else
|
||||
widget.bg = bg
|
||||
end
|
||||
if bg ~= nil then
|
||||
_, r, g, b, _ = widget.bg:get_rgba()
|
||||
old_bg = RGB_to_hex(r, g, b)
|
||||
widget.bg = bg .. "dd"
|
||||
end
|
||||
if fg then
|
||||
old_fg = widget.fg
|
||||
widget.fg = fg
|
||||
_, r, g, b, _ = widget.fg:get_rgba()
|
||||
old_fg = RGB_to_hex(r, g, b)
|
||||
widget.fg = fg .. "dd"
|
||||
end
|
||||
if border_color then
|
||||
old_border = widget.border_color
|
||||
widget.border_color = border_color .. "dd"
|
||||
end
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
@@ -107,13 +119,7 @@ function Hover_signal(widget, bg, fg)
|
||||
|
||||
local button_press = function()
|
||||
if bg then
|
||||
if bg then
|
||||
if string.len(bg) == 7 then
|
||||
widget.bg = bg .. 'bb'
|
||||
else
|
||||
widget.bg = bg
|
||||
end
|
||||
end
|
||||
widget.bg = bg
|
||||
end
|
||||
if fg then
|
||||
widget.fg = fg
|
||||
@@ -122,13 +128,7 @@ function Hover_signal(widget, bg, fg)
|
||||
|
||||
local button_release = function()
|
||||
if bg then
|
||||
if bg then
|
||||
if string.len(bg) == 7 then
|
||||
widget.bg = bg .. 'dd'
|
||||
else
|
||||
widget.bg = bg
|
||||
end
|
||||
end
|
||||
widget.bg = bg
|
||||
end
|
||||
if fg then
|
||||
widget.fg = fg
|
||||
@@ -142,26 +142,22 @@ function Hover_signal(widget, bg, fg)
|
||||
if fg then
|
||||
widget.fg = old_fg
|
||||
end
|
||||
if border_color then
|
||||
widget.border_color = old_border
|
||||
end
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
|
||||
widget:disconnect_signal("mouse::enter", mouse_enter)
|
||||
|
||||
--[[ widget:disconnect_signal("mouse::enter", mouse_enter)
|
||||
widget:disconnect_signal("button::press", button_press)
|
||||
|
||||
widget:disconnect_signal("button::release", button_release)
|
||||
|
||||
widget:disconnect_signal("mouse::leave", mouse_leave)
|
||||
|
||||
widget:disconnect_signal("mouse::leave", mouse_leave) ]]
|
||||
widget:connect_signal("mouse::enter", mouse_enter)
|
||||
|
||||
widget:connect_signal("button::press", button_press)
|
||||
|
||||
widget:connect_signal("button::release", button_release)
|
||||
|
||||
widget:connect_signal("mouse::leave", mouse_leave)
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user