feat: reorganize as a rock

This commit is contained in:
Aire-One 2024-10-24 18:48:49 +02:00
parent 4162b3b0ff
commit 31d7d7831b
17 changed files with 224 additions and 182 deletions

View File

@ -5,8 +5,11 @@ root = true
[*]
indent_style = space
indent_size = 4
indent_size = 3
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.json]
indent_size = 2

2
.gitignore vendored
View File

@ -1 +1 @@
doc/
/doc

View File

@ -1,10 +1,14 @@
-- Only allow symbols available in all Lua versions
std = "min"
files[".luacheckrc"].ignore = { "111", "112", "131" }
files["config.ld"].ignore = { "111", "113" }
cache = true
include_files = {
".luacheckrc",
"*.rockspec",
"src/",
"config.ld",
}
-- Global objects defined by the C code
read_globals = {
"awesome",
"button",
@ -27,8 +31,3 @@ globals = {
"root",
"client",
}
-- Enable cache (uses .luacheckcache relative to this rc file).
cache = true
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

6
.stylua.toml Normal file
View File

@ -0,0 +1,6 @@
indent_type = "Spaces"
indent_width = 3
call_parentheses = "None"
[sort_requires]
enabled = true

15
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
"Lua.runtime.path": [
"/usr/share/awesome/lib/?.lua",
"/usr/share/awesome/lib/?/init.lua"
],
"[lua]": {
"editor.defaultFormatter": "JohnnyMorganz.stylua"
},
"stylua.targetReleaseVersion": "latest",
"files.associations": {
".luacheckrc": "lua",
"*.rockspec": "lua",
"config.ld": "lua"
}
}

View File

@ -0,0 +1,25 @@
package = "awesome-slot"
version = "dev-1"
source = {
url = "git+https://github.com/Aire-One/awesome-slot.git",
}
description = {
summary = "A declarative API to connect signals for the AwesomeWM.",
detailed = "A declarative API to connect signals for the AwesomeWM.",
homepage = "https://github.com/Aire-One/awesome-slot",
license = "*** please specify a license ***",
}
build = {
type = "builtin",
modules = {
["awesome-slot.init"] = "src/awesome-slot/init.lua",
["awesome-slot.slots.client"] = "src/awesome-slot/slots/client.lua",
["awesome-slot.slots.init"] = "src/awesome-slot/slots/init.lua",
["awesome-slot.slots.ruled"] = "src/awesome-slot/slots/ruled.lua",
["awesome-slot.slots.screen"] = "src/awesome-slot/slots/screen.lua",
["awesome-slot.slots.tag"] = "src/awesome-slot/slots/tag.lua",
},
copy_directories = {
"doc",
},
}

View File

@ -14,9 +14,9 @@ sort_modules = true
not_luadoc = true
file = {
"init.lua",
"src/awesome-slot",
exclude = {
"slots",
"src/awesome-slot/slots",
},
}

View File

@ -1,21 +0,0 @@
local client_slots = {}
function client_slots.append_mousebindings(params)
local amouse = require "awful.mouse"
for _, bindings in pairs(params.mousebindings) do
amouse.append_client_mousebindings(bindings)
end
end
function client_slots.append_keybindings(params)
local akeyboard = require "awful.keyboard"
for _, bindings in pairs(params.keybindings) do
akeyboard.append_client_keybindings(bindings)
end
end
return client_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -1,21 +0,0 @@
local ruled_slots = {}
function ruled_slots.append_client_rules(params)
local rclient = require "ruled.client"
for _, rule in pairs(params.rules) do
rclient.append_rule(rule)
end
end
function ruled_slots.append_notification_rules(params)
local rnotification = require "ruled.notification"
for _, rule in pairs(params.rules) do
rnotification.append_rule(rule)
end
end
return ruled_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -1,25 +0,0 @@
local screen_slots = {}
function screen_slots.wallpaper(screen, params)
local beautiful = require "beautiful"
local gwallpaper = require "gears.wallpaper"
params = params or {
wallpaper = beautiful.wallpaper,
}
local wallpaper = params.wallpaper
if wallpaper then
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(screen)
end
gwallpaper.maximized(wallpaper, screen, true)
end
end
return screen_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,21 @@
local client_slots = {}
function client_slots.append_mousebindings(params)
local amouse = require "awful.mouse"
for _, bindings in pairs(params.mousebindings) do
amouse.append_client_mousebindings(bindings)
end
end
function client_slots.append_keybindings(params)
local akeyboard = require "awful.keyboard"
for _, bindings in pairs(params.keybindings) do
akeyboard.append_client_keybindings(bindings)
end
end
return client_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,21 @@
local ruled_slots = {}
function ruled_slots.append_client_rules(params)
local rclient = require "ruled.client"
for _, rule in pairs(params.rules) do
rclient.append_rule(rule)
end
end
function ruled_slots.append_notification_rules(params)
local rnotification = require "ruled.notification"
for _, rule in pairs(params.rules) do
rnotification.append_rule(rule)
end
end
return ruled_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,25 @@
local screen_slots = {}
function screen_slots.wallpaper(screen, params)
local beautiful = require "beautiful"
local gwallpaper = require "gears.wallpaper"
params = params or {
wallpaper = beautiful.wallpaper,
}
local wallpaper = params.wallpaper
if wallpaper then
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(screen)
end
gwallpaper.maximized(wallpaper, screen, true)
end
end
return screen_slots
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -1,6 +0,0 @@
column_width = 80
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 4
quote_style = "AutoPreferDouble"
no_call_parentheses = true