aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-08-20 20:18:48 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-08-20 20:18:48 -0300
commitb94936906836f2c5b8ae429106c79bf650596a9f (patch)
treeafeb1c3f75e13ffa455651c3be9f3cc00a250c31
parent602e9bc2cb38ab6a211e3f0fe7e59f30a1825035 (diff)
downloadawesome-b94936906836f2c5b8ae429106c79bf650596a9f.tar.gz
awesome-b94936906836f2c5b8ae429106c79bf650596a9f.tar.bz2
Cleanup theme
-rw-r--r--config.dot/awesome.link/themes/xoria256/theme.lua300
1 files changed, 7 insertions, 293 deletions
diff --git a/config.dot/awesome.link/themes/xoria256/theme.lua b/config.dot/awesome.link/themes/xoria256/theme.lua
index 338ed50..7a69749 100644
--- a/config.dot/awesome.link/themes/xoria256/theme.lua
+++ b/config.dot/awesome.link/themes/xoria256/theme.lua
@@ -1,16 +1,16 @@
--[[
- xoria256 Awesome WM theme
- based on github.com/copycat-killer
+ xoria256 Awesome WM theme
+ based on powerarrow from github.com/copycat-killer
--]]
-local gears = require("gears")
-local lain = require("lain")
-local awful = require("awful")
-local wibox = require("wibox")
-local os, math, string = os, math, string
+--local gears = require("gears")
+--local lain = require("lain")
+--local awful = require("awful")
+--local wibox = require("wibox")
+--local os, math, string = os, math, string
local theme = {}
theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/xoria256"
@@ -103,290 +103,4 @@ theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/
theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
-local markup = lain.util.markup
-local separators = lain.util.separators
-
--- Binary clock
-local binclock = require("themes.xoria256.binclock"){
- height = 16,
- show_seconds = true,
- color_active = theme.fg_normal,
- color_inactive = theme.bg_focus
-}
-
--- Calendar
-theme.cal = lain.widget.calendar({
- --cal = "cal --color=always",
- attach_to = { binclock.widget },
- notification_preset = {
- font = "xos4 Terminus 10",
- fg = theme.fg_normal,
- bg = theme.bg_normal
- }
-})
-
--- Taskwarrior
-local task = wibox.widget.imagebox(theme.widget_task)
-lain.widget.contrib.task.attach(task, {
- -- do not colorize output
- show_cmd = "task | sed -r 's/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'"
-})
-task:buttons(awful.util.table.join(awful.button({}, 1, lain.widget.contrib.task.prompt)))
-
--- Scissors (xsel copy and paste)
-local scissors = wibox.widget.imagebox(theme.widget_scissors)
-scissors:buttons(awful.util.table.join(awful.button({}, 1, function() awful.spawn("xsel | xsel -i -b") end)))
-
--- Mail IMAP check
-local mailicon = wibox.widget.imagebox(theme.widget_mail)
---[[ commented because it needs to be set before use
-mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.spawn(mail) end)))
-local mail = lain.widget.imap({
- timeout = 180,
- server = "server",
- mail = "mail",
- password = "keyring get mail",
- settings = function()
- if mailcount > 0 then
- widget:set_text(" " .. mailcount .. " ")
- mailicon:set_image(theme.widget_mail_on)
- else
- widget:set_text("")
- mailicon:set_image(theme.widget_mail)
- end
- end
-})
---]]
-
--- ALSA volume
-theme.volume = lain.widget.alsabar({
- --togglechannel = "IEC958,3",
- notification_preset = { font = "xos4 Terminus 10", fg = theme.fg_normal },
-})
-
--- MPD
----local musicplr = awful.util.terminal .. " -title Music -g 130x34-320+16 -e ncmpcpp"
----local mpdicon = wibox.widget.imagebox(theme.widget_music)
----mpdicon:buttons(awful.util.table.join(
---- awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end),
---- awful.button({ }, 1, function ()
---- awful.spawn.with_shell("mpc prev")
---- theme.mpd.update()
---- end),
---- awful.button({ }, 2, function ()
---- awful.spawn.with_shell("mpc toggle")
---- theme.mpd.update()
---- end),
---- awful.button({ }, 3, function ()
---- awful.spawn.with_shell("mpc next")
---- theme.mpd.update()
---- end)))
----theme.mpd = lain.widget.mpd({
---- settings = function()
---- if mpd_now.state == "play" then
---- artist = " " .. mpd_now.artist .. " "
---- title = mpd_now.title .. " "
---- mpdicon:set_image(theme.widget_music_on)
---- widget:set_markup(markup.font(theme.font, markup("#FF8466", artist) .. " " .. title))
---- elseif mpd_now.state == "pause" then
---- widget:set_markup(markup.font(theme.font, " mpd paused "))
---- mpdicon:set_image(theme.widget_music_pause)
---- else
---- widget:set_text("")
---- mpdicon:set_image(theme.widget_music)
---- end
---- end
----})
-
--- MEM
-local memicon = wibox.widget.imagebox(theme.widget_mem)
-local mem = lain.widget.mem({
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. mem_now.used .. "MB "))
- end
-})
-
--- CPU
-local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
-local cpu = lain.widget.cpu({
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% "))
- end
-})
-
---[[ Coretemp (lm_sensors, per core)
-local tempwidget = awful.widget.watch({awful.util.shell, '-c', 'sensors | grep Core'}, 30,
-function(widget, stdout)
- local temps = ""
- for line in stdout:gmatch("[^\r\n]+") do
- temps = temps .. line:match("+(%d+).*°C") .. "° " -- in Celsius
- end
- widget:set_markup(markup.font(theme.font, " " .. temps))
-end)
---]]
--- Coretemp (lain, average)
-local temp = lain.widget.temp({
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. coretemp_now .. "°C "))
- end
-})
---]]
-local tempicon = wibox.widget.imagebox(theme.widget_temp)
-
--- / fs
-local fsicon = wibox.widget.imagebox(theme.widget_hdd)
-theme.fs = lain.widget.fs({
- options = "--exclude-type=tmpfs",
- notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "xos4 Terminus 10" },
- settings = function()
- widget:set_markup(markup.font(theme.font, " " .. fs_now.available_gb .. "GB "))
- end
-})
-
--- Battery
-local baticon = wibox.widget.imagebox(theme.widget_battery)
-local bat = lain.widget.bat({
- settings = function()
- if bat_now.status ~= "N/A" then
- if bat_now.ac_status == 1 then
- widget:set_markup(markup.font(theme.font, " AC "))
- baticon:set_image(theme.widget_ac)
- return
- elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then
- baticon:set_image(theme.widget_battery_empty)
- elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then
- baticon:set_image(theme.widget_battery_low)
- else
- baticon:set_image(theme.widget_battery)
- end
- widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% "))
- else
- widget:set_markup()
- baticon:set_image(theme.widget_ac)
- end
- end
-})
-
--- Net
-local neticon = wibox.widget.imagebox(theme.widget_net)
-local net = lain.widget.net({
- settings = function()
- widget:set_markup(markup.fontfg(theme.font, "#FEFEFE", " " .. net_now.received .. " ↓↑ " .. net_now.sent .. " "))
- end
-})
-
--- Separators
-local arrow = separators.arrow_left
-
-function theme.powerline_rl(cr, width, height)
- local arrow_depth, offset = height/2, 0
-
- -- Avoid going out of the (potential) clip area
- if arrow_depth < 0 then
- width = width + 2*arrow_depth
- offset = -arrow_depth
- end
-
- cr:move_to(offset + arrow_depth , 0 )
- cr:line_to(offset + width , 0 )
- cr:line_to(offset + width - arrow_depth , height/2 )
- cr:line_to(offset + width , height )
- cr:line_to(offset + arrow_depth , height )
- cr:line_to(offset , height/2 )
-
- cr:close_path()
-end
-
-local function pl(widget, bgcolor, padding)
- return wibox.container.background(wibox.container.margin(widget, 16, 16), bgcolor, theme.powerline_rl)
-end
-
-function theme.at_screen_connect(s)
- -- Quake application
- s.quake = lain.util.quake({ app = awful.util.terminal })
-
- -- If wallpaper is a function, call it with the screen
- local wallpaper = theme.wallpaper
- if type(wallpaper) == "function" then
- wallpaper = wallpaper(s)
- end
- gears.wallpaper.maximized(wallpaper, s, true)
-
- -- Tags
- awful.tag(awful.util.tagnames, s, awful.layout.layouts)
-
- -- Create a promptbox for each screen
- s.mypromptbox = awful.widget.prompt()
- -- Create an imagebox widget which will contains an icon indicating which layout we're using.
- -- We need one layoutbox per screen.
- s.mylayoutbox = awful.widget.layoutbox(s)
- s.mylayoutbox:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.layout.inc( 1) end),
- awful.button({ }, 3, function () awful.layout.inc(-1) end),
- awful.button({ }, 4, function () awful.layout.inc( 1) end),
- awful.button({ }, 5, function () awful.layout.inc(-1) end)))
- -- Create a taglist widget
- s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
-
- -- Create a tasklist widget
- s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
-
- -- Create the wibox
- s.mywibox = awful.wibar({ position = "top", screen = s, height = 16, bg = theme.bg_normal, fg = theme.fg_normal })
-
- -- Add widgets to the wibox
- s.mywibox:setup {
- layout = wibox.layout.align.horizontal,
- { -- Left widgets
- layout = wibox.layout.fixed.horizontal,
- --spr,
- s.mytaglist,
- s.mypromptbox,
- spr,
- },
- s.mytasklist, -- Middle widget
- { -- Right widgets
- layout = wibox.layout.fixed.horizontal,
- wibox.widget.systray(),
- wibox.container.margin(scissors, 4, 8),
- --[[ using shapes
- pl(wibox.widget { mpdicon, theme.mpd.widget, layout = wibox.layout.align.horizontal }, "#343434"),
- pl(task, "#343434"),
- --pl(wibox.widget { mailicon, mail and mail.widget, layout = wibox.layout.align.horizontal }, "#343434"),
- pl(wibox.widget { memicon, mem.widget, layout = wibox.layout.align.horizontal }, "#777E76"),
- pl(wibox.widget { cpuicon, cpu.widget, layout = wibox.layout.align.horizontal }, "#4B696D"),
- pl(wibox.widget { tempicon, temp.widget, layout = wibox.layout.align.horizontal }, "#4B3B51"),
- pl(wibox.widget { fsicon, theme.fs.widget, layout = wibox.layout.align.horizontal }, "#CB755B"),
- pl(wibox.widget { baticon, bat.widget, layout = wibox.layout.align.horizontal }, "#8DAA9A"),
- pl(wibox.widget { neticon, net.widget, layout = wibox.layout.align.horizontal }, "#C0C0A2"),
- pl(binclock.widget, "#777E76"),
- --]]
- -- using separators
- arrow(theme.bg_normal, "#343434"),
- wibox.container.background(wibox.container.margin(wibox.widget { mailicon, mail and mail.widget, layout = wibox.layout.align.horizontal }, 4, 7), "#343434"),
- arrow("#343434", theme.bg_normal),
- wibox.container.background(wibox.container.margin(wibox.widget { mpdicon, theme.mpd.widget, layout = wibox.layout.align.horizontal }, 3, 6), theme.bg_focus),
- arrow(theme.bg_normal, "#343434"),
- wibox.container.background(wibox.container.margin(task, 3, 7), "#343434"),
- arrow("#343434", "#777E76"),
- wibox.container.background(wibox.container.margin(wibox.widget { memicon, mem.widget, layout = wibox.layout.align.horizontal }, 2, 3), "#777E76"),
- arrow("#777E76", "#4B696D"),
- wibox.container.background(wibox.container.margin(wibox.widget { cpuicon, cpu.widget, layout = wibox.layout.align.horizontal }, 3, 4), "#4B696D"),
- arrow("#4B696D", "#4B3B51"),
- wibox.container.background(wibox.container.margin(wibox.widget { tempicon, temp.widget, layout = wibox.layout.align.horizontal }, 4, 4), "#4B3B51"),
- arrow("#4B3B51", "#CB755B"),
- wibox.container.background(wibox.container.margin(wibox.widget { fsicon, theme.fs.widget, layout = wibox.layout.align.horizontal }, 3, 3), "#CB755B"),
- arrow("#CB755B", "#8DAA9A"),
- wibox.container.background(wibox.container.margin(wibox.widget { baticon, bat.widget, layout = wibox.layout.align.horizontal }, 3, 3), "#8DAA9A"),
- arrow("#8DAA9A", "#C0C0A2"),
- wibox.container.background(wibox.container.margin(wibox.widget { nil, neticon, net.widget, layout = wibox.layout.align.horizontal }, 3, 3), "#C0C0A2"),
- arrow("#C0C0A2", "#777E76"),
- wibox.container.background(wibox.container.margin(binclock.widget, 4, 8), "#777E76"),
- arrow("#777E76", "alpha"),
- --]]
- s.mylayoutbox,
- },
- }
-end
-
return theme