]> git.rmz.io Git - dotfiles.git/blob - awesome/rc.lua
split topbar into it's own file
[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 -- Widget and layout library
7 wibox = require("wibox")
8 -- Theme handling library
9 beautiful = require("beautiful")
10 -- Notification library
11 naughty = require("naughty")
12 menubar = require("menubar")
13 -- Pulseaudio widget
14 --local APW = require("apw/widget")
15
16 -- {{{ Error handling
17 -- Check if awesome encountered an error during startup and fell back to
18 -- another config (This code will only ever execute for the fallback config)
19 if awesome.startup_errors then
20 naughty.notify({ preset = naughty.config.presets.critical,
21 title = "Oops, there were errors during startup!",
22 text = awesome.startup_errors })
23 end
24
25 -- Handle runtime errors after startup
26 do
27 local in_error = false
28 awesome.connect_signal("debug::error", function (err)
29 -- Make sure we don't go into an endless error loop
30 if in_error then return end
31 in_error = true
32
33 naughty.notify({ preset = naughty.config.presets.critical,
34 title = "Oops, an error happened!",
35 text = err })
36 in_error = false
37 end)
38 end
39 -- }}}
40
41 -- {{{ Variable definitions
42 -- Themes define colours, icons, and wallpapers
43 beautiful.init("/usr/share/awesome/themes/default/theme.lua")
44
45 -- This is used later as the default terminal and editor to run.
46 terminal = "konsole"
47 editor = os.getenv("EDITOR") or "vim"
48 editor_cmd = terminal .. " -e " .. editor
49
50 -- Default modkey.
51 -- Usually, Mod4 is the key with a logo between Control and Alt.
52 -- If you do not like this or do not have such a key,
53 -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
54 -- However, you can use another modifier like Mod1, but it may interact with others.
55 modkey = "Mod4"
56
57 -- Tags
58 require("tags")
59 -- }}}
60
61 -- {{{ Wallpaper
62 if beautiful.wallpaper then
63 for s = 1, screen.count() do
64 gears.wallpaper.maximized(beautiful.wallpaper, s, true)
65 end
66 end
67 -- }}}
68
69 --Menu
70 require("menu")
71
72 -- Topbar
73 require("topbar")
74
75 -- Mouse/Key Bindings
76 require("bindings")
77
78 -- Rules
79 require("rules")
80
81 -- {{{ Signals
82 -- Signal function to execute when a new client appears.
83 client.connect_signal("manage", function (c, startup)
84 -- Enable sloppy focus
85 c:connect_signal("mouse::enter", function(c)
86 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
87 and awful.client.focus.filter(c) then
88 client.focus = c
89 end
90 end)
91
92 if not startup then
93 -- Set the windows at the slave,
94 -- i.e. put it at the end of others instead of setting it master.
95 -- awful.client.setslave(c)
96
97 -- Put windows in a smart way, only if they does not set an initial position.
98 if not c.size_hints.user_position and not c.size_hints.program_position then
99 awful.placement.no_overlap(c)
100 awful.placement.no_offscreen(c)
101 end
102 end
103 end)
104
105 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
106 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
107 -- }}}
108
109 -- {{{ Autostart applications
110 require("autostart")
111 -- }}}