This repository has been archived by the owner on May 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.lua
86 lines (77 loc) · 2.36 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
-- {{{ Include awesome libs
-- Standard awesome library
awful = require("awful")
awful.rules = require("awful.rules")
wibox = require("wibox")
gears = require("gears")
-- Theme handling library
beautiful = require("beautiful")
-- Notification library
naughty = require("naughty")
-- }}}
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
-- Make sure we don't go into an endless error loop
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = err })
in_error = false
end)
end
-- }}}
-- {{{ Basic configuration
-- Configure pathes
configpath = os.getenv("HOME") .. "/.config/awesome/"
themepath = configpath .. "theme/"
-- Include user awesome config dir into package path
package.path = package.path .. ";" .. configpath .. "widgets/?.lua"
-- Initialize theme
beautiful.init(themepath .. "theme.lua")
-- Set your primary monitor (for taskbar, opening windows, etc.)
primary_screen = 1
-- Set modifier key for all operations
modkey = "Mod4"
-- }}}
-- Clear all shortcuts before including any file
root.keys({ })
-- Include general functions
dofile(configpath .. 'functions.lua')
-- {{{ Include all ui elements
dofile(configpath .. 'ui/wallpaper.lua')
dofile(configpath .. 'ui/clients.lua')
dofile(configpath .. 'ui/bar.lua')
dofile(configpath .. 'ui/keys.lua')
dofile(configpath .. 'ui/tools.lua')
-- }}}
lfs = require('lfs')
-- {{{ Load custom scripts from custom.d directory
customdir = configpath .. 'custom.d/'
for s in lfs.dir(customdir) do
local f = lfs.attributes(customdir .. s)
if s:sub(-4) == ".lua" and f.mode == "file" then
dofile(customdir .. s)
end
end
-- }}}
-- {{{ Autostart all executables from start.d directory
startdir = configpath .. 'start.d/'
for s in lfs.dir(startdir) do
local f = lfs.attributes(startdir .. s)
-- Exclude README file
if s ~= "README" and f.mode == "file" then
run_once(startdir .. s)
end
end
-- }}}