My configuration files for Debian/Ubuntu applications
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

279 lignes
10 KiB

  1. --[[
  2. Steamburn 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.zenburn_dir = require("awful.util").get_themes_dir() .. "zenburn"
  14. theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn"
  15. theme.wallpaper = theme.dir .. "/wall.png"
  16. theme.font = "Terminus 10.5"
  17. theme.fg_normal = "#e2ccb0"
  18. theme.fg_focus = "#d88166"
  19. theme.fg_urgent = "#CC9393"
  20. theme.bg_normal = "#140c0b"
  21. theme.bg_focus = "#140c0b"
  22. theme.bg_urgent = "#2a1f1e"
  23. theme.border_width = dpi(1)
  24. theme.border_normal = "#302627"
  25. theme.border_focus = "#c2745b"
  26. theme.border_marked = "#CC9393"
  27. theme.taglist_fg_focus = "#d88166"
  28. theme.tasklist_bg_focus = "#140c0b"
  29. theme.tasklist_fg_focus = "#d88166"
  30. theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
  31. theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
  32. theme.menu_height = dpi(16)
  33. theme.menu_width = dpi(140)
  34. theme.awesome_icon = theme.dir .."/icons/awesome.png"
  35. theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
  36. theme.layout_txt_tile = "[t]"
  37. theme.layout_txt_tileleft = "[l]"
  38. theme.layout_txt_tilebottom = "[b]"
  39. theme.layout_txt_tiletop = "[tt]"
  40. theme.layout_txt_fairv = "[fv]"
  41. theme.layout_txt_fairh = "[fh]"
  42. theme.layout_txt_spiral = "[s]"
  43. theme.layout_txt_dwindle = "[d]"
  44. theme.layout_txt_max = "[m]"
  45. theme.layout_txt_fullscreen = "[F]"
  46. theme.layout_txt_magnifier = "[M]"
  47. theme.layout_txt_floating = "[|]"
  48. theme.tasklist_plain_task_name = true
  49. theme.tasklist_disable_icon = true
  50. theme.useless_gap = dpi(0)
  51. theme.titlebar_close_button_normal = theme.zenburn_dir.."/titlebar/close_normal.png"
  52. theme.titlebar_close_button_focus = theme.zenburn_dir.."/titlebar/close_focus.png"
  53. theme.titlebar_minimize_button_normal = theme.zenburn_dir.."/titlebar/minimize_normal.png"
  54. theme.titlebar_minimize_button_focus = theme.zenburn_dir.."/titlebar/minimize_focus.png"
  55. theme.titlebar_ontop_button_normal_inactive = theme.zenburn_dir.."/titlebar/ontop_normal_inactive.png"
  56. theme.titlebar_ontop_button_focus_inactive = theme.zenburn_dir.."/titlebar/ontop_focus_inactive.png"
  57. theme.titlebar_ontop_button_normal_active = theme.zenburn_dir.."/titlebar/ontop_normal_active.png"
  58. theme.titlebar_ontop_button_focus_active = theme.zenburn_dir.."/titlebar/ontop_focus_active.png"
  59. theme.titlebar_sticky_button_normal_inactive = theme.zenburn_dir.."/titlebar/sticky_normal_inactive.png"
  60. theme.titlebar_sticky_button_focus_inactive = theme.zenburn_dir.."/titlebar/sticky_focus_inactive.png"
  61. theme.titlebar_sticky_button_normal_active = theme.zenburn_dir.."/titlebar/sticky_normal_active.png"
  62. theme.titlebar_sticky_button_focus_active = theme.zenburn_dir.."/titlebar/sticky_focus_active.png"
  63. theme.titlebar_floating_button_normal_inactive = theme.zenburn_dir.."/titlebar/floating_normal_inactive.png"
  64. theme.titlebar_floating_button_focus_inactive = theme.zenburn_dir.."/titlebar/floating_focus_inactive.png"
  65. theme.titlebar_floating_button_normal_active = theme.zenburn_dir.."/titlebar/floating_normal_active.png"
  66. theme.titlebar_floating_button_focus_active = theme.zenburn_dir.."/titlebar/floating_focus_active.png"
  67. theme.titlebar_maximized_button_normal_inactive = theme.zenburn_dir.."/titlebar/maximized_normal_inactive.png"
  68. theme.titlebar_maximized_button_focus_inactive = theme.zenburn_dir.."/titlebar/maximized_focus_inactive.png"
  69. theme.titlebar_maximized_button_normal_active = theme.zenburn_dir.."/titlebar/maximized_normal_active.png"
  70. theme.titlebar_maximized_button_focus_active = theme.zenburn_dir.."/titlebar/maximized_focus_active.png"
  71. -- lain related
  72. theme.layout_txt_termfair = "[termfair]"
  73. theme.layout_txt_centerfair = "[centerfair]"
  74. local markup = lain.util.markup
  75. local gray = "#94928F"
  76. -- Textclock
  77. local mytextclock = wibox.widget.textclock(" %H:%M ")
  78. mytextclock.font = theme.font
  79. -- Calendar
  80. theme.cal = lain.widget.cal({
  81. attach_to = { mytextclock },
  82. notification_preset = {
  83. font = "Terminus 11",
  84. fg = theme.fg_normal,
  85. bg = theme.bg_normal
  86. }
  87. })
  88. -- Mail IMAP check
  89. --[[ to be set before use
  90. theme.mail = lain.widget.imap({
  91. timeout = 180,
  92. server = "server",
  93. mail = "mail",
  94. password = "keyring get mail",
  95. settings = function()
  96. mail = ""
  97. count = ""
  98. if mailcount > 0 then
  99. mail = "Mail "
  100. count = mailcount .. " "
  101. end
  102. widget:set_markup(markup(gray, mail) .. count)
  103. end
  104. })
  105. --]]
  106. -- MPD
  107. theme.mpd = lain.widget.mpd({
  108. settings = function()
  109. artist = mpd_now.artist .. " "
  110. title = mpd_now.title .. " "
  111. if mpd_now.state == "pause" then
  112. artist = "mpd "
  113. title = "paused "
  114. elseif mpd_now.state == "stop" then
  115. artist = ""
  116. title = ""
  117. end
  118. widget:set_markup(markup.font(theme.font, markup(gray, artist) .. title))
  119. end
  120. })
  121. -- CPU
  122. local cpu = lain.widget.sysload({
  123. settings = function()
  124. widget:set_markup(markup.font(theme.font, markup(gray, " Cpu ") .. load_1 .. " "))
  125. end
  126. })
  127. -- MEM
  128. local mem = lain.widget.mem({
  129. settings = function()
  130. widget:set_markup(markup.font(theme.font, markup(gray, " Mem ") .. mem_now.used .. " "))
  131. end
  132. })
  133. -- /home fs
  134. --[[ commented because it needs Gio/Glib >= 2.54
  135. theme.fs = lain.widget.fs({
  136. partition = "/home",
  137. notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Terminus 10.5" },
  138. })
  139. --]]
  140. -- Battery
  141. local bat = lain.widget.bat({
  142. settings = function()
  143. local perc = bat_now.perc
  144. if bat_now.ac_status == 1 then perc = perc .. " Plug" end
  145. widget:set_markup(markup.font(theme.font, markup(gray, " Bat ") .. perc .. " "))
  146. end
  147. })
  148. -- Net checker
  149. local net = lain.widget.net({
  150. settings = function()
  151. if net_now.state == "up" then net_state = "On"
  152. else net_state = "Off" end
  153. widget:set_markup(markup.font(theme.font, markup(gray, " Net ") .. net_state .. " "))
  154. end
  155. })
  156. -- ALSA volume
  157. theme.volume = lain.widget.alsa({
  158. settings = function()
  159. header = " Vol "
  160. vlevel = volume_now.level
  161. if volume_now.status == "off" then
  162. vlevel = vlevel .. "M "
  163. else
  164. vlevel = vlevel .. " "
  165. end
  166. widget:set_markup(markup.font(theme.font, markup(gray, header) .. vlevel))
  167. end
  168. })
  169. -- Weather
  170. --[[ to be set before use
  171. theme.weather = lain.widget.weather({
  172. --APPID =
  173. city_id = 2643743, -- placeholder (London)
  174. })
  175. --]]
  176. -- Separators
  177. local first = wibox.widget.textbox(markup.font("Terminus 4", " "))
  178. local spr = wibox.widget.textbox(' ')
  179. local function update_txt_layoutbox(s)
  180. -- Writes a string representation of the current layout in a textbox widget
  181. local txt_l = theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))] or ""
  182. s.mytxtlayoutbox:set_text(txt_l)
  183. end
  184. function theme.at_screen_connect(s)
  185. -- Quake application
  186. s.quake = lain.util.quake({ app = awful.util.terminal })
  187. -- If wallpaper is a function, call it with the screen
  188. local wallpaper = theme.wallpaper
  189. if type(wallpaper) == "function" then
  190. wallpaper = wallpaper(s)
  191. end
  192. gears.wallpaper.maximized(wallpaper, s, true)
  193. -- Tags
  194. awful.tag(awful.util.tagnames, s, awful.layout.layouts)
  195. -- Create a promptbox for each screen
  196. s.mypromptbox = awful.widget.prompt()
  197. -- Textual layoutbox
  198. s.mytxtlayoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))])
  199. awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end)
  200. awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end)
  201. s.mytxtlayoutbox:buttons(my_table.join(
  202. awful.button({}, 1, function() awful.layout.inc(1) end),
  203. awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
  204. awful.button({}, 3, function() awful.layout.inc(-1) end),
  205. awful.button({}, 4, function() awful.layout.inc(1) end),
  206. awful.button({}, 5, function() awful.layout.inc(-1) end)))
  207. -- Create a taglist widget
  208. s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
  209. -- Create a tasklist widget
  210. s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
  211. -- Create the wibox
  212. s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18) })
  213. -- Add widgets to the wibox
  214. s.mywibox:setup {
  215. layout = wibox.layout.align.horizontal,
  216. { -- Left widgets
  217. layout = wibox.layout.fixed.horizontal,
  218. first,
  219. s.mytaglist,
  220. spr,
  221. s.mytxtlayoutbox,
  222. --spr,
  223. s.mypromptbox,
  224. spr,
  225. },
  226. s.mytasklist, -- Middle widget
  227. { -- Right widgets
  228. layout = wibox.layout.fixed.horizontal,
  229. wibox.widget.systray(),
  230. spr,
  231. theme.mpd.widget,
  232. --theme.mail.widget,
  233. cpu.widget,
  234. mem.widget,
  235. bat.widget,
  236. net.widget,
  237. theme.volume.widget,
  238. mytextclock
  239. },
  240. }
  241. end
  242. return theme