3 Blackburn Awesome WM theme 3.0
8 local gears = require("gears")
9 local lain = require("lain")
10 local awful = require("awful")
11 local wibox = require("wibox")
12 local dpi = require("beautiful.xresources").apply_dpi
15 local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
18 theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/blackburn"
19 theme.wallpaper = theme.dir .. "/wall.png"
20 theme.font = "Terminus 10.5"
21 theme.taglist_font = "Icons 10"
22 theme.fg_normal = "#D7D7D7"
23 theme.fg_focus = "#F6784F"
24 theme.bg_normal = "#060606"
25 theme.bg_focus = "#060606"
26 theme.fg_urgent = "#CC9393"
27 theme.bg_urgent = "#2A1F1E"
28 theme.border_width = dpi(1)
29 theme.border_normal = "#0E0E0E"
30 theme.border_focus = "#F79372"
31 theme.taglist_fg_focus = "#F6784F"
32 theme.taglist_bg_focus = "#060606"
33 theme.tasklist_fg_focus = "#F6784F"
34 theme.tasklist_bg_focus = "#060606"
35 theme.menu_height = dpi(16)
36 theme.menu_width = dpi(130)
37 theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
38 theme.awesome_icon = theme.dir .."/icons/awesome.png"
39 theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
40 theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
41 theme.layout_tile = theme.dir .. "/icons/tile.png"
42 theme.layout_tileleft = theme.dir .. "/icons/tileleft.png"
43 theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png"
44 theme.layout_tiletop = theme.dir .. "/icons/tiletop.png"
45 theme.layout_fairv = theme.dir .. "/icons/fairv.png"
46 theme.layout_fairh = theme.dir .. "/icons/fairh.png"
47 theme.layout_spiral = theme.dir .. "/icons/spiral.png"
48 theme.layout_dwindle = theme.dir .. "/icons/dwindle.png"
49 theme.layout_max = theme.dir .. "/icons/max.png"
50 theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png"
51 theme.layout_magnifier = theme.dir .. "/icons/magnifier.png"
52 theme.layout_floating = theme.dir .. "/icons/floating.png"
53 theme.tasklist_plain_task_name = true
54 theme.tasklist_disable_icon = true
56 theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
57 theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
58 theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
59 theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
60 theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
61 theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
62 theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
63 theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
64 theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
65 theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
66 theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
67 theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
68 theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
69 theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
70 theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
71 theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
72 theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
73 theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
75 awful.util.tagnames = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }
77 local markup = lain.util.markup
78 local separators = lain.util.separators
79 local gray = "#9E9C9A"
82 local mytextclock = wibox.widget.textclock(" %H:%M ")
83 mytextclock.font = theme.font
86 theme.cal = lain.widget.cal({
87 attach_to = { mytextclock },
88 notification_preset = {
96 --[[ commented because it needs to be set before use
97 theme.mail = lain.widget.imap({
101 password = "keyring get mail",
102 notification_preset = { fg = white }
103 settings = function()
107 if mailcount > 0 then
109 count = mailcount .. " "
112 widget:set_markup(markup.font(theme.font, markup(gray, mail) .. count))
118 theme.mpd = lain.widget.mpd({
119 settings = function()
120 mpd_notification_preset.fg = white
121 artist = mpd_now.artist .. " "
122 title = mpd_now.title .. " "
124 if mpd_now.state == "pause" then
127 elseif mpd_now.state == "stop" then
132 widget:set_markup(markup.font(theme.font, markup(gray, artist) .. title .. " "))
137 --[[ commented because it needs Gio/Glib >= 2.54
138 theme.fs = lain.widget.fs({
139 notification_preset = { fg = white, bg = theme.bg_normal, font = "Terminus 10.5" },
140 settings = function()
144 if fs_now["/home"].percentage >= 90 then
146 fs_p = fs_now["/home"].percentage
149 widget:set_markup(markup.font(theme.font, markup(gray, fs_header) .. fs_p))
155 local bat = lain.widget.bat({
156 settings = function()
158 bat_p = bat_now.perc .. " "
159 widget:set_markup(markup.font(theme.font, markup(gray, bat_header) .. bat_p))
164 theme.volume = lain.widget.alsa({
165 --togglechannel = "IEC958,3",
166 settings = function()
168 vlevel = volume_now.level
170 if volume_now.status == "off" then
171 vlevel = vlevel .. "M "
173 vlevel = vlevel .. " "
176 widget:set_markup(markup.font(theme.font, markup(gray, header) .. vlevel))
181 theme.weather = lain.widget.weather({
182 city_id = 2643743, -- placeholder (London)
183 settings = function()
184 units = math.floor(weather_now["main"]["temp"])
185 widget:set_markup(" " .. units .. " ")
190 local first = wibox.widget.textbox('<span font="Terminus 4"> </span>')
191 local arrl_pre = separators.arrow_right("alpha", "#1A1A1A")
192 local arrl_post = separators.arrow_right("#1A1A1A", "alpha")
194 local barheight = dpi(18)
195 local barcolor = gears.color({
197 from = { barheight, 0 },
198 to = { barheight, barheight },
199 stops = { {0, theme.bg_focus }, {0.8, theme.border_normal}, {1, "#1A1A1A"} }
201 theme.titlebar_bg = barcolor
203 theme.titlebar_bg_focus = gears.color({
205 from = { barheight, 0 },
206 to = { barheight, barheight },
207 stops = { {0, theme.bg_normal}, {0.5, theme.border_normal}, {1, "#492417"} }
210 function theme.at_screen_connect(s)
212 s.quake = lain.util.quake({ app = awful.util.terminal })
214 -- If wallpaper is a function, call it with the screen
215 local wallpaper = theme.wallpaper
216 if type(wallpaper) == "function" then
217 wallpaper = wallpaper(s)
219 gears.wallpaper.maximized(wallpaper, s, true)
222 awful.tag(awful.util.tagnames, s, awful.layout.layouts)
224 -- Create a promptbox for each screen
225 s.mypromptbox = awful.widget.prompt()
226 -- Create an imagebox widget which will contains an icon indicating which layout we're using.
227 -- We need one layoutbox per screen.
228 s.mylayoutbox = awful.widget.layoutbox(s)
229 s.mylayoutbox:buttons(my_table.join(
230 awful.button({}, 1, function () awful.layout.inc( 1) end),
231 awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
232 awful.button({}, 3, function () awful.layout.inc(-1) end),
233 awful.button({}, 4, function () awful.layout.inc( 1) end),
234 awful.button({}, 5, function () awful.layout.inc(-1) end)))
236 -- Create a taglist widget
237 s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
239 -- Create a tasklist widget
240 s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, { bg_normal = barcolor, bg_focus = barcolor })
243 s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18), bg = barcolor })
245 -- Add widgets to the wibox
247 layout = wibox.layout.align.horizontal,
249 layout = wibox.layout.fixed.horizontal,
258 s.mytasklist, -- Middle widget
260 layout = wibox.layout.fixed.horizontal,
261 wibox.widget.systray(),
266 theme.weather.widget,