My configuration files for Debian/Ubuntu applications
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

257 lines
10 KiB

  1. --[[
  2. Dremora Awesome WM theme 2.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/dremora"
  14. theme.wallpaper = theme.dir .. "/wall.png"
  15. theme.font = "Terminus 10.5"
  16. theme.taglist_font = "Icons 10"
  17. theme.fg_normal = "#747474"
  18. theme.fg_focus = "#DDDCFF"
  19. theme.bg_normal = "#121212"
  20. theme.bg_focus = "#121212"
  21. theme.fg_urgent = "#CC9393"
  22. theme.bg_urgent = "#2A1F1E"
  23. theme.border_width = dpi(0)
  24. theme.border_normal = "#121212"
  25. theme.border_focus = "#292929"
  26. theme.titlebar_bg_focus = "#292929"
  27. theme.taglist_fg_focus = "#dddcff"
  28. theme.taglist_bg_focus = "#121212"
  29. theme.menu_height = dpi(16)
  30. theme.menu_width = dpi(130)
  31. theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
  32. theme.awesome_icon = theme.dir .."/icons/awesome.png"
  33. theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
  34. theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
  35. theme.layout_tile = theme.dir .. "/icons/tile.png"
  36. theme.layout_tileleft = theme.dir .. "/icons/tileleft.png"
  37. theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png"
  38. theme.layout_tiletop = theme.dir .. "/icons/tiletop.png"
  39. theme.layout_fairv = theme.dir .. "/icons/fairv.png"
  40. theme.layout_fairh = theme.dir .. "/icons/fairh.png"
  41. theme.layout_spiral = theme.dir .. "/icons/spiral.png"
  42. theme.layout_dwindle = theme.dir .. "/icons/dwindle.png"
  43. theme.layout_max = theme.dir .. "/icons/max.png"
  44. theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png"
  45. theme.layout_magnifier = theme.dir .. "/icons/magnifier.png"
  46. theme.layout_floating = theme.dir .. "/icons/floating.png"
  47. theme.tasklist_plain_task_name = true
  48. theme.tasklist_disable_icon = true
  49. theme.useless_gap = dpi(10)
  50. theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
  51. theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
  52. theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
  53. theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
  54. theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
  55. theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
  56. theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
  57. theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
  58. theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
  59. theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
  60. theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
  61. theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
  62. theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
  63. theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
  64. theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
  65. theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
  66. theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
  67. theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
  68. awful.util.tagnames = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }
  69. local markup = lain.util.markup
  70. local separators = lain.util.separators
  71. local white = theme.fg_focus
  72. local gray = "#858585"
  73. -- Textclock
  74. local mytextclock = wibox.widget.textclock(markup(gray, " %a")
  75. .. markup(white, " %d ") .. markup(gray, "%b ") .. markup(white, "%H:%M "))
  76. mytextclock.font = theme.font
  77. -- Calendar
  78. theme.cal = lain.widget.cal({
  79. attach_to = { mytextclock },
  80. notification_preset = {
  81. font = "Terminus 11",
  82. fg = white,
  83. bg = theme.bg_normal
  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) .. markup(white, 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) .. markup(white, 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) .. markup(white, 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) .. markup(white, 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) .. markup(white, 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. notification_preset = { fg = white }
  163. })
  164. --]]
  165. -- Separators
  166. local first = wibox.widget.textbox('<span font="Terminus 4"> </span>')
  167. local arrl_pre = separators.arrow_right("alpha", "#1A1A1A")
  168. local arrl_post = separators.arrow_right("#1A1A1A", "alpha")
  169. function theme.at_screen_connect(s)
  170. -- Quake application
  171. s.quake = lain.util.quake({ app = awful.util.terminal })
  172. -- If wallpaper is a function, call it with the screen
  173. local wallpaper = theme.wallpaper
  174. if type(wallpaper) == "function" then
  175. wallpaper = wallpaper(s)
  176. end
  177. gears.wallpaper.maximized(wallpaper, s, true)
  178. -- Tags
  179. awful.tag(awful.util.tagnames, s, awful.layout.layouts)
  180. -- Create a promptbox for each screen
  181. s.mypromptbox = awful.widget.prompt()
  182. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  183. -- We need one layoutbox per screen.
  184. s.mylayoutbox = awful.widget.layoutbox(s)
  185. s.mylayoutbox:buttons(my_table.join(
  186. awful.button({}, 1, function () awful.layout.inc( 1) end),
  187. awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
  188. awful.button({}, 3, function () awful.layout.inc(-1) end),
  189. awful.button({}, 4, function () awful.layout.inc( 1) end),
  190. awful.button({}, 5, function () awful.layout.inc(-1) end)))
  191. -- Create a taglist widget
  192. s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
  193. -- Create a tasklist widget
  194. s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
  195. -- Create the wibox
  196. s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18), bg = theme.bg_normal, fg = theme.fg_normal })
  197. -- Add widgets to the wibox
  198. s.mywibox:setup {
  199. layout = wibox.layout.align.horizontal,
  200. { -- Left widgets
  201. layout = wibox.layout.fixed.horizontal,
  202. first,
  203. s.mytaglist,
  204. arrl_pre,
  205. s.mylayoutbox,
  206. arrl_post,
  207. s.mypromptbox,
  208. first,
  209. },
  210. s.mytasklist, -- Middle widget
  211. { -- Right widgets
  212. layout = wibox.layout.fixed.horizontal,
  213. wibox.widget.systray(),
  214. first,
  215. theme.mpd.widget,
  216. --theme.mail.widget,
  217. --theme.fs.widget,
  218. bat.widget,
  219. theme.volume.widget,
  220. mytextclock,
  221. },
  222. }
  223. end
  224. return theme