From 61cbed0c52d2ea38a3484100dd8f057175b3a69f Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sat, 16 Oct 2021 15:33:51 +0200 Subject: [PATCH] add: tooling - vim modline - .editorconfig - stylua.toml --- .editorconfig | 12 ++++++++++++ init.lua | 2 ++ slots/client.lua | 14 ++++++++------ slots/init.lua | 10 ++++++---- slots/ruled.lua | 14 ++++++++------ slots/screen.lua | 12 +++++++----- slots/tag.lua | 6 ++++-- stylua.toml | 6 ++++++ 8 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 .editorconfig create mode 100644 stylua.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c1e2c64 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/init.lua b/init.lua index 2d01f11..321cc77 100644 --- a/init.lua +++ b/init.lua @@ -191,3 +191,5 @@ function awesome_slot.mt:__call(params) -- luacheck: ignore unused argument self end return setmetatable(awesome_slot, awesome_slot.mt) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/slots/client.lua b/slots/client.lua index 78cf450..b93beaf 100644 --- a/slots/client.lua +++ b/slots/client.lua @@ -1,19 +1,21 @@ local client_slots = {} -function client_slots.append_mousebindings (params) - local amouse = require 'awful.mouse' +function client_slots.append_mousebindings(params) + local amouse = require "awful.mouse" - for _,bindings in pairs(params.mousebindings) do + 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' +function client_slots.append_keybindings(params) + local akeyboard = require "awful.keyboard" - for _,bindings in pairs(params.keybindings) do + 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 diff --git a/slots/init.lua b/slots/init.lua index 99ce661..f7d6c2d 100644 --- a/slots/init.lua +++ b/slots/init.lua @@ -1,8 +1,10 @@ local aslot_slots = {} -aslot_slots.client = require 'awesome-slot.slots.client' -aslot_slots.ruled = require 'awesome-slot.slots.ruled' -aslot_slots.screen = require 'awesome-slot.slots.screen' -aslot_slots.tag = require 'awesome-slot.slots.tag' +aslot_slots.client = require "awesome-slot.slots.client" +aslot_slots.ruled = require "awesome-slot.slots.ruled" +aslot_slots.screen = require "awesome-slot.slots.screen" +aslot_slots.tag = require "awesome-slot.slots.tag" return aslot_slots + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/slots/ruled.lua b/slots/ruled.lua index ce2e958..583f970 100644 --- a/slots/ruled.lua +++ b/slots/ruled.lua @@ -1,19 +1,21 @@ local ruled_slots = {} -function ruled_slots.append_client_rules (params) - local rclient = require 'ruled.client' +function ruled_slots.append_client_rules(params) + local rclient = require "ruled.client" - for _,rule in pairs(params.rules) do + 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' +function ruled_slots.append_notification_rules(params) + local rnotification = require "ruled.notification" - for _,rule in pairs(params.rules) do + 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 diff --git a/slots/screen.lua b/slots/screen.lua index dc28d59..3c9c811 100644 --- a/slots/screen.lua +++ b/slots/screen.lua @@ -1,18 +1,18 @@ local screen_slots = {} -function screen_slots.wallpaper (screen, params) - local beautiful = require 'beautiful' - local gwallpaper = require 'gears.wallpaper' +function screen_slots.wallpaper(screen, params) + local beautiful = require "beautiful" + local gwallpaper = require "gears.wallpaper" params = params or { - wallpaper = beautiful.wallpaper + 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 + if type(wallpaper) == "function" then wallpaper = wallpaper(screen) end @@ -21,3 +21,5 @@ function screen_slots.wallpaper (screen, params) end return screen_slots + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/slots/tag.lua b/slots/tag.lua index dc5ff57..a5058c8 100644 --- a/slots/tag.lua +++ b/slots/tag.lua @@ -1,9 +1,11 @@ local tag_slots = {} -function tag_slots.default_layouts (params) - local alayout = require 'awful.layout' +function tag_slots.default_layouts(params) + local alayout = require "awful.layout" alayout.append_default_layouts(params.layouts) end return tag_slots + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..976e686 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,6 @@ +column_width = 80 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 4 +quote_style = "AutoPreferDouble" +no_call_parentheses = true