panik
This commit is contained in:
33
awesome/Main/ErrorHandling.lua
Normal file
33
awesome/Main/ErrorHandling.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 = "ERROR in Awesome config!",
|
||||
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
|
||||
14
awesome/Main/Layouts.lua
Normal file
14
awesome/Main/Layouts.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
------------------------------------------------------------------------------------------
|
||||
-- Layout class, if you want to add or remove layouts from the list do it in this table --
|
||||
------------------------------------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
return function ()
|
||||
local layouts = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.floating,
|
||||
}
|
||||
|
||||
return layouts
|
||||
end
|
||||
38
awesome/Main/Menu.lua
Normal file
38
awesome/Main/Menu.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
--------------------------------------------------------------
|
||||
-- Menu class, this is where you change the rightclick menu --
|
||||
--------------------------------------------------------------
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
-- Module Namespace
|
||||
local _M = { }
|
||||
|
||||
local session = {
|
||||
{ "Logout", function () awesome.quit() end },
|
||||
{ "Shutdown", function () awful.spawn.with_shell('shutdown now') end },
|
||||
{ "Reboot", function () awful.spawn.with_shell('reboot') end },
|
||||
}
|
||||
|
||||
local applications = {
|
||||
{ "Firefox", "firefox" },
|
||||
{ "VS Code", "code" },
|
||||
{ "Blender", "blender" },
|
||||
{ "Steam", "steam" },
|
||||
{ "Lutris", "lutris" },
|
||||
}
|
||||
|
||||
local settings = {
|
||||
{ "General Settings", "gnome-control-center" },
|
||||
{ "Power Settings", "xfce4-power-manager-settings" },
|
||||
{ "Display Settings", "arandr" }
|
||||
}
|
||||
|
||||
return function()
|
||||
local MenuItems = {
|
||||
{ "Power Menu", session },
|
||||
{ "Applications", applications },
|
||||
{ "Open Terminal", RC.vars.terminal },
|
||||
{ "Settings", settings },
|
||||
}
|
||||
return MenuItems
|
||||
end
|
||||
53
awesome/Main/Rules.lua
Normal file
53
awesome/Main/Rules.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
-------------------------------------------------------------------------------------------------
|
||||
-- This class contains rules for float exceptions or special themeing for certain applications --
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
return function (clientkeys, clientbuttons)
|
||||
local rules = {
|
||||
{
|
||||
rule = { },
|
||||
properties = {
|
||||
border_width = beautiful.border_width,
|
||||
border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons,
|
||||
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 }
|
||||
}
|
||||
}
|
||||
return rules
|
||||
end
|
||||
101
awesome/Main/Signals.lua
Normal file
101
awesome/Main/Signals.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
|
||||
|
||||
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)
|
||||
local old_wibox, old_cursor, old_bg
|
||||
widget:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
old_bg = widget.bg
|
||||
widget.bg = bg .. 'dd'
|
||||
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 ()
|
||||
widget.bg = bg .. 'bb'
|
||||
end
|
||||
)
|
||||
|
||||
widget:connect_signal(
|
||||
"button::release",
|
||||
function ()
|
||||
widget.bg = bg .. 'dd'
|
||||
end
|
||||
)
|
||||
|
||||
widget:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
widget.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
23
awesome/Main/Tags.lua
Normal file
23
awesome/Main/Tags.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
-- Here are the ammount of tags generated, edit the awful.tag args if you want a different ammount --
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
return function()
|
||||
local tags = {}
|
||||
awful.screen.connect_for_each_screen(
|
||||
function (s)
|
||||
tags[s] = awful.tag(
|
||||
{
|
||||
"1", "2", "3", "4", "5", "6", "7", "8", "9"
|
||||
},
|
||||
s,
|
||||
RC.Layouts[1]
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
return tags
|
||||
end
|
||||
19
awesome/Main/Theme.lua
Normal file
19
awesome/Main/Theme.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local home = os.getenv("HOME")
|
||||
|
||||
beautiful.init(home .. "/.config/awesome/theme/crylia/theme.lua")
|
||||
|
||||
if(RC.vars.wallpaper) then
|
||||
local wallpaper = RC.vars.wallpaper
|
||||
if awful.util.file_readable(wallpaper) then
|
||||
Theme.wallpaper = wallpaper
|
||||
end
|
||||
end
|
||||
|
||||
if beautiful.wallpaper then
|
||||
for s = 1, screen.count() do
|
||||
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
|
||||
end
|
||||
end
|
||||
18
awesome/Main/UserVariables.lua
Normal file
18
awesome/Main/UserVariables.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-------------------------------------------
|
||||
-- Uservariables are stored in this file --
|
||||
-------------------------------------------
|
||||
local home = os.getenv("HOME")
|
||||
|
||||
-- If you want different default programs, wallpaper path or modkey; edit this file.
|
||||
local _M = {
|
||||
-- This is your default Terminal
|
||||
terminal = "alacritty",
|
||||
-- This is the modkey 'mod4' = Super/Mod/WindowsKey, 'mod3' = alt...
|
||||
modkey = "Mod4",
|
||||
-- place your wallpaper at this path with this name, you could also try to change the path
|
||||
wallpaper = home .. "/.config/awesome/theme/crylia/assets/wallpaper.jpg",
|
||||
-- Naming scheme for the powermenu, userhost = "user@hostname", fullname = "Firstname Surname", something else ...
|
||||
namestyle = "userhost"
|
||||
}
|
||||
|
||||
return _M
|
||||
18
awesome/Main/Wallpaper.lua
Normal file
18
awesome/Main/Wallpaper.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
---------------------------------------
|
||||
-- This function sets your wallpaper --
|
||||
---------------------------------------
|
||||
-- Awesome Libs
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
function Set_wallpaper(s)
|
||||
if beautiful.wallpaper then
|
||||
local wallpaper = beautiful.wallpaper
|
||||
if type(wallpaper) == "function" then
|
||||
wallpaper = wallpaper(s)
|
||||
end
|
||||
gears.wallpaper.maximized(wallpaper, s, true)
|
||||
end
|
||||
end
|
||||
|
||||
screen.connect_signal("property::geometry", Set_wallpaper)
|
||||
Reference in New Issue
Block a user