Huge refractor and many fixes for dock, icons(again) etc
This commit is contained in:
33
awesome/src/core/error_handling.lua
Normal file
33
awesome/src/core/error_handling.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
----------------------------------------------------------------
|
||||
-- This class is to output an error if you fuck up the config --
|
||||
----------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local naughty = require("naughty")
|
||||
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "! Not so Awesome ERROR !",
|
||||
text = awesome.startup_errors
|
||||
})
|
||||
end
|
||||
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal(
|
||||
"debug::error",
|
||||
function(err)
|
||||
if in_error then
|
||||
return
|
||||
end
|
||||
in_error = true
|
||||
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "ERROR",
|
||||
text = tostring(err)
|
||||
})
|
||||
in_error = false
|
||||
end
|
||||
)
|
||||
end
|
||||
50
awesome/src/core/rules.lua
Normal file
50
awesome/src/core/rules.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
-------------------------------------------------------------------------------------------------
|
||||
-- This class contains rules for float exceptions or special themeing for certain applications --
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
awful.rules.rules = {
|
||||
{
|
||||
rule = {},
|
||||
properties = {
|
||||
border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = require("../../mappings/client_keys"),
|
||||
buttons = require("../../mappings/client_buttons"),
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
||||
}
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
instance = {},
|
||||
class = {
|
||||
"Arandr",
|
||||
"Lxappearance",
|
||||
"kdeconnect.app",
|
||||
"zoom",
|
||||
"file-roller",
|
||||
"File-roller"
|
||||
},
|
||||
name = {},
|
||||
role = {
|
||||
"AlarmWindow",
|
||||
"ConfigManager",
|
||||
"pop-up"
|
||||
}
|
||||
},
|
||||
properties = { floating = true, titlebars_enabled = true }
|
||||
},
|
||||
{
|
||||
id = "titlebar",
|
||||
rule_any = {
|
||||
type = { "normal", "dialog", "modal", "utility" }
|
||||
},
|
||||
properties = { titlebars_enabled = true }
|
||||
}
|
||||
}
|
||||
150
awesome/src/core/signals.lua
Normal file
150
awesome/src/core/signals.lua
Normal file
@@ -0,0 +1,150 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
screen.connect_signal(
|
||||
"added",
|
||||
function()
|
||||
awesome.restart()
|
||||
end
|
||||
)
|
||||
|
||||
screen.connect_signal(
|
||||
"removed",
|
||||
function()
|
||||
awesome.restart()
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
"manage",
|
||||
function(c)
|
||||
if awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'unmanage',
|
||||
function(c)
|
||||
if #awful.screen.focused().clients > 0 then
|
||||
awful.screen.focused().clients[1]:emit_signal(
|
||||
'request::activate',
|
||||
'mouse_enter',
|
||||
{
|
||||
raise = true
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'tag::switched',
|
||||
function(c)
|
||||
if #awful.screen.focused().clients > 0 then
|
||||
awful.screen.focused().clients[1]:emit_signal(
|
||||
'request::activate',
|
||||
'mouse_enter',
|
||||
{
|
||||
raise = true
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
-- Sloppy focus
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
||||
end)
|
||||
|
||||
-- Workaround for focused border color, why in the love of god doesnt it work with
|
||||
-- beautiful.border_focus
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = "#616161"
|
||||
end)
|
||||
|
||||
client.connect_signal("unfocus", function(c)
|
||||
c.border_color = beautiful.border_normal
|
||||
end)
|
||||
|
||||
function Hover_signal(widget, bg, fg)
|
||||
local old_wibox, old_cursor, old_bg, old_fg
|
||||
widget:connect_signal(
|
||||
"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
|
||||
end
|
||||
if fg then
|
||||
old_fg = widget.fg
|
||||
widget.fg = fg
|
||||
end
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
widget:connect_signal(
|
||||
"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
|
||||
end
|
||||
if fg then
|
||||
widget.fg = fg
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
widget:connect_signal(
|
||||
"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
|
||||
end
|
||||
if fg then
|
||||
widget.fg = fg
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function()
|
||||
if bg then
|
||||
widget.bg = old_bg
|
||||
end
|
||||
if fg then
|
||||
widget.fg = old_fg
|
||||
end
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
Reference in New Issue
Block a user