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