forked from ChocolateBread799/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.lua
executable file
·94 lines (70 loc) · 2.85 KB
/
rc.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
pcall(require, "luarocks.loader")
-- 📚 Library
local gears = require("gears")
local gfs = require("gears.filesystem")
local awful = require("awful")
local beautiful = require("beautiful")
-- 🎨 Theme
beautiful.init(gfs.get_configuration_dir() .. "theme/theme.lua")
local bg = beautiful.bg_normal
local fg = beautiful.text_color
local ansi = beautiful.ansi
awful.spawn("sed -i '9s/.*/ background = \"" .. bg .. "\",/' " .. gfs.get_configuration_dir() .. "../wezterm/wezterm.lua")
awful.spawn("sed -i '8s/.*/ foreground = \"" .. fg .. "\",/' " .. gfs.get_configuration_dir() .. "../wezterm/wezterm.lua")
awful.spawn("sed -i \"17s/.*/ ansi = " .. ansi .. ",/\" " .. gfs.get_configuration_dir() .. "../wezterm/wezterm.lua")
awful.spawn("sed -i \"18s/.*/ brights = " .. ansi .. ",/\" " .. gfs.get_configuration_dir() .. "../wezterm/wezterm.lua")
-- ✨ Modules
require("modules")
-- Require
require("awful.autofocus")
require("awful.hotkeys_popup.keys")
require("config")
require("ui")
require("awful.remote")
--require("notifications")
-- 🚀 Launch Script
local autostart = require("autostart")
-- Signals And Rules
awful.rules.rules = {
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
{ rule_any = {
}, properties = { floating = true }},
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = true }
},
}
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Error occured",
text = awesome.startup_errors })
end
client.connect_signal("manage", function(c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and not c.size_hints.user_position and
not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("focus",
function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus",
function(c) c.border_color = beautiful.border_normal end)
root.keys(globalkeys)
require("signals")