Cleanup
This commit is contained in:
parent
a783ea9627
commit
994f1f72ef
|
@ -13,7 +13,6 @@
|
|||
local naughty = require("naughty")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local awful = require("awful")
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
|
|
|
@ -150,14 +150,14 @@ top_panel.create = function(s)
|
|||
end)
|
||||
|
||||
-- connect panel visibility function to relevant signals
|
||||
updates_indicator:connect_signal("button::press", function(c, _, _, button)
|
||||
updates_indicator:connect_signal("button::press", function(_, _, _, _)
|
||||
local update_command = 'WINIT_X11_SCALE_FACTOR=1 alacritty -e bash -c "yay ; echo \'\nDone, press any key to exit...\' ; read"'
|
||||
awful.spawn.easy_async_with_shell(update_command, function(_)
|
||||
watch_timer:emit_signal("timeout")
|
||||
end)
|
||||
end)
|
||||
|
||||
clock:connect_signal("button::press", function(c, _, _, button)
|
||||
clock:connect_signal("button::press", function(_, _, _, _)
|
||||
awful.spawn('gnome-calendar')
|
||||
end)
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local naughty = require("naughty")
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
|
|
|
@ -65,14 +65,6 @@ local function resize_client(c, direction)
|
|||
end
|
||||
|
||||
|
||||
-- raise focused client
|
||||
local function raise_client()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Mouse bindings
|
||||
-- ===================================================================
|
||||
|
@ -312,70 +304,6 @@ keys.globalkeys = gears.table.join(
|
|||
{description = "Launch the calculator", group = "hotkeys"}
|
||||
),
|
||||
|
||||
-- =========================================
|
||||
-- CLIENT FOCUSING
|
||||
-- =========================================
|
||||
|
||||
-- Focus client by direction (hjkl keys)
|
||||
-- awful.key({modkey}, "j",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("down")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus down", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "k",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("up")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus up", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "h",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("left")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus left", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "l",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("right")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus right", group = "client"}
|
||||
-- ),
|
||||
|
||||
-- Focus client by direction (arrow keys)
|
||||
-- awful.key({modkey}, "Down",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("down")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus down", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "Up",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("up")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus up", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "Left",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("left")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus left", group = "client"}
|
||||
-- ),
|
||||
-- awful.key({modkey}, "Right",
|
||||
-- function()
|
||||
-- awful.client.focus.bydirection("right")
|
||||
-- raise_client()
|
||||
-- end,
|
||||
-- {description = "focus right", group = "client"}
|
||||
-- ),
|
||||
|
||||
-- Focus client by index (cycle through clients)
|
||||
awful.key({modkey}, "Tab",
|
||||
function()
|
||||
|
@ -406,42 +334,42 @@ keys.globalkeys = gears.table.join(
|
|||
-- =========================================
|
||||
|
||||
awful.key({modkey, "Control"}, "Down",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "down")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "Up",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "up")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "Left",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "left")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "Right",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "right")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "j",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "down")
|
||||
end
|
||||
),
|
||||
awful.key({ modkey, "Control" }, "k",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "up")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "h",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "left")
|
||||
end
|
||||
),
|
||||
awful.key({modkey, "Control"}, "l",
|
||||
function(c)
|
||||
function(_)
|
||||
resize_client(client.focus, "right")
|
||||
end
|
||||
),
|
||||
|
@ -554,8 +482,8 @@ keys.clientkeys = gears.table.join(
|
|||
awful.key({modkey}, "q",
|
||||
function(c)
|
||||
c:kill()
|
||||
for i, c in ipairs(client.get()) do
|
||||
c.minimized = false
|
||||
for _, i in ipairs(client.get()) do
|
||||
i.minimized = false
|
||||
end
|
||||
end,
|
||||
{description = "close", group = "client"}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/zsh
|
||||
|
||||
declare -i count=3
|
||||
declare -i seconds=0.5
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ local wibox = require('wibox')
|
|||
-- ===================================================================
|
||||
|
||||
|
||||
function build(widget)
|
||||
local function build(widget)
|
||||
local container =
|
||||
wibox.widget {
|
||||
widget,
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
-- ███████╗ ██████╗ ██╗ ██████╗ ███████╗██████╗
|
||||
-- ██╔════╝██╔═══██╗██║ ██╔══██╗██╔════╝██╔══██╗
|
||||
-- █████╗ ██║ ██║██║ ██║ ██║█████╗ ██████╔╝
|
||||
-- ██╔══╝ ██║ ██║██║ ██║ ██║██╔══╝ ██╔══██╗
|
||||
-- ██║ ╚██████╔╝███████╗██████╔╝███████╗██║ ██║
|
||||
-- ╚═╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝
|
||||
|
||||
-- ===================================================================
|
||||
-- Initialization
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local clickable_container = require("widgets.clickable-container")
|
||||
local gears = require("gears")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
|
||||
local HOME_DIR = os.getenv("HOME")
|
||||
local PATH_TO_ICONS = HOME_DIR .. "/.config/awesome/icons/folders/"
|
||||
|
||||
-- define module table
|
||||
local folder = {}
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Helper Functions
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
-- split a string into a list based on a deliminator
|
||||
local function split_string(inputstr, delim)
|
||||
if delim == nil then
|
||||
delim = "%s"
|
||||
end
|
||||
local t={}
|
||||
for str in string.gmatch(inputstr, "([^"..delim.."]+)") do
|
||||
table.insert(t, str)
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
|
||||
-- ===================================================================
|
||||
-- Functionality
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
function folder.create(directory)
|
||||
local docu_widget = wibox.widget {
|
||||
{
|
||||
id = "icon",
|
||||
widget = wibox.widget.imagebox,
|
||||
resize = true
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
|
||||
local docu_button = clickable_container(wibox.container.margin(docu_widget, dpi(8), dpi(8), dpi(8), dpi(8)))
|
||||
docu_button:buttons(
|
||||
gears.table.join(
|
||||
awful.button({}, 1, nil,
|
||||
function()
|
||||
awful.spawn.easy_async_with_shell(apps.filebrowser .. " " .. directory, function(stderr) end, 1)
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- determine hover name & icon to use
|
||||
-- icon name must correspond with name of folder
|
||||
local folder_name = ""
|
||||
if directory == HOME_DIR then
|
||||
folder_name = "Home"
|
||||
elseif directory == "trash://" then
|
||||
folder_name = "Trash"
|
||||
else
|
||||
local dir_list = split_string(directory, "/")
|
||||
folder_name = dir_list[#dir_list]
|
||||
end
|
||||
|
||||
awful.tooltip({
|
||||
objects = {docu_button},
|
||||
mode = "outside",
|
||||
align = "right",
|
||||
timer_function = function()
|
||||
return folder_name
|
||||
end,
|
||||
preferred_positions = {"right", "left", "top", "bottom"}
|
||||
})
|
||||
|
||||
docu_widget.icon:set_image(PATH_TO_ICONS .. folder_name:lower() .. ".png")
|
||||
return docu_button
|
||||
end
|
||||
|
||||
return folder
|
|
@ -1,16 +1,14 @@
|
|||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local theme = require("theme")
|
||||
local naughty = require("naughty")
|
||||
|
||||
local tag_list = {}
|
||||
|
||||
tag_list.create = function(s)
|
||||
local filter = function(tag)
|
||||
count = 0
|
||||
for idx, tag in ipairs(s.tags) do
|
||||
if #tag:clients() > 0 or tag.selected then
|
||||
local count = 0
|
||||
for _, t in ipairs(s.tags) do
|
||||
if #t:clients() > 0 or t.selected then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
@ -21,7 +19,7 @@ tag_list.create = function(s)
|
|||
awful.button({}, 1,
|
||||
function(c)
|
||||
c.selected = true
|
||||
for idx, tag in ipairs(s.tags) do
|
||||
for _, tag in ipairs(s.tags) do
|
||||
if tag.index ~= c.index then
|
||||
tag.selected = false
|
||||
end
|
||||
|
@ -46,7 +44,7 @@ tag_list.create = function(s)
|
|||
id = 'background_role',
|
||||
widget = wibox.container.background,
|
||||
|
||||
create_callback = function(self, c3, index, objects)
|
||||
create_callback = function(self, c3, _, _)
|
||||
self:get_children_by_id('index_role')[1].markup = '<b> '..c3.name..' </b>'
|
||||
self:connect_signal('mouse::enter', function()
|
||||
if self.bg ~= theme.top_panel_powerline then
|
||||
|
|
|
@ -51,7 +51,7 @@ local function create_buttons(buttons, object)
|
|||
end
|
||||
|
||||
|
||||
local function list_update(w, buttons, label, data, objects)
|
||||
local function list_update(w, buttons, label, _, objects)
|
||||
-- update the widgets, creating them if needed
|
||||
w:reset()
|
||||
local index = 0
|
||||
|
@ -112,7 +112,7 @@ local function list_update(w, buttons, label, data, objects)
|
|||
delay_show = 1,
|
||||
})
|
||||
|
||||
local text, bg, bg_image, icon, args = label(o, tb)
|
||||
local text, _, bg_image, icon, args = label(o, tb)
|
||||
args = args or {}
|
||||
|
||||
-- The text might be invalid, so use pcall.
|
||||
|
|
|
@ -191,11 +191,15 @@ require('lspconfig').lua_ls.setup {
|
|||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
globals = {'vim', 'use', 'awesome', 'client', 'root'},
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
library = {
|
||||
['/usr/share/nvim/runtime/lua'] = true,
|
||||
['/usr/share/nvim/runtime/lua/lsp'] = true,
|
||||
['/usr/share/awesome/lib'] = true
|
||||
}
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
|
|
Loading…
Reference in New Issue