]> git.rmz.io Git - dotfiles.git/blob - awesome/rc.lua
aweome: open new clients as slaves
[dotfiles.git] / awesome / rc.lua
1 -- Standard awesome library
2 gears = require("gears")
3 awful = require("awful")
4 awful.rules = require("awful.rules")
5 require("awful.autofocus")
6 -- Theme handling library
7 beautiful = require("beautiful")
8 -- Notification library
9 naughty = require("naughty")
10 menubar = require("menubar")
11
12 -- {{{ Error handling
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
37 -- {{{ Variable definitions
38 -- Themes define colours, icons, and wallpapers
39 beautiful.init(awful.util.getdir("config").."/themes/mlp/theme.lua")
40
41 -- This is used later as the default terminal and editor to run.
42 terminal = "urxvtc"
43 editor = os.getenv("EDITOR") or "vim"
44 editor_cmd = terminal .. " -e " .. editor
45
46 -- Tags
47 require("tags")
48 -- }}}
49
50 -- {{{ Wallpaper
51 if beautiful.wallpaper then
52 for s = 1, screen.count() do
53 gears.wallpaper.maximized(beautiful.wallpaper, s, true)
54 end
55 end
56 -- }}}
57
58 --Menu
59 require("menu")
60
61 -- Topbar
62 require("topbar")
63
64 -- Mouse/Key Bindings
65 require("bindings")
66
67 -- Rules
68 require("rules")
69
70 -- conky
71 require("conky")
72
73 -- {{{ Signals
74 -- Signal function to execute when a new client appears.
75 client.connect_signal("manage", function (c, startup)
76 -- Enable sloppy focus
77 c:connect_signal("mouse::enter", function(c)
78 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
79 and awful.client.focus.filter(c) then
80 client.focus = c
81 end
82 end)
83
84 if not startup then
85 -- Set the windows at the slave,
86 -- i.e. put it at the end of others instead of setting it master.
87 awful.client.setslave(c)
88
89 -- Put windows in a smart way, only if they does not set an initial position.
90 if not c.size_hints.user_position and not c.size_hints.program_position then
91 awful.placement.no_overlap(c)
92 awful.placement.no_offscreen(c)
93 end
94 end
95 end)
96
97 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
98 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
99 -- }}}
100
101 -- Set keys
102 root.keys(globalkeys)
103
104 -- Autostart applications
105 require("autostart")