This commit is contained in:
Thomas Avé 2023-05-20 23:04:33 +02:00
parent a783ea9627
commit 994f1f72ef
10 changed files with 28 additions and 194 deletions

View File

@ -13,7 +13,6 @@
local naughty = require("naughty") local naughty = require("naughty")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox")
local awful = require("awful") local awful = require("awful")
local dpi = beautiful.xresources.apply_dpi local dpi = beautiful.xresources.apply_dpi

View File

@ -150,14 +150,14 @@ top_panel.create = function(s)
end) end)
-- connect panel visibility function to relevant signals -- 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"' 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(_) awful.spawn.easy_async_with_shell(update_command, function(_)
watch_timer:emit_signal("timeout") watch_timer:emit_signal("timeout")
end) end)
end) end)
clock:connect_signal("button::press", function(c, _, _, button) clock:connect_signal("button::press", function(_, _, _, _)
awful.spawn('gnome-calendar') awful.spawn('gnome-calendar')
end) end)

View File

@ -12,7 +12,6 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears") local gears = require("gears")
local naughty = require("naughty")
-- =================================================================== -- ===================================================================

View File

@ -65,14 +65,6 @@ local function resize_client(c, direction)
end end
-- raise focused client
local function raise_client()
if client.focus then
client.focus:raise()
end
end
-- =================================================================== -- ===================================================================
-- Mouse bindings -- Mouse bindings
-- =================================================================== -- ===================================================================
@ -312,70 +304,6 @@ keys.globalkeys = gears.table.join(
{description = "Launch the calculator", group = "hotkeys"} {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) -- Focus client by index (cycle through clients)
awful.key({modkey}, "Tab", awful.key({modkey}, "Tab",
function() function()
@ -406,42 +334,42 @@ keys.globalkeys = gears.table.join(
-- ========================================= -- =========================================
awful.key({modkey, "Control"}, "Down", awful.key({modkey, "Control"}, "Down",
function(c) function(_)
resize_client(client.focus, "down") resize_client(client.focus, "down")
end end
), ),
awful.key({modkey, "Control"}, "Up", awful.key({modkey, "Control"}, "Up",
function(c) function(_)
resize_client(client.focus, "up") resize_client(client.focus, "up")
end end
), ),
awful.key({modkey, "Control"}, "Left", awful.key({modkey, "Control"}, "Left",
function(c) function(_)
resize_client(client.focus, "left") resize_client(client.focus, "left")
end end
), ),
awful.key({modkey, "Control"}, "Right", awful.key({modkey, "Control"}, "Right",
function(c) function(_)
resize_client(client.focus, "right") resize_client(client.focus, "right")
end end
), ),
awful.key({modkey, "Control"}, "j", awful.key({modkey, "Control"}, "j",
function(c) function(_)
resize_client(client.focus, "down") resize_client(client.focus, "down")
end end
), ),
awful.key({ modkey, "Control" }, "k", awful.key({ modkey, "Control" }, "k",
function(c) function(_)
resize_client(client.focus, "up") resize_client(client.focus, "up")
end end
), ),
awful.key({modkey, "Control"}, "h", awful.key({modkey, "Control"}, "h",
function(c) function(_)
resize_client(client.focus, "left") resize_client(client.focus, "left")
end end
), ),
awful.key({modkey, "Control"}, "l", awful.key({modkey, "Control"}, "l",
function(c) function(_)
resize_client(client.focus, "right") resize_client(client.focus, "right")
end end
), ),
@ -554,8 +482,8 @@ keys.clientkeys = gears.table.join(
awful.key({modkey}, "q", awful.key({modkey}, "q",
function(c) function(c)
c:kill() c:kill()
for i, c in ipairs(client.get()) do for _, i in ipairs(client.get()) do
c.minimized = false i.minimized = false
end end
end, end,
{description = "close", group = "client"} {description = "close", group = "client"}

View File

@ -1,3 +1,5 @@
#!/bin/zsh
declare -i count=3 declare -i count=3
declare -i seconds=0.5 declare -i seconds=0.5

View File

@ -25,7 +25,7 @@ local wibox = require('wibox')
-- =================================================================== -- ===================================================================
function build(widget) local function build(widget)
local container = local container =
wibox.widget { wibox.widget {
widget, widget,

View File

@ -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

View File

@ -1,16 +1,14 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
local theme = require("theme") local theme = require("theme")
local naughty = require("naughty")
local tag_list = {} local tag_list = {}
tag_list.create = function(s) tag_list.create = function(s)
local filter = function(tag) local filter = function(tag)
count = 0 local count = 0
for idx, tag in ipairs(s.tags) do for _, t in ipairs(s.tags) do
if #tag:clients() > 0 or tag.selected then if #t:clients() > 0 or t.selected then
count = count + 1 count = count + 1
end end
end end
@ -21,7 +19,7 @@ tag_list.create = function(s)
awful.button({}, 1, awful.button({}, 1,
function(c) function(c)
c.selected = true c.selected = true
for idx, tag in ipairs(s.tags) do for _, tag in ipairs(s.tags) do
if tag.index ~= c.index then if tag.index ~= c.index then
tag.selected = false tag.selected = false
end end
@ -46,7 +44,7 @@ tag_list.create = function(s)
id = 'background_role', id = 'background_role',
widget = wibox.container.background, 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:get_children_by_id('index_role')[1].markup = '<b> '..c3.name..' </b>'
self:connect_signal('mouse::enter', function() self:connect_signal('mouse::enter', function()
if self.bg ~= theme.top_panel_powerline then if self.bg ~= theme.top_panel_powerline then

View File

@ -51,7 +51,7 @@ local function create_buttons(buttons, object)
end 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 -- update the widgets, creating them if needed
w:reset() w:reset()
local index = 0 local index = 0
@ -112,7 +112,7 @@ local function list_update(w, buttons, label, data, objects)
delay_show = 1, 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 {} args = args or {}
-- The text might be invalid, so use pcall. -- The text might be invalid, so use pcall.

View File

@ -191,11 +191,15 @@ require('lspconfig').lua_ls.setup {
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = {'vim'}, globals = {'vim', 'use', 'awesome', 'client', 'root'},
}, },
workspace = { workspace = {
-- Make the server aware of Neovim runtime files -- 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 -- Do not send telemetry data containing a randomized but unique identifier
telemetry = { telemetry = {