dotfiles/config/awesome/custom/applications.lua

60 lines
989 B
Lua
Raw Permalink Normal View History

2023-03-16 05:12:44 -04:00
-- {{{ Modules
local awful = require("awful")
2023-11-11 12:25:46 -05:00
local options = require("options")
2023-03-16 05:12:44 -04:00
-- }}}
-- {{{ Variables
-- Applications that will be started
local start_applications = {
"picom",
"flameshot",
"nm-applet",
"lxpolkit",
"unclutter",
"radiotray-ng",
"keepassxc"
}
-- Applications that will be killed on exit/restart
local kill_applications = {
"keepassxc"
}
-- }}}
-- {{{ Functions
local function kill_apps()
for _, cmd in ipairs(kill_applications) do
awful.spawn("pkill " .. cmd)
end
end
2023-11-11 12:25:46 -05:00
local function quit()
2023-03-16 05:12:44 -04:00
kill_apps()
2023-11-11 12:25:46 -05:00
awesome.quit()
2023-03-16 05:12:44 -04:00
end
2023-11-11 12:25:46 -05:00
local function start()
for _, cmd in ipairs(start_applications) do
awful.spawn.single_instance(cmd)
end
end
local function restart()
2023-03-16 05:12:44 -04:00
kill_apps()
2023-11-11 12:25:46 -05:00
awesome.restart()
awful.spawn(options.terminal .. "-e xmodmap ~/.Xmodmap")
2023-03-16 05:12:44 -04:00
end
-- }}}
--- {{{ Script
2023-11-11 12:25:46 -05:00
start()
2023-03-16 05:12:44 -04:00
return {
kill_apps = kill_apps,
restart = restart,
2023-11-11 12:25:46 -05:00
start = start,
2023-03-16 05:12:44 -04:00
quit = quit
}
-- }}}