My configuration files for Debian/Ubuntu applications
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

279 wiersze
11 KiB

  1. --[[
  2. Blackburn 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 os = os
  11. local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
  12. local theme = {}
  13. theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/blackburn"
  14. theme.wallpaper = theme.dir .. "/wall.png"
  15. theme.font = "Terminus 10.5"
  16. theme.taglist_font = "Icons 10"
  17. theme.fg_normal = "#D7D7D7"
  18. theme.fg_focus = "#F6784F"
  19. theme.bg_normal = "#060606"
  20. theme.bg_focus = "#060606"
  21. theme.fg_urgent = "#CC9393"
  22. theme.bg_urgent = "#2A1F1E"
  23. theme.border_width = dpi(1)
  24. theme.border_normal = "#0E0E0E"
  25. theme.border_focus = "#F79372"
  26. theme.taglist_fg_focus = "#F6784F"
  27. theme.taglist_bg_focus = "#060606"
  28. theme.tasklist_fg_focus = "#F6784F"
  29. theme.tasklist_bg_focus = "#060606"
  30. theme.menu_height = dpi(16)
  31. theme.menu_width = dpi(130)
  32. theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
  33. theme.awesome_icon = theme.dir .."/icons/awesome.png"
  34. theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
  35. theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
  36. theme.layout_tile = theme.dir .. "/icons/tile.png"
  37. theme.layout_tileleft = theme.dir .. "/icons/tileleft.png"
  38. theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png"
  39. theme.layout_tiletop = theme.dir .. "/icons/tiletop.png"
  40. theme.layout_fairv = theme.dir .. "/icons/fairv.png"
  41. theme.layout_fairh = theme.dir .. "/icons/fairh.png"
  42. theme.layout_spiral = theme.dir .. "/icons/spiral.png"
  43. theme.layout_dwindle = theme.dir .. "/icons/dwindle.png"
  44. theme.layout_max = theme.dir .. "/icons/max.png"
  45. theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png"
  46. theme.layout_magnifier = theme.dir .. "/icons/magnifier.png"
  47. theme.layout_floating = theme.dir .. "/icons/floating.png"
  48. theme.tasklist_plain_task_name = true
  49. theme.tasklist_disable_icon = true
  50. theme.useless_gap = 0
  51. theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
  52. theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
  53. theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
  54. theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
  55. theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
  56. theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
  57. theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
  58. theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
  59. theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
  60. theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
  61. theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
  62. theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
  63. theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
  64. theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
  65. theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
  66. theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
  67. theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
  68. theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
  69. awful.util.tagnames = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }
  70. local markup = lain.util.markup
  71. local separators = lain.util.separators
  72. local gray = "#9E9C9A"
  73. -- Textclock
  74. local mytextclock = wibox.widget.textclock(" %H:%M ")
  75. mytextclock.font = theme.font
  76. -- Calendar
  77. theme.cal = lain.widget.cal({
  78. attach_to = { mytextclock },
  79. notification_preset = {
  80. font = "Terminus 11",
  81. fg = theme.fg_normal,
  82. bg = theme.bg_normal
  83. }
  84. })
  85. -- Mail IMAP check
  86. --[[ to be set before use
  87. theme.mail = lain.widget.imap({
  88. timeout = 180,
  89. server = "server",
  90. mail = "mail",
  91. password = "keyring get mail",
  92. notification_preset = { fg = white }
  93. settings = function()
  94. mail = ""
  95. count = ""
  96. if mailcount > 0 then
  97. mail = "Mail "
  98. count = mailcount .. " "
  99. end
  100. widget:set_markup(markup.font(theme.font, markup(gray, mail) .. count))
  101. end
  102. })
  103. --]]
  104. -- MPD
  105. theme.mpd = lain.widget.mpd({
  106. settings = function()
  107. mpd_notification_preset.fg = white
  108. artist = mpd_now.artist .. " "
  109. title = mpd_now.title .. " "
  110. if mpd_now.state == "pause" then
  111. artist = "mpd "
  112. title = "paused "
  113. elseif mpd_now.state == "stop" then
  114. artist = ""
  115. title = ""
  116. end
  117. widget:set_markup(markup.font(theme.font, markup(gray, artist) .. title .. " "))
  118. end
  119. })
  120. -- /home fs
  121. --[[ commented because it needs Gio/Glib >= 2.54
  122. theme.fs = lain.widget.fs({
  123. notification_preset = { fg = white, bg = theme.bg_normal, font = "Terminus 10.5" },
  124. settings = function()
  125. fs_header = ""
  126. fs_p = ""
  127. if fs_now["/home"].percentage >= 90 then
  128. fs_header = " Hdd "
  129. fs_p = fs_now["/home"].percentage
  130. end
  131. widget:set_markup(markup.font(theme.font, markup(gray, fs_header) .. fs_p))
  132. end
  133. })
  134. --]]
  135. -- Battery
  136. local bat = lain.widget.bat({
  137. settings = function()
  138. bat_header = " Bat "
  139. bat_p = bat_now.perc .. " "
  140. widget:set_markup(markup.font(theme.font, markup(gray, bat_header) .. bat_p))
  141. end
  142. })
  143. -- ALSA volume
  144. theme.volume = lain.widget.alsa({
  145. --togglechannel = "IEC958,3",
  146. settings = function()
  147. header = " Vol "
  148. vlevel = volume_now.level
  149. if volume_now.status == "off" then
  150. vlevel = vlevel .. "M "
  151. else
  152. vlevel = vlevel .. " "
  153. end
  154. widget:set_markup(markup.font(theme.font, markup(gray, header) .. vlevel))
  155. end
  156. })
  157. -- Weather
  158. --[[ to be set before use
  159. theme.weather = lain.widget.weather({
  160. --APPID =
  161. city_id = 2643743, -- placeholder (London)
  162. settings = function()
  163. units = math.floor(weather_now["main"]["temp"])
  164. widget:set_markup(" " .. units .. " ")
  165. end
  166. })
  167. --]]
  168. -- Separators
  169. local first = wibox.widget.textbox('<span font="Terminus 4"> </span>')
  170. local arrl_pre = separators.arrow_right("alpha", "#1A1A1A")
  171. local arrl_post = separators.arrow_right("#1A1A1A", "alpha")
  172. local barheight = dpi(18)
  173. local barcolor = gears.color({
  174. type = "linear",
  175. from = { barheight, 0 },
  176. to = { barheight, barheight },
  177. stops = { {0, theme.bg_focus }, {0.8, theme.border_normal}, {1, "#1A1A1A"} }
  178. })
  179. theme.titlebar_bg = barcolor
  180. theme.titlebar_bg_focus = gears.color({
  181. type = "linear",
  182. from = { barheight, 0 },
  183. to = { barheight, barheight },
  184. stops = { {0, theme.bg_normal}, {0.5, theme.border_normal}, {1, "#492417"} }
  185. })
  186. function theme.at_screen_connect(s)
  187. -- Quake application
  188. s.quake = lain.util.quake({ app = awful.util.terminal })
  189. -- If wallpaper is a function, call it with the screen
  190. local wallpaper = theme.wallpaper
  191. if type(wallpaper) == "function" then
  192. wallpaper = wallpaper(s)
  193. end
  194. gears.wallpaper.maximized(wallpaper, s, true)
  195. -- Tags
  196. awful.tag(awful.util.tagnames, s, awful.layout.layouts)
  197. -- Create a promptbox for each screen
  198. s.mypromptbox = awful.widget.prompt()
  199. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  200. -- We need one layoutbox per screen.
  201. s.mylayoutbox = awful.widget.layoutbox(s)
  202. s.mylayoutbox:buttons(my_table.join(
  203. awful.button({}, 1, function () awful.layout.inc( 1) end),
  204. awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
  205. awful.button({}, 3, function () awful.layout.inc(-1) end),
  206. awful.button({}, 4, function () awful.layout.inc( 1) end),
  207. awful.button({}, 5, function () awful.layout.inc(-1) end)))
  208. -- Create a taglist widget
  209. s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
  210. -- Create a tasklist widget
  211. s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, { bg_normal = barcolor, bg_focus = barcolor })
  212. -- Create the wibox
  213. s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18), bg = barcolor })
  214. -- Add widgets to the wibox
  215. s.mywibox:setup {
  216. layout = wibox.layout.align.horizontal,
  217. { -- Left widgets
  218. layout = wibox.layout.fixed.horizontal,
  219. first,
  220. s.mytaglist,
  221. arrl_pre,
  222. s.mylayoutbox,
  223. arrl_post,
  224. s.mypromptbox,
  225. first,
  226. },
  227. s.mytasklist, -- Middle widget
  228. { -- Right widgets
  229. layout = wibox.layout.fixed.horizontal,
  230. wibox.widget.systray(),
  231. first,
  232. theme.mpd.widget,
  233. --theme.mail.widget,
  234. --theme.weather.icon,
  235. --theme.weather.widget,
  236. --theme.fs.widget,
  237. bat,
  238. theme.volume.widget,
  239. mytextclock,
  240. },
  241. }
  242. end
  243. return theme