]> git.rmz.io Git - dotfiles.git/blob - awesome/rc.lua
vim: do not set pastetoggle in nvim
[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 require("awful.remote")
10
11 -- Error handling {{{1
12 -- Check if awesome encountered an error during startup and fell back to
13 -- another config (This code will only ever execute for the fallback config)
14 if awesome.startup_errors then
15 naughty.notify({ preset = naughty.config.presets.critical,
16 title = "Oops, there were errors during startup!",
17 text = awesome.startup_errors })
18 end
19
20 -- Handle runtime errors after startup
21 do
22 local in_error = false
23 awesome.connect_signal("debug::error", function (err)
24 -- Make sure we don't go into an endless error loop
25 if in_error then return end
26 in_error = true
27
28 naughty.notify({ preset = naughty.config.presets.critical,
29 title = "Oops, an error happened!",
30 text = tostring(err) })
31 in_error = false
32 end)
33 end
34
35 -- Variable definitions {{{1
36 -- Themes define colours, icons, font and wallpapers.
37 local gfs = require("gears.filesystem")
38 local theme = os.getenv("THEME")
39 local theme_path = gfs.get_dir("config").."/themes/"..theme.."/theme.lua"
40
41 if not beautiful.init(theme_path) then
42 -- we failed to load the theme, load default instead
43 naughty.notify({ preset = naughty.config.presets.warning,
44 title = "Could not load theme, fallback to default",
45 text = "theme_path = '"..theme_path.."'" })
46 beautiful.init(gfs.get_themes_dir() .. "default/theme.lua")
47 end
48
49 -- This is used later as the default terminal to run.
50 terminal = os.getenv("TERMINAL") or "xterm"
51 terminal_class = (function()
52 local map = { urxvt = "URxvt"
53 , urxvtc = "URxvt"
54 , xterm = "XTerm"
55 }
56 return map[terminal] or terminal
57 end)()
58
59 -- Require files {{{1
60 require("bindings")
61 require("tags")
62 require("menu")
63 require("topbar")
64 require("rules")
65 -- require("conky")
66 require("signals")
67
68 -- Set keys {{{1
69 root.keys(globalkeys)
70
71 -- Autostart {{{1
72 local utils = require("utils")
73 awful.spawn.once("kdeconnect-indicator")
74 -- This seems to not keep awesome as parent of these processes
75 utils.spawn_terminal_once("ncmpcpp", { instance = "ncmpcpp"
76 , tag = mediatag
77 })
78 utils.spawn_terminal_once("neomutt",
79 { instance = "mutt" , tag = wwwtag })
80 utils.spawn_terminal_once("weechat", { instance = "weechat"
81 , tag = imtag
82 , function (c) awful.client.setmaster(c) end
83 })
84 -- can't get this to work propery, restarting awesowe will respawn a new qutebrowser
85 awful.spawn.single_instance("qutebrowser", { instance = "qutebrowser", tag = wwwtag })