My configuration files for Debian/Ubuntu applications
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

360 рядки
15 KiB

  1. --[[
  2. Powerarrow Dark Awesome WM theme
  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/powerarrow-dark"
  14. theme.wallpaper = theme.dir .. "/wall.png"
  15. theme.font = "Terminus 9"
  16. theme.fg_normal = "#DDDDFF"
  17. theme.fg_focus = "#EA6F81"
  18. theme.fg_urgent = "#CC9393"
  19. theme.bg_normal = "#1A1A1A"
  20. theme.bg_focus = "#313131"
  21. theme.bg_urgent = "#1A1A1A"
  22. theme.border_width = dpi(1)
  23. theme.border_normal = "#3F3F3F"
  24. theme.border_focus = "#7F7F7F"
  25. theme.border_marked = "#CC9393"
  26. theme.tasklist_bg_focus = "#1A1A1A"
  27. theme.titlebar_bg_focus = theme.bg_focus
  28. theme.titlebar_bg_normal = theme.bg_normal
  29. theme.titlebar_fg_focus = theme.fg_focus
  30. theme.menu_height = dpi(16)
  31. theme.menu_width = dpi(140)
  32. theme.menu_submenu_icon = theme.dir .. "/icons/submenu.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.widget_ac = theme.dir .. "/icons/ac.png"
  48. theme.widget_battery = theme.dir .. "/icons/battery.png"
  49. theme.widget_battery_low = theme.dir .. "/icons/battery_low.png"
  50. theme.widget_battery_empty = theme.dir .. "/icons/battery_empty.png"
  51. theme.widget_mem = theme.dir .. "/icons/mem.png"
  52. theme.widget_cpu = theme.dir .. "/icons/cpu.png"
  53. theme.widget_temp = theme.dir .. "/icons/temp.png"
  54. theme.widget_net = theme.dir .. "/icons/net.png"
  55. theme.widget_hdd = theme.dir .. "/icons/hdd.png"
  56. theme.widget_music = theme.dir .. "/icons/note.png"
  57. theme.widget_music_on = theme.dir .. "/icons/note_on.png"
  58. theme.widget_vol = theme.dir .. "/icons/vol.png"
  59. theme.widget_vol_low = theme.dir .. "/icons/vol_low.png"
  60. theme.widget_vol_no = theme.dir .. "/icons/vol_no.png"
  61. theme.widget_vol_mute = theme.dir .. "/icons/vol_mute.png"
  62. theme.widget_mail = theme.dir .. "/icons/mail.png"
  63. theme.widget_mail_on = theme.dir .. "/icons/mail_on.png"
  64. theme.tasklist_plain_task_name = true
  65. theme.tasklist_disable_icon = true
  66. theme.useless_gap = dpi(0)
  67. theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
  68. theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
  69. theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
  70. theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
  71. theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
  72. theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
  73. theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
  74. theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
  75. theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
  76. theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
  77. theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
  78. theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
  79. theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
  80. theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
  81. theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
  82. theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
  83. theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
  84. theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
  85. local markup = lain.util.markup
  86. local separators = lain.util.separators
  87. local keyboardlayout = awful.widget.keyboardlayout:new()
  88. -- Textclock
  89. local clockicon = wibox.widget.imagebox(theme.widget_clock)
  90. local clock = awful.widget.watch(
  91. "date +'%a %d %b %R'", 60,
  92. function(widget, stdout)
  93. widget:set_markup(" " .. markup.font(theme.font, stdout))
  94. end
  95. )
  96. -- Calendar
  97. theme.cal = lain.widget.cal({
  98. attach_to = { clock },
  99. notification_preset = {
  100. font = "Terminus 10",
  101. fg = theme.fg_normal,
  102. bg = theme.bg_normal
  103. }
  104. })
  105. -- Mail IMAP check
  106. local mailicon = wibox.widget.imagebox(theme.widget_mail)
  107. --[[ commented because it needs to be set before use
  108. mailicon:buttons(my_table.join(awful.button({ }, 1, function () awful.spawn(mail) end)))
  109. theme.mail = lain.widget.imap({
  110. timeout = 180,
  111. server = "server",
  112. mail = "mail",
  113. password = "keyring get mail",
  114. settings = function()
  115. if mailcount > 0 then
  116. widget:set_markup(markup.font(theme.font, " " .. mailcount .. " "))
  117. mailicon:set_image(theme.widget_mail_on)
  118. else
  119. widget:set_text("")
  120. mailicon:set_image(theme.widget_mail)
  121. end
  122. end
  123. })
  124. --]]
  125. -- MPD
  126. local musicplr = awful.util.terminal .. " -title Music -e ncmpcpp"
  127. local mpdicon = wibox.widget.imagebox(theme.widget_music)
  128. mpdicon:buttons(my_table.join(
  129. awful.button({ "Mod4" }, 1, function () awful.spawn(musicplr) end),
  130. awful.button({ }, 1, function ()
  131. os.execute("mpc prev")
  132. theme.mpd.update()
  133. end),
  134. awful.button({ }, 2, function ()
  135. os.execute("mpc toggle")
  136. theme.mpd.update()
  137. end),
  138. awful.button({ }, 3, function ()
  139. os.execute("mpc next")
  140. theme.mpd.update()
  141. end)))
  142. theme.mpd = lain.widget.mpd({
  143. settings = function()
  144. if mpd_now.state == "play" then
  145. artist = " " .. mpd_now.artist .. " "
  146. title = mpd_now.title .. " "
  147. mpdicon:set_image(theme.widget_music_on)
  148. elseif mpd_now.state == "pause" then
  149. artist = " mpd "
  150. title = "paused "
  151. else
  152. artist = ""
  153. title = ""
  154. mpdicon:set_image(theme.widget_music)
  155. end
  156. widget:set_markup(markup.font(theme.font, markup("#EA6F81", artist) .. title))
  157. end
  158. })
  159. -- MEM
  160. local memicon = wibox.widget.imagebox(theme.widget_mem)
  161. local mem = lain.widget.mem({
  162. settings = function()
  163. widget:set_markup(markup.font(theme.font, " " .. mem_now.used .. "MB "))
  164. end
  165. })
  166. -- CPU
  167. local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
  168. local cpu = lain.widget.cpu({
  169. settings = function()
  170. widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% "))
  171. end
  172. })
  173. -- Coretemp
  174. local tempicon = wibox.widget.imagebox(theme.widget_temp)
  175. local temp = lain.widget.temp({
  176. settings = function()
  177. widget:set_markup(markup.font(theme.font, " " .. coretemp_now .. "°C "))
  178. end
  179. })
  180. -- / fs
  181. local fsicon = wibox.widget.imagebox(theme.widget_hdd)
  182. --[[ commented because it needs Gio/Glib >= 2.54
  183. theme.fs = lain.widget.fs({
  184. notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Terminus 10" },
  185. settings = function()
  186. widget:set_markup(markup.font(theme.font, " " .. fs_now["/"].percentage .. "% "))
  187. end
  188. })
  189. --]]
  190. -- Battery
  191. local baticon = wibox.widget.imagebox(theme.widget_battery)
  192. local bat = lain.widget.bat({
  193. settings = function()
  194. if bat_now.status and bat_now.status ~= "N/A" then
  195. if bat_now.ac_status == 1 then
  196. baticon:set_image(theme.widget_ac)
  197. elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then
  198. baticon:set_image(theme.widget_battery_empty)
  199. elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then
  200. baticon:set_image(theme.widget_battery_low)
  201. else
  202. baticon:set_image(theme.widget_battery)
  203. end
  204. widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% "))
  205. else
  206. widget:set_markup(markup.font(theme.font, " AC "))
  207. baticon:set_image(theme.widget_ac)
  208. end
  209. end
  210. })
  211. -- ALSA volume
  212. local volicon = wibox.widget.imagebox(theme.widget_vol)
  213. theme.volume = lain.widget.alsa({
  214. settings = function()
  215. if volume_now.status == "off" then
  216. volicon:set_image(theme.widget_vol_mute)
  217. elseif tonumber(volume_now.level) == 0 then
  218. volicon:set_image(theme.widget_vol_no)
  219. elseif tonumber(volume_now.level) <= 50 then
  220. volicon:set_image(theme.widget_vol_low)
  221. else
  222. volicon:set_image(theme.widget_vol)
  223. end
  224. widget:set_markup(markup.font(theme.font, " " .. volume_now.level .. "% "))
  225. end
  226. })
  227. theme.volume.widget:buttons(awful.util.table.join(
  228. awful.button({}, 4, function ()
  229. awful.util.spawn("amixer set Master 1%+")
  230. theme.volume.update()
  231. end),
  232. awful.button({}, 5, function ()
  233. awful.util.spawn("amixer set Master 1%-")
  234. theme.volume.update()
  235. end)
  236. ))
  237. -- Net
  238. local neticon = wibox.widget.imagebox(theme.widget_net)
  239. local net = lain.widget.net({
  240. settings = function()
  241. widget:set_markup(markup.font(theme.font,
  242. markup("#7AC82E", " " .. string.format("%06.1f", net_now.received))
  243. .. " " ..
  244. markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " ")))
  245. end
  246. })
  247. -- Separators
  248. local spr = wibox.widget.textbox(' ')
  249. local arrl_dl = separators.arrow_left(theme.bg_focus, "alpha")
  250. local arrl_ld = separators.arrow_left("alpha", theme.bg_focus)
  251. function theme.at_screen_connect(s)
  252. -- Quake application
  253. s.quake = lain.util.quake({ app = awful.util.terminal })
  254. -- If wallpaper is a function, call it with the screen
  255. local wallpaper = theme.wallpaper
  256. if type(wallpaper) == "function" then
  257. wallpaper = wallpaper(s)
  258. end
  259. gears.wallpaper.maximized(wallpaper, s, true)
  260. -- Tags
  261. awful.tag(awful.util.tagnames, s, awful.layout.layouts)
  262. -- Create a promptbox for each screen
  263. s.mypromptbox = awful.widget.prompt()
  264. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  265. -- We need one layoutbox per screen.
  266. s.mylayoutbox = awful.widget.layoutbox(s)
  267. s.mylayoutbox:buttons(my_table.join(
  268. awful.button({}, 1, function () awful.layout.inc( 1) end),
  269. awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
  270. awful.button({}, 3, function () awful.layout.inc(-1) end),
  271. awful.button({}, 4, function () awful.layout.inc( 1) end),
  272. awful.button({}, 5, function () awful.layout.inc(-1) end)))
  273. -- Create a taglist widget
  274. s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
  275. -- Create a tasklist widget
  276. s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
  277. -- Create the wibox
  278. s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18), bg = theme.bg_normal, fg = theme.fg_normal })
  279. -- Add widgets to the wibox
  280. s.mywibox:setup {
  281. layout = wibox.layout.align.horizontal,
  282. { -- Left widgets
  283. layout = wibox.layout.fixed.horizontal,
  284. --spr,
  285. s.mytaglist,
  286. s.mypromptbox,
  287. spr,
  288. },
  289. s.mytasklist, -- Middle widget
  290. { -- Right widgets
  291. layout = wibox.layout.fixed.horizontal,
  292. wibox.widget.systray(),
  293. keyboardlayout,
  294. spr,
  295. arrl_ld,
  296. wibox.container.background(mpdicon, theme.bg_focus),
  297. wibox.container.background(theme.mpd.widget, theme.bg_focus),
  298. arrl_dl,
  299. volicon,
  300. theme.volume.widget,
  301. arrl_ld,
  302. wibox.container.background(mailicon, theme.bg_focus),
  303. --wibox.container.background(theme.mail.widget, theme.bg_focus),
  304. arrl_dl,
  305. memicon,
  306. mem.widget,
  307. arrl_ld,
  308. wibox.container.background(cpuicon, theme.bg_focus),
  309. wibox.container.background(cpu.widget, theme.bg_focus),
  310. arrl_dl,
  311. tempicon,
  312. temp.widget,
  313. arrl_ld,
  314. wibox.container.background(fsicon, theme.bg_focus),
  315. --wibox.container.background(theme.fs.widget, theme.bg_focus),
  316. arrl_dl,
  317. baticon,
  318. bat.widget,
  319. arrl_ld,
  320. wibox.container.background(neticon, theme.bg_focus),
  321. wibox.container.background(net.widget, theme.bg_focus),
  322. arrl_dl,
  323. clock,
  324. spr,
  325. arrl_ld,
  326. wibox.container.background(s.mylayoutbox, theme.bg_focus),
  327. },
  328. }
  329. end
  330. return theme