rc.lua 2.93 KB
Newer Older
epsi sayidina's avatar
epsi sayidina committed
1
-- Awesome 3.5 Compatible Configuration
epsi sayidina's avatar
epsi sayidina committed
2 3
-- Author: Epsiarto Nurwijayadi (epsi.nurwijayadi@gmail.com)
-- Description: Awesome config, tested on Arch's awesome 3.5.9
epsi sayidina's avatar
epsi sayidina committed
4

epsi sayidina's avatar
epsi sayidina committed
5
-- {{{ Required libraries
epsi sayidina's avatar
epsi sayidina committed
6
-- Standard Awesome Library
epsi sayidina's avatar
epsi sayidina committed
7
local awful     = require("awful")
8 9
awful.rules     = require("awful.rules")
require("awful.autofocus") -- do not delete autofocus
epsi sayidina's avatar
epsi sayidina committed
10 11 12 13
-- Theme handling library
local beautiful = require("beautiful")
-- Required library
local menubar = require("menubar")
epsi sayidina's avatar
epsi sayidina committed
14 15 16
-- Optional: it can be removed safely
-- naughtyfication from command line to awesome-client.
naughty = require('naughty')
epsi sayidina's avatar
epsi sayidina committed
17 18
-- }}}

epsi sayidina's avatar
epsi sayidina committed
19 20 21
RC = {} -- global namespace, on top before require any modules
RC.vars = require("main.user-variables")

epsi sayidina's avatar
epsi sayidina committed
22 23
local config_path = awful.util.getdir("config") .. "/"
-- {{{ Error handling -- }}}
epsi sayidina's avatar
epsi sayidina committed
24
dofile(config_path .. "main/error-handling.lua")
epsi sayidina's avatar
epsi sayidina committed
25
-- {{{ Themes -- }}}
epsi sayidina's avatar
epsi sayidina committed
26
dofile(config_path .. "main/theme.lua")
epsi sayidina's avatar
epsi sayidina committed
27 28 29

-- Custom Local Library
local main = {
30 31 32 33
    layouts = require("main.layouts"),
    tags    = require("main.tags"),
    menu    = require("main.menu"),
    rules   = require("main.rules"),
epsi sayidina's avatar
epsi sayidina committed
34 35 36
}
-- Custom Local Library: Keys and Mouse Binding
local binding = {
37 38 39 40 41
    globalbuttons = require("binding.globalbuttons"),
    clientbuttons = require("binding.clientbuttons"),
    globalkeys    = require("binding.globalkeys"),
    bindtotags    = require("binding.bindtotags"),
    clientkeys    = require("binding.clientkeys")
epsi sayidina's avatar
epsi sayidina committed
42
}
epsi sayidina's avatar
epsi sayidina committed
43

44
-- Custom Dynamic Local Wibox Statusbar Module
epsi sayidina's avatar
epsi sayidina committed
45
local sbm = RC.vars.statusbarmodule
epsi sayidina's avatar
epsi sayidina committed
46 47
local sbm_name = "anybox." .. sbm .. ".statusbar"
local statusbar = require(sbm_name) -- after theme
epsi sayidina's avatar
epsi sayidina committed
48

epsi sayidina's avatar
epsi sayidina committed
49
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
epsi sayidina's avatar
epsi sayidina committed
50

epsi sayidina's avatar
epsi sayidina committed
51 52
os.execute("nm-applet &")
os.execute("compton &")    -- xcompmgr
epsi sayidina's avatar
epsi sayidina committed
53

epsi sayidina's avatar
epsi sayidina committed
54 55
-- {{{ Layouts
-- Table of layouts to cover with awful.layout.inc, order matters.
56
-- a variable needed in main.tags, and statusbar
epsi sayidina's avatar
epsi sayidina committed
57 58 59 60 61
RC.layouts = main.layouts()
-- }}}

-- {{{ Tags
-- Define a tag table which hold all screen tags.
62
-- a variable needed in rules, tasklist, and globalkeys
epsi sayidina's avatar
epsi sayidina committed
63 64 65 66 67
RC.tags = main.tags()
-- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
epsi sayidina's avatar
epsi sayidina committed
68
RC.mainmenu = awful.menu({ items = main.menu() }) -- in globalkeys
epsi sayidina's avatar
epsi sayidina committed
69

70
-- a variable needed in statusbar (helper)
epsi sayidina's avatar
epsi sayidina committed
71
RC.launcher = awful.widget.launcher(
epsi sayidina's avatar
epsi sayidina committed
72
  { image = beautiful.awesome_icon, menu = RC.mainmenu }
epsi sayidina's avatar
epsi sayidina committed
73
)
epsi sayidina's avatar
epsi sayidina committed
74

epsi sayidina's avatar
epsi sayidina committed
75
-- Menubar configuration
epsi sayidina's avatar
epsi sayidina committed
76
menubar.utils.terminal = RC.vars.terminal -- Set the terminal for applications that require it
epsi sayidina's avatar
epsi sayidina committed
77 78 79

-- }}}

epsi sayidina's avatar
epsi sayidina committed
80
-- {{{ Mouse and Key bindings
epsi sayidina's avatar
epsi sayidina committed
81 82
RC.globalkeys = binding.globalkeys()
RC.globalkeys = binding.bindtotags(RC.globalkeys)
epsi sayidina's avatar
epsi sayidina committed
83

epsi sayidina's avatar
epsi sayidina committed
84 85 86 87 88 89 90 91 92 93 94
-- Set root
root.buttons(binding.globalbuttons())
root.keys(RC.globalkeys)
-- }}}

-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
--dofile(config_path .. "/main/" .. "rules.lua")
awful.rules.rules = main.rules(
    binding.clientkeys(),
    binding.clientbuttons()
95
)
epsi sayidina's avatar
epsi sayidina committed
96 97 98 99
-- }}}


statusbar()
epsi sayidina's avatar
epsi sayidina committed
100

epsi sayidina's avatar
epsi sayidina committed
101
--awful.util.spawn("nm-applet")
102 103

-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80