2013-09-13 21:20:22 +02:00
|
|
|
--[[
|
2017-09-13 12:34:28 +02:00
|
|
|
|
|
|
|
Rainbow Awesome WM theme 2.0
|
2017-10-07 13:10:43 +02:00
|
|
|
github.com/lcpz
|
2017-09-13 12:34:28 +02:00
|
|
|
|
2013-09-13 21:20:22 +02:00
|
|
|
--]]
|
2013-07-26 21:11:19 +02:00
|
|
|
|
2017-01-29 14:05:35 +01:00
|
|
|
local gears = require("gears")
|
|
|
|
local lain = require("lain")
|
|
|
|
local awful = require("awful")
|
|
|
|
local wibox = require("wibox")
|
2018-02-02 12:17:33 +01:00
|
|
|
|
2018-10-16 17:28:46 +02:00
|
|
|
local os = os
|
2018-02-02 12:17:33 +01:00
|
|
|
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
2013-08-16 19:44:55 +02:00
|
|
|
|
2017-01-29 14:05:35 +01:00
|
|
|
local theme = {}
|
2017-01-15 17:15:48 +01:00
|
|
|
theme.default_dir = require("awful.util").get_themes_dir() .. "default"
|
|
|
|
theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/rainbow"
|
|
|
|
theme.wallpaper = theme.dir .. "/wall.png"
|
2017-01-29 14:05:35 +01:00
|
|
|
theme.font = "Misc Tamsyn 10.5"
|
2017-01-15 17:15:48 +01:00
|
|
|
theme.fg_normal = "#9E9E9E"
|
|
|
|
theme.fg_focus = "#EBEBFF"
|
|
|
|
theme.bg_normal = "#242424"
|
|
|
|
theme.bg_focus = "#242424"
|
|
|
|
theme.fg_urgent = "#000000"
|
|
|
|
theme.bg_urgent = "#FFFFFF"
|
|
|
|
theme.border_width = 1
|
|
|
|
theme.border_normal = "#242424"
|
|
|
|
theme.border_focus = "#EBEBFF"
|
|
|
|
theme.taglist_fg_focus = "#EDEFFF"
|
|
|
|
theme.taglist_bg_focus = "#242424"
|
|
|
|
theme.menu_height = 16
|
|
|
|
theme.menu_width = 140
|
|
|
|
theme.ocol = "<span color='" .. theme.fg_normal .. "'>"
|
|
|
|
theme.tasklist_sticky = theme.ocol .. "[S]</span>"
|
|
|
|
theme.tasklist_ontop = theme.ocol .. "[T]</span>"
|
|
|
|
theme.tasklist_floating = theme.ocol .. "[F]</span>"
|
|
|
|
theme.tasklist_maximized_horizontal = theme.ocol .. "[M] </span>"
|
|
|
|
theme.tasklist_maximized_vertical = ""
|
|
|
|
theme.tasklist_disable_icon = true
|
2017-01-29 16:13:15 +01:00
|
|
|
theme.awesome_icon = theme.dir .."/icons/awesome.png"
|
2017-01-15 17:15:48 +01:00
|
|
|
theme.menu_submenu_icon = theme.dir .."/icons/submenu.png"
|
|
|
|
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
|
|
|
|
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
|
|
|
|
theme.useless_gap = 8
|
|
|
|
theme.layout_txt_tile = "[t]"
|
|
|
|
theme.layout_txt_tileleft = "[l]"
|
|
|
|
theme.layout_txt_tilebottom = "[b]"
|
|
|
|
theme.layout_txt_tiletop = "[tt]"
|
|
|
|
theme.layout_txt_fairv = "[fv]"
|
|
|
|
theme.layout_txt_fairh = "[fh]"
|
|
|
|
theme.layout_txt_spiral = "[s]"
|
|
|
|
theme.layout_txt_dwindle = "[d]"
|
|
|
|
theme.layout_txt_max = "[m]"
|
|
|
|
theme.layout_txt_fullscreen = "[F]"
|
|
|
|
theme.layout_txt_magnifier = "[M]"
|
|
|
|
theme.layout_txt_floating = "[*]"
|
|
|
|
theme.titlebar_close_button_normal = theme.default_dir.."/titlebar/close_normal.png"
|
|
|
|
theme.titlebar_close_button_focus = theme.default_dir.."/titlebar/close_focus.png"
|
|
|
|
theme.titlebar_minimize_button_normal = theme.default_dir.."/titlebar/minimize_normal.png"
|
|
|
|
theme.titlebar_minimize_button_focus = theme.default_dir.."/titlebar/minimize_focus.png"
|
|
|
|
theme.titlebar_ontop_button_normal_inactive = theme.default_dir.."/titlebar/ontop_normal_inactive.png"
|
|
|
|
theme.titlebar_ontop_button_focus_inactive = theme.default_dir.."/titlebar/ontop_focus_inactive.png"
|
|
|
|
theme.titlebar_ontop_button_normal_active = theme.default_dir.."/titlebar/ontop_normal_active.png"
|
|
|
|
theme.titlebar_ontop_button_focus_active = theme.default_dir.."/titlebar/ontop_focus_active.png"
|
|
|
|
theme.titlebar_sticky_button_normal_inactive = theme.default_dir.."/titlebar/sticky_normal_inactive.png"
|
|
|
|
theme.titlebar_sticky_button_focus_inactive = theme.default_dir.."/titlebar/sticky_focus_inactive.png"
|
|
|
|
theme.titlebar_sticky_button_normal_active = theme.default_dir.."/titlebar/sticky_normal_active.png"
|
|
|
|
theme.titlebar_sticky_button_focus_active = theme.default_dir.."/titlebar/sticky_focus_active.png"
|
|
|
|
theme.titlebar_floating_button_normal_inactive = theme.default_dir.."/titlebar/floating_normal_inactive.png"
|
|
|
|
theme.titlebar_floating_button_focus_inactive = theme.default_dir.."/titlebar/floating_focus_inactive.png"
|
|
|
|
theme.titlebar_floating_button_normal_active = theme.default_dir.."/titlebar/floating_normal_active.png"
|
|
|
|
theme.titlebar_floating_button_focus_active = theme.default_dir.."/titlebar/floating_focus_active.png"
|
|
|
|
theme.titlebar_maximized_button_normal_inactive = theme.default_dir.."/titlebar/maximized_normal_inactive.png"
|
|
|
|
theme.titlebar_maximized_button_focus_inactive = theme.default_dir.."/titlebar/maximized_focus_inactive.png"
|
|
|
|
theme.titlebar_maximized_button_normal_active = theme.default_dir.."/titlebar/maximized_normal_active.png"
|
|
|
|
theme.titlebar_maximized_button_focus_active = theme.default_dir.."/titlebar/maximized_focus_active.png"
|
2013-07-26 21:11:19 +02:00
|
|
|
|
2017-01-29 14:05:35 +01:00
|
|
|
-- lain related
|
|
|
|
theme.layout_txt_cascade = "[cascade]"
|
|
|
|
theme.layout_txt_cascadetile = "[cascadetile]"
|
|
|
|
theme.layout_txt_centerwork = "[centerwork]"
|
|
|
|
theme.layout_txt_termfair = "[termfair]"
|
|
|
|
theme.layout_txt_centerfair = "[centerfair]"
|
|
|
|
|
|
|
|
local markup = lain.util.markup
|
|
|
|
local white = theme.fg_focus
|
|
|
|
local gray = theme.fg_normal
|
|
|
|
|
|
|
|
-- Textclock
|
|
|
|
local mytextclock = wibox.widget.textclock(markup(white, " %H:%M "))
|
|
|
|
mytextclock.font = theme.font
|
|
|
|
|
|
|
|
-- Calendar
|
2018-09-14 21:24:48 +02:00
|
|
|
theme.cal = lain.widget.cal({
|
2017-01-29 14:05:35 +01:00
|
|
|
attach_to = { mytextclock },
|
|
|
|
notification_preset = {
|
|
|
|
font = "Misc Tamsyn 11",
|
|
|
|
fg = white,
|
|
|
|
bg = theme.bg_normal
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2018-09-17 21:35:27 +02:00
|
|
|
-- Mail IMAP check
|
|
|
|
--[[ commented because it needs to be set before use
|
|
|
|
theme.mail = lain.widget.imap({
|
2017-01-29 14:05:35 +01:00
|
|
|
timeout = 180,
|
|
|
|
server = "server",
|
|
|
|
mail = "mail",
|
|
|
|
password = "keyring get mail",
|
|
|
|
settings = function()
|
|
|
|
mail_notification_preset.fg = white
|
|
|
|
|
|
|
|
mail = ""
|
|
|
|
count = ""
|
|
|
|
|
|
|
|
if mailcount > 0 then
|
|
|
|
mail = "Mail "
|
|
|
|
count = mailcount .. " "
|
|
|
|
end
|
|
|
|
|
|
|
|
widget:set_markup(markup.font(theme.font, markup(gray, mail) .. markup(white, count)))
|
|
|
|
end
|
|
|
|
})
|
2018-09-17 21:35:27 +02:00
|
|
|
--]]
|
2017-01-29 14:05:35 +01:00
|
|
|
|
|
|
|
-- MPD
|
2017-02-08 14:16:12 +01:00
|
|
|
theme.mpd = lain.widget.mpd({
|
2017-01-29 14:05:35 +01:00
|
|
|
settings = function()
|
|
|
|
mpd_notification_preset.fg = white
|
|
|
|
|
|
|
|
artist = mpd_now.artist .. " "
|
|
|
|
title = mpd_now.title .. " "
|
|
|
|
|
|
|
|
if mpd_now.state == "pause" then
|
|
|
|
artist = "mpd "
|
|
|
|
title = "paused "
|
|
|
|
elseif mpd_now.state == "stop" then
|
|
|
|
artist = ""
|
|
|
|
title = ""
|
|
|
|
end
|
|
|
|
|
|
|
|
widget:set_markup(markup.font(theme.font, markup(gray, artist) .. markup(white, title)))
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
-- /home fs
|
2018-09-17 21:35:27 +02:00
|
|
|
--[[ commented because it needs Gio/Glib >= 2.54
|
2017-02-08 14:16:12 +01:00
|
|
|
theme.fs = lain.widget.fs({
|
2017-01-29 14:05:35 +01:00
|
|
|
notification_preset = { fg = white, bg = theme.bg_normal, font = "Misc Tamsyn 10.5" },
|
|
|
|
settings = function()
|
2018-02-16 17:56:03 +01:00
|
|
|
local fs_header, fs_p = "", ""
|
2017-01-29 14:05:35 +01:00
|
|
|
|
2018-02-16 17:56:03 +01:00
|
|
|
if fs_now["/home"].percentage >= 90 then
|
|
|
|
fs_header = " Hdd "
|
|
|
|
fs_p = fs_now["/home"].percentage
|
2017-01-29 14:05:35 +01:00
|
|
|
end
|
|
|
|
|
2018-02-16 17:56:03 +01:00
|
|
|
widget:set_markup(markup.font(theme.font, markup(gray, fs_header) .. markup(white, fs_p)))
|
2017-01-29 14:05:35 +01:00
|
|
|
end
|
|
|
|
})
|
2018-09-17 21:35:27 +02:00
|
|
|
--]]
|
2017-01-29 14:05:35 +01:00
|
|
|
|
|
|
|
-- ALSA volume bar
|
2017-02-08 14:16:12 +01:00
|
|
|
theme.volume = lain.widget.alsabar({
|
2017-01-29 14:05:35 +01:00
|
|
|
ticks = true, width = 67,
|
|
|
|
notification_preset = { font = theme.font }
|
|
|
|
})
|
2017-01-29 14:45:26 +01:00
|
|
|
theme.volume.tooltip.wibox.fg = theme.fg_focus
|
|
|
|
theme.volume.tooltip.wibox.font = theme.font
|
2018-02-02 12:17:33 +01:00
|
|
|
theme.volume.bar:buttons(my_table.join (
|
2017-01-29 14:45:26 +01:00
|
|
|
awful.button({}, 1, function()
|
2018-08-03 11:29:32 +02:00
|
|
|
awful.spawn(string.format("%s -e alsamixer", terminal))
|
2017-01-29 14:45:26 +01:00
|
|
|
end),
|
|
|
|
awful.button({}, 2, function()
|
2018-08-03 11:29:32 +02:00
|
|
|
os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel))
|
2017-01-29 14:45:26 +01:00
|
|
|
theme.volume.update()
|
|
|
|
end),
|
|
|
|
awful.button({}, 3, function()
|
2018-08-03 11:29:32 +02:00
|
|
|
os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel))
|
2017-01-29 14:45:26 +01:00
|
|
|
theme.volume.update()
|
|
|
|
end),
|
|
|
|
awful.button({}, 4, function()
|
2018-08-03 11:29:32 +02:00
|
|
|
os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel))
|
2017-01-29 14:45:26 +01:00
|
|
|
theme.volume.update()
|
|
|
|
end),
|
|
|
|
awful.button({}, 5, function()
|
2018-08-03 11:29:32 +02:00
|
|
|
os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel))
|
2017-01-29 14:45:26 +01:00
|
|
|
theme.volume.update()
|
|
|
|
end)
|
|
|
|
))
|
2017-01-29 14:05:35 +01:00
|
|
|
local volumebg = wibox.container.background(theme.volume.bar, "#585858", gears.shape.rectangle)
|
|
|
|
local volumewidget = wibox.container.margin(volumebg, 7, 7, 5, 5)
|
|
|
|
|
|
|
|
-- Weather
|
2017-02-08 14:16:12 +01:00
|
|
|
theme.weather = lain.widget.weather({
|
2017-01-29 14:05:35 +01:00
|
|
|
city_id = 2643743, -- placeholder (London)
|
|
|
|
notification_preset = { font = theme.font, fg = white }
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Separators
|
|
|
|
local first = wibox.widget.textbox(markup.font("Misc Tamsyn 4", " "))
|
|
|
|
local spr = wibox.widget.textbox(' ')
|
|
|
|
|
|
|
|
local function update_txt_layoutbox(s)
|
|
|
|
-- Writes a string representation of the current layout in a textbox widget
|
|
|
|
local txt_l = theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))] or ""
|
|
|
|
s.mytxtlayoutbox:set_text(txt_l)
|
|
|
|
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
|
2017-03-17 17:23:34 +01:00
|
|
|
local wallpaper = theme.wallpaper
|
|
|
|
if type(wallpaper) == "function" then
|
|
|
|
wallpaper = wallpaper(s)
|
2017-01-29 14:05:35 +01:00
|
|
|
end
|
2017-03-17 17:23:34 +01:00
|
|
|
gears.wallpaper.maximized(wallpaper, s, true)
|
2017-01-29 14:05:35 +01:00
|
|
|
|
|
|
|
-- Tags
|
|
|
|
awful.tag(awful.util.tagnames, s, awful.layout.layouts)
|
|
|
|
|
|
|
|
-- Create a promptbox for each screen
|
|
|
|
s.mypromptbox = awful.widget.prompt()
|
|
|
|
|
|
|
|
-- Textual layoutbox
|
|
|
|
s.mytxtlayoutbox = wibox.widget.textbox(theme["layout_txt_" .. awful.layout.getname(awful.layout.get(s))])
|
|
|
|
awful.tag.attached_connect_signal(s, "property::selected", function () update_txt_layoutbox(s) end)
|
|
|
|
awful.tag.attached_connect_signal(s, "property::layout", function () update_txt_layoutbox(s) end)
|
2018-02-02 12:17:33 +01:00
|
|
|
s.mytxtlayoutbox:buttons(my_table.join(
|
2017-02-04 17:54:12 +01:00
|
|
|
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)))
|
2017-01-29 14:05:35 +01:00
|
|
|
|
|
|
|
-- 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 = 18, 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,
|
2017-01-29 16:13:15 +01:00
|
|
|
first,
|
2017-01-29 14:05:35 +01:00
|
|
|
s.mytaglist,
|
|
|
|
spr,
|
|
|
|
s.mytxtlayoutbox,
|
|
|
|
--spr,
|
|
|
|
s.mypromptbox,
|
|
|
|
spr,
|
|
|
|
},
|
|
|
|
s.mytasklist, -- Middle widget
|
|
|
|
{ -- Right widgets
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
wibox.widget.systray(),
|
|
|
|
spr,
|
|
|
|
theme.mpd.widget,
|
2018-09-17 21:35:27 +02:00
|
|
|
--theme.mail.widget,
|
|
|
|
--theme.fs.widget,
|
2017-01-29 14:05:35 +01:00
|
|
|
volumewidget,
|
|
|
|
mytextclock,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-07-26 21:11:19 +02:00
|
|
|
return theme
|