]> git.rmz.io Git - dotfiles.git/blob - awesome/rc.lua
awesome: add binding to start vimwiki
[dotfiles.git] / awesome / rc.lua
1 -- Awesome libraries {{{1
2 gears = require("gears")
3 awful = require("awful")
4 awful.rules = require("awful.rules")
5 require("awful.autofocus")
6 beautiful = require("beautiful")
7 naughty = require("naughty")
8 menubar = require("menubar")
9 lain = require("lain")
10 require("awful.remote")
11
12 -- Error handling {{{1
13 -- Check if awesome encountered an error during startup and fell back to
14 -- another config (This code will only ever execute for the fallback config)
15 if awesome.startup_errors then
16 naughty.notify({ preset = naughty.config.presets.critical,
17 title = "Oops, there were errors during startup!",
18 text = awesome.startup_errors })
19 end
20
21 -- Handle runtime errors after startup
22 do
23 local in_error = false
24 awesome.connect_signal("debug::error", function (err)
25 -- Make sure we don't go into an endless error loop
26 if in_error then return end
27 in_error = true
28
29 naughty.notify({ preset = naughty.config.presets.critical,
30 title = "Oops, an error happened!",
31 text = err })
32 in_error = false
33 end)
34 end
35
36 -- Variable definitions {{{1
37 -- Themes define colours, icons, and wallpapers
38 beautiful.init(awful.util.getdir("config").."/themes/mlp/theme.lua")
39
40 -- This is used later as the default terminal and editor to run.
41 terminal = "urxvtc"
42 editor = os.getenv("EDITOR") or "vim"
43 editor_cmd = terminal .. " -e " .. editor
44
45 -- Wallpaper {{{1
46 local function set_wallpaper(s)
47 -- Wallpaper
48 if beautiful.wallpaper then
49 local wallpaper = beautiful.wallpaper
50 -- If wallpaper is a function, call it with the screen
51 if type(wallpaper) == "function" then
52 wallpaper = wallpaper(s)
53 end
54 gears.wallpaper.maximized(wallpaper, s, true)
55 end
56 end
57
58 -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
59 screen.connect_signal("property::geometry", set_wallpaper)
60
61 -- Require files {{{1
62 require("bindings")
63 require("tags")
64 require("menu")
65 require("topbar")
66 require("rules")
67 -- require("conky")
68 require("signals")
69
70 -- Set keys
71 root.keys(globalkeys)