My configuration files for Debian/Ubuntu applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

394 line
17 KiB

  1. --[[
  2. Holo Awesome WM theme 3.0
  3. github.com/lcpz
  4. --]]
  5. local gears = require("gears")
  6. local lain = require("lain")
  7. local awful = require("awful")
  8. local wibox = require("wibox")
  9. local dpi = require("beautiful.xresources").apply_dpi
  10. local string, os = string, os
  11. local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
  12. local theme = {}
  13. theme.default_dir = require("awful.util").get_themes_dir() .. "default"
  14. theme.icon_dir = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons"
  15. theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/themes/holo/wall.png"
  16. theme.font = "Roboto Bold 10"
  17. theme.taglist_font = "Roboto Condensed Regular 8"
  18. theme.fg_normal = "#FFFFFF"
  19. theme.fg_focus = "#0099CC"
  20. theme.bg_focus = "#303030"
  21. theme.bg_normal = "#242424"
  22. theme.fg_urgent = "#CC9393"
  23. theme.bg_urgent = "#006B8E"
  24. theme.border_width = dpi(3)
  25. theme.border_normal = "#252525"
  26. theme.border_focus = "#0099CC"
  27. theme.taglist_fg_focus = "#FFFFFF"
  28. theme.tasklist_bg_normal = "#222222"
  29. theme.tasklist_fg_focus = "#4CB7DB"
  30. theme.menu_height = dpi(20)
  31. theme.menu_width = dpi(160)
  32. theme.menu_icon_size = dpi(32)
  33. theme.awesome_icon = theme.icon_dir .. "/awesome_icon_white.png"
  34. theme.awesome_icon_launcher = theme.icon_dir .. "/awesome_icon.png"
  35. theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png"
  36. theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.png"
  37. theme.spr_small = theme.icon_dir .. "/spr_small.png"
  38. theme.spr_very_small = theme.icon_dir .. "/spr_very_small.png"
  39. theme.spr_right = theme.icon_dir .. "/spr_right.png"
  40. theme.spr_bottom_right = theme.icon_dir .. "/spr_bottom_right.png"
  41. theme.spr_left = theme.icon_dir .. "/spr_left.png"
  42. theme.bar = theme.icon_dir .. "/bar.png"
  43. theme.bottom_bar = theme.icon_dir .. "/bottom_bar.png"
  44. theme.mpdl = theme.icon_dir .. "/mpd.png"
  45. theme.mpd_on = theme.icon_dir .. "/mpd_on.png"
  46. theme.prev = theme.icon_dir .. "/prev.png"
  47. theme.nex = theme.icon_dir .. "/next.png"
  48. theme.stop = theme.icon_dir .. "/stop.png"
  49. theme.pause = theme.icon_dir .. "/pause.png"
  50. theme.play = theme.icon_dir .. "/play.png"
  51. theme.clock = theme.icon_dir .. "/clock.png"
  52. theme.calendar = theme.icon_dir .. "/cal.png"
  53. theme.cpu = theme.icon_dir .. "/cpu.png"
  54. theme.net_up = theme.icon_dir .. "/net_up.png"
  55. theme.net_down = theme.icon_dir .. "/net_down.png"
  56. theme.layout_tile = theme.icon_dir .. "/tile.png"
  57. theme.layout_tileleft = theme.icon_dir .. "/tileleft.png"
  58. theme.layout_tilebottom = theme.icon_dir .. "/tilebottom.png"
  59. theme.layout_tiletop = theme.icon_dir .. "/tiletop.png"
  60. theme.layout_fairv = theme.icon_dir .. "/fairv.png"
  61. theme.layout_fairh = theme.icon_dir .. "/fairh.png"
  62. theme.layout_spiral = theme.icon_dir .. "/spiral.png"
  63. theme.layout_dwindle = theme.icon_dir .. "/dwindle.png"
  64. theme.layout_max = theme.icon_dir .. "/max.png"
  65. theme.layout_fullscreen = theme.icon_dir .. "/fullscreen.png"
  66. theme.layout_magnifier = theme.icon_dir .. "/magnifier.png"
  67. theme.layout_floating = theme.icon_dir .. "/floating.png"
  68. theme.tasklist_plain_task_name = true
  69. theme.tasklist_disable_icon = true
  70. theme.useless_gap = dpi(4)
  71. theme.titlebar_close_button_normal = theme.default_dir.."/titlebar/close_normal.png"
  72. theme.titlebar_close_button_focus = theme.default_dir.."/titlebar/close_focus.png"
  73. theme.titlebar_minimize_button_normal = theme.default_dir.."/titlebar/minimize_normal.png"
  74. theme.titlebar_minimize_button_focus = theme.default_dir.."/titlebar/minimize_focus.png"
  75. theme.titlebar_ontop_button_normal_inactive = theme.default_dir.."/titlebar/ontop_normal_inactive.png"
  76. theme.titlebar_ontop_button_focus_inactive = theme.default_dir.."/titlebar/ontop_focus_inactive.png"
  77. theme.titlebar_ontop_button_normal_active = theme.default_dir.."/titlebar/ontop_normal_active.png"
  78. theme.titlebar_ontop_button_focus_active = theme.default_dir.."/titlebar/ontop_focus_active.png"
  79. theme.titlebar_sticky_button_normal_inactive = theme.default_dir.."/titlebar/sticky_normal_inactive.png"
  80. theme.titlebar_sticky_button_focus_inactive = theme.default_dir.."/titlebar/sticky_focus_inactive.png"
  81. theme.titlebar_sticky_button_normal_active = theme.default_dir.."/titlebar/sticky_normal_active.png"
  82. theme.titlebar_sticky_button_focus_active = theme.default_dir.."/titlebar/sticky_focus_active.png"
  83. theme.titlebar_floating_button_normal_inactive = theme.default_dir.."/titlebar/floating_normal_inactive.png"
  84. theme.titlebar_floating_button_focus_inactive = theme.default_dir.."/titlebar/floating_focus_inactive.png"
  85. theme.titlebar_floating_button_normal_active = theme.default_dir.."/titlebar/floating_normal_active.png"
  86. theme.titlebar_floating_button_focus_active = theme.default_dir.."/titlebar/floating_focus_active.png"
  87. theme.titlebar_maximized_button_normal_inactive = theme.default_dir.."/titlebar/maximized_normal_inactive.png"
  88. theme.titlebar_maximized_button_focus_inactive = theme.default_dir.."/titlebar/maximized_focus_inactive.png"
  89. theme.titlebar_maximized_button_normal_active = theme.default_dir.."/titlebar/maximized_normal_active.png"
  90. theme.titlebar_maximized_button_focus_active = theme.default_dir.."/titlebar/maximized_focus_active.png"
  91. theme.musicplr = string.format("%s -e ncmpcpp", awful.util.terminal)
  92. local markup = lain.util.markup
  93. local blue = "#80CCE6"
  94. local space3 = markup.font("Roboto 3", " ")
  95. -- Clock
  96. local mytextclock = wibox.widget.textclock(markup("#FFFFFF", space3 .. "%H:%M " .. markup.font("Roboto 4", " ")))
  97. mytextclock.font = theme.font
  98. local clock_icon = wibox.widget.imagebox(theme.clock)
  99. local clockbg = wibox.container.background(mytextclock, theme.bg_focus, gears.shape.rectangle)
  100. local clockwidget = wibox.container.margin(clockbg, dpi(0), dpi(3), dpi(5), dpi(5))
  101. -- Calendar
  102. local mytextcalendar = wibox.widget.textclock(markup.fontfg(theme.font, "#FFFFFF", space3 .. "%d %b " .. markup.font("Roboto 5", " ")))
  103. local calendar_icon = wibox.widget.imagebox(theme.calendar)
  104. local calbg = wibox.container.background(mytextcalendar, theme.bg_focus, gears.shape.rectangle)
  105. local calendarwidget = wibox.container.margin(calbg, dpi(0), dpi(0), dpi(5), dpi(5))
  106. theme.cal = lain.widget.cal({
  107. attach_to = { mytextclock, mytextcalendar },
  108. notification_preset = {
  109. fg = "#FFFFFF",
  110. bg = theme.bg_normal,
  111. position = "bottom_right",
  112. font = "Monospace 10"
  113. }
  114. })
  115. -- Mail IMAP check
  116. --[[ to be set before use
  117. theme.mail = lain.widget.imap({
  118. timeout = 180,
  119. server = "server",
  120. mail = "mail",
  121. password = "keyring get mail",
  122. settings = function()
  123. mail_notification_preset.fg = "#FFFFFF"
  124. mail = ""
  125. count = ""
  126. if mailcount > 0 then
  127. mail = "Mail "
  128. count = mailcount .. " "
  129. end
  130. widget:set_markup(markup.font(theme.font, markup(blue, mail) .. markup("#FFFFFF", count)))
  131. end
  132. })
  133. --]]
  134. -- MPD
  135. local mpd_icon = awful.widget.launcher({ image = theme.mpdl, command = theme.musicplr })
  136. local prev_icon = wibox.widget.imagebox(theme.prev)
  137. local next_icon = wibox.widget.imagebox(theme.nex)
  138. local stop_icon = wibox.widget.imagebox(theme.stop)
  139. local pause_icon = wibox.widget.imagebox(theme.pause)
  140. local play_pause_icon = wibox.widget.imagebox(theme.play)
  141. theme.mpd = lain.widget.mpd({
  142. settings = function ()
  143. if mpd_now.state == "play" then
  144. mpd_now.artist = mpd_now.artist:upper():gsub("&.-;", string.lower)
  145. mpd_now.title = mpd_now.title:upper():gsub("&.-;", string.lower)
  146. widget:set_markup(markup.font("Roboto 4", " ")
  147. .. markup.font(theme.taglist_font,
  148. " " .. mpd_now.artist
  149. .. " - " ..
  150. mpd_now.title .. " ") .. markup.font("Roboto 5", " "))
  151. play_pause_icon:set_image(theme.pause)
  152. elseif mpd_now.state == "pause" then
  153. widget:set_markup(markup.font("Roboto 4", " ") ..
  154. markup.font(theme.taglist_font, " MPD PAUSED ") ..
  155. markup.font("Roboto 5", " "))
  156. play_pause_icon:set_image(theme.play)
  157. else
  158. widget:set_markup("")
  159. play_pause_icon:set_image(theme.play)
  160. end
  161. end
  162. })
  163. local musicbg = wibox.container.background(theme.mpd.widget, theme.bg_focus, gears.shape.rectangle)
  164. local musicwidget = wibox.container.margin(musicbg, dpi(0), dpi(0), dpi(5), dpi(5))
  165. musicwidget:buttons(my_table.join(awful.button({ }, 1,
  166. function () awful.spawn(theme.musicplr) end)))
  167. prev_icon:buttons(my_table.join(awful.button({}, 1,
  168. function ()
  169. os.execute("mpc prev")
  170. theme.mpd.update()
  171. end)))
  172. next_icon:buttons(my_table.join(awful.button({}, 1,
  173. function ()
  174. os.execute("mpc next")
  175. theme.mpd.update()
  176. end)))
  177. stop_icon:buttons(my_table.join(awful.button({}, 1,
  178. function ()
  179. play_pause_icon:set_image(theme.play)
  180. os.execute("mpc stop")
  181. theme.mpd.update()
  182. end)))
  183. play_pause_icon:buttons(my_table.join(awful.button({}, 1,
  184. function ()
  185. os.execute("mpc toggle")
  186. theme.mpd.update()
  187. end)))
  188. -- Battery
  189. local bat = lain.widget.bat({
  190. settings = function()
  191. bat_header = " Bat "
  192. bat_p = bat_now.perc .. " "
  193. if bat_now.ac_status == 1 then
  194. bat_p = bat_p .. "Plugged "
  195. end
  196. widget:set_markup(markup.font(theme.font, markup(blue, bat_header) .. bat_p))
  197. end
  198. })
  199. -- / fs
  200. --[[ commented because it needs Gio/Glib >= 2.54
  201. theme.fs = lain.widget.fs({
  202. notification_preset = { bg = theme.bg_normal, font = "Monospace 9" },
  203. })
  204. --]]
  205. -- ALSA volume bar
  206. theme.volume = lain.widget.alsabar({
  207. notification_preset = { font = "Monospace 9"},
  208. --togglechannel = "IEC958,3",
  209. width = dpi(80), height = dpi(10), border_width = dpi(0),
  210. colors = {
  211. background = "#383838",
  212. unmute = "#80CCE6",
  213. mute = "#FF9F9F"
  214. },
  215. })
  216. theme.volume.bar.paddings = dpi(0)
  217. theme.volume.bar.margins = dpi(5)
  218. local volumewidget = wibox.container.background(theme.volume.bar, theme.bg_focus, gears.shape.rectangle)
  219. volumewidget = wibox.container.margin(volumewidget, dpi(0), dpi(0), dpi(5), dpi(5))
  220. -- CPU
  221. local cpu_icon = wibox.widget.imagebox(theme.cpu)
  222. local cpu = lain.widget.cpu({
  223. settings = function()
  224. widget:set_markup(space3 .. markup.font(theme.font, "CPU " .. cpu_now.usage
  225. .. "% ") .. markup.font("Roboto 5", " "))
  226. end
  227. })
  228. local cpubg = wibox.container.background(cpu.widget, theme.bg_focus, gears.shape.rectangle)
  229. local cpuwidget = wibox.container.margin(cpubg, dpi(0), dpi(0), dpi(5), dpi(5))
  230. -- Net
  231. local netdown_icon = wibox.widget.imagebox(theme.net_down)
  232. local netup_icon = wibox.widget.imagebox(theme.net_up)
  233. local net = lain.widget.net({
  234. settings = function()
  235. widget:set_markup(markup.font("Roboto 1", " ") .. markup.font(theme.font, net_now.received .. " - "
  236. .. net_now.sent) .. markup.font("Roboto 2", " "))
  237. end
  238. })
  239. local netbg = wibox.container.background(net.widget, theme.bg_focus, gears.shape.rectangle)
  240. local networkwidget = wibox.container.margin(netbg, dpi(0), dpi(0), dpi(5), dpi(5))
  241. -- Weather
  242. --[[ to be set before use
  243. theme.weather = lain.widget.weather({
  244. --APPID =
  245. city_id = 2643743, -- placeholder (London)
  246. notification_preset = { font = "Monospace 9", position = "bottom_right" },
  247. })
  248. --]]
  249. -- Launcher
  250. local mylauncher = awful.widget.button({ image = theme.awesome_icon_launcher })
  251. mylauncher:connect_signal("button::press", function() awful.util.mymainmenu:toggle() end)
  252. -- Separators
  253. local first = wibox.widget.textbox('<span font="Roboto 7"> </span>')
  254. local spr_small = wibox.widget.imagebox(theme.spr_small)
  255. local spr_very_small = wibox.widget.imagebox(theme.spr_very_small)
  256. local spr_right = wibox.widget.imagebox(theme.spr_right)
  257. local spr_bottom_right = wibox.widget.imagebox(theme.spr_bottom_right)
  258. local spr_left = wibox.widget.imagebox(theme.spr_left)
  259. local bar = wibox.widget.imagebox(theme.bar)
  260. local bottom_bar = wibox.widget.imagebox(theme.bottom_bar)
  261. local barcolor = gears.color({
  262. type = "linear",
  263. from = { dpi(32), 0 },
  264. to = { dpi(32), dpi(32) },
  265. stops = { {0, theme.bg_focus}, {0.25, "#505050"}, {1, theme.bg_focus} }
  266. })
  267. function theme.at_screen_connect(s)
  268. -- Quake application
  269. s.quake = lain.util.quake({ app = awful.util.terminal })
  270. -- If wallpaper is a function, call it with the screen
  271. local wallpaper = theme.wallpaper
  272. if type(wallpaper) == "function" then
  273. wallpaper = wallpaper(s)
  274. end
  275. gears.wallpaper.maximized(wallpaper, s, true)
  276. -- Tags
  277. awful.tag(awful.util.tagnames, s, awful.layout.layouts)
  278. -- Create a promptbox for each screen
  279. s.mypromptbox = awful.widget.prompt()
  280. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  281. -- We need one layoutbox per screen.
  282. s.mylayoutbox = awful.widget.layoutbox(s)
  283. s.mylayoutbox:buttons(my_table.join(
  284. awful.button({}, 1, function () awful.layout.inc( 1) end),
  285. awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
  286. awful.button({}, 3, function () awful.layout.inc(-1) end),
  287. awful.button({}, 4, function () awful.layout.inc( 1) end),
  288. awful.button({}, 5, function () awful.layout.inc(-1) end)))
  289. -- Create a taglist widget
  290. s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons, { bg_focus = barcolor })
  291. mytaglistcont = wibox.container.background(s.mytaglist, theme.bg_focus, gears.shape.rectangle)
  292. s.mytag = wibox.container.margin(mytaglistcont, dpi(0), dpi(0), dpi(5), dpi(5))
  293. -- Create a tasklist widget
  294. s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, { bg_focus = theme.bg_focus, shape = gears.shape.rectangle, shape_border_width = 5, shape_border_color = theme.tasklist_bg_normal, align = "center" })
  295. -- Create the wibox
  296. s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(32) })
  297. -- Add widgets to the wibox
  298. s.mywibox:setup {
  299. layout = wibox.layout.align.horizontal,
  300. { -- Left widgets
  301. layout = wibox.layout.fixed.horizontal,
  302. first,
  303. s.mytag,
  304. spr_small,
  305. s.mylayoutbox,
  306. spr_small,
  307. s.mypromptbox,
  308. },
  309. nil, -- Middle widget
  310. { -- Right widgets
  311. layout = wibox.layout.fixed.horizontal,
  312. wibox.widget.systray(),
  313. --theme.mail.widget,
  314. --bat.widget,
  315. spr_right,
  316. musicwidget,
  317. bar,
  318. prev_icon,
  319. next_icon,
  320. stop_icon,
  321. play_pause_icon,
  322. bar,
  323. mpd_icon,
  324. bar,
  325. spr_very_small,
  326. volumewidget,
  327. spr_left,
  328. },
  329. }
  330. -- Create the bottom wibox
  331. s.mybottomwibox = awful.wibar({ position = "bottom", screen = s, border_width = dpi(0), height = dpi(32) })
  332. s.borderwibox = awful.wibar({ position = "bottom", screen = s, height = dpi(1), bg = theme.fg_focus, x = dpi(0), y = dpi(33)})
  333. -- Add widgets to the bottom wibox
  334. s.mybottomwibox:setup {
  335. layout = wibox.layout.align.horizontal,
  336. { -- Left widgets
  337. layout = wibox.layout.fixed.horizontal,
  338. mylauncher,
  339. },
  340. s.mytasklist, -- Middle widget
  341. { -- Right widgets
  342. layout = wibox.layout.fixed.horizontal,
  343. spr_bottom_right,
  344. netdown_icon,
  345. networkwidget,
  346. netup_icon,
  347. bottom_bar,
  348. cpu_icon,
  349. cpuwidget,
  350. bottom_bar,
  351. calendar_icon,
  352. calendarwidget,
  353. bottom_bar,
  354. clock_icon,
  355. clockwidget,
  356. },
  357. }
  358. end
  359. return theme