dotfiles/awesome/rc.lua

66 lines
1.8 KiB
Lua
Raw Normal View History

2022-07-19 19:45:11 +02:00
-- Standard awesome libraries
2022-07-19 15:24:06 +02:00
local gears = require("gears")
local awful = require("awful")
2023-06-05 16:40:17 +02:00
-- Local imports
local grid = require("components.layout.grid")
2022-07-19 15:24:06 +02:00
2023-06-05 16:40:17 +02:00
-- Load components
require("components.notifications")
require("components.screen")
require("utils.signals")
-- Autofocus a new client when previously focused one is closed
require("awful.autofocus")
2022-07-19 15:24:06 +02:00
2022-07-19 19:45:11 +02:00
-- List of apps to run on start-up
local run_on_start_up = {
2022-07-23 19:31:38 +02:00
"numlockx on",
"nm-applet",
2022-07-29 20:48:32 +02:00
"xcape -e \"Super_L=Super_L|XF86Launch5\" -t 5000",
2022-11-09 23:39:00 +01:00
"xmodmap /home/user/.Xmodmap",
2023-06-05 16:22:53 +02:00
os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/setup_display.sh",
-- "/opt/power/powersave.sh",
-- os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/setup_display.sh"
2022-07-19 19:45:11 +02:00
}
2022-07-19 15:24:06 +02:00
2023-05-25 21:25:49 +02:00
-- Define layouts
awful.layout.layouts = {
grid,
awful.layout.suit.tile,
awful.layout.suit.floating,
grid.horizontal,
awful.layout.suit.fair.horizontal,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
}
2022-07-19 19:45:11 +02:00
-- Run all the apps listed in run_on_start_up
for _, app in ipairs(run_on_start_up) do
2022-07-23 19:31:38 +02:00
local findme = app
local firstspace = app:find(" ")
if firstspace then
findme = app:sub(0, firstspace - 1)
end
2023-06-05 16:40:17 +02:00
-- Run commands only if it's not already running.
2022-07-23 19:31:38 +02:00
awful.spawn.with_shell(string.format("echo 'pgrep -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false)
2022-07-19 15:24:06 +02:00
end
2022-07-19 19:45:11 +02:00
-- Import theme
local beautiful = require("beautiful")
beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua")
-- Import Keybinds
local keys = require("keys")
root.keys(keys.globalkeys)
root.buttons(keys.desktopbuttons)
-- Import rules
local create_rules = require("rules").create
awful.rules.rules = create_rules(keys.clientkeys, keys.clientbuttons)