1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-10-22 20:41:22 +00:00
awesome-copycats/themes/steamburn/theme.lua

279 lines
10 KiB
Lua
Raw Normal View History

2013-09-13 19:20:22 +00:00
--[[
Steamburn Awesome WM theme 3.0
2017-10-07 11:10:43 +00:00
github.com/lcpz
2013-09-13 19:20:22 +00:00
--]]
2017-01-29 15:13:15 +00:00
local gears = require("gears")
local lain = require("lain")
local awful = require("awful")
local wibox = require("wibox")
2019-03-02 18:05:33 +00:00
local dpi = require("beautiful.xresources").apply_dpi
local os = os
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
2017-01-15 15:23:09 +00:00
2017-01-29 15:13:15 +00:00
local theme = {}
2017-01-15 15:23:09 +00:00
theme.zenburn_dir = require("awful.util").get_themes_dir() .. "zenburn"
2017-01-29 15:13:15 +00:00
theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn"
theme.wallpaper = theme.dir .. "/wall.png"
2019-08-20 13:54:41 +00:00
theme.font = "Terminus 10.5"
2017-01-15 15:23:09 +00:00
theme.fg_normal = "#e2ccb0"
theme.fg_focus = "#d88166"
theme.fg_urgent = "#CC9393"
theme.bg_normal = "#140c0b"
theme.bg_focus = "#140c0b"
theme.bg_urgent = "#2a1f1e"
2019-03-02 18:05:33 +00:00
theme.border_width = dpi(1)
2017-01-15 15:23:09 +00:00
theme.border_normal = "#302627"
theme.border_focus = "#c2745b"
theme.border_marked = "#CC9393"
theme.taglist_fg_focus = "#d88166"
theme.tasklist_bg_focus = "#140c0b"
theme.tasklist_fg_focus = "#d88166"
2017-01-29 15:13:15 +00:00
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
2019-03-02 18:05:33 +00:00
theme.menu_height = dpi(16)
theme.menu_width = dpi(140)
2017-01-29 15:13:15 +00:00
theme.awesome_icon = theme.dir .."/icons/awesome.png"
theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
2017-01-15 15:23:09 +00:00
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.tasklist_plain_task_name = true
theme.tasklist_disable_icon = true
2019-03-02 18:05:33 +00:00
theme.useless_gap = dpi(0)
2017-01-15 15:23:09 +00:00
theme.titlebar_close_button_normal = theme.zenburn_dir.."/titlebar/close_normal.png"
theme.titlebar_close_button_focus = theme.zenburn_dir.."/titlebar/close_focus.png"
theme.titlebar_minimize_button_normal = theme.zenburn_dir.."/titlebar/minimize_normal.png"
theme.titlebar_minimize_button_focus = theme.zenburn_dir.."/titlebar/minimize_focus.png"
theme.titlebar_ontop_button_normal_inactive = theme.zenburn_dir.."/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive = theme.zenburn_dir.."/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = theme.zenburn_dir.."/titlebar/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_active = theme.zenburn_dir.."/titlebar/ontop_focus_active.png"
theme.titlebar_sticky_button_normal_inactive = theme.zenburn_dir.."/titlebar/sticky_normal_inactive.png"
theme.titlebar_sticky_button_focus_inactive = theme.zenburn_dir.."/titlebar/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_active = theme.zenburn_dir.."/titlebar/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_active = theme.zenburn_dir.."/titlebar/sticky_focus_active.png"
theme.titlebar_floating_button_normal_inactive = theme.zenburn_dir.."/titlebar/floating_normal_inactive.png"
theme.titlebar_floating_button_focus_inactive = theme.zenburn_dir.."/titlebar/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_active = theme.zenburn_dir.."/titlebar/floating_normal_active.png"
theme.titlebar_floating_button_focus_active = theme.zenburn_dir.."/titlebar/floating_focus_active.png"
theme.titlebar_maximized_button_normal_inactive = theme.zenburn_dir.."/titlebar/maximized_normal_inactive.png"
theme.titlebar_maximized_button_focus_inactive = theme.zenburn_dir.."/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_active = theme.zenburn_dir.."/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active = theme.zenburn_dir.."/titlebar/maximized_focus_active.png"
2013-03-27 21:48:14 +00:00
2014-01-09 13:33:33 +00:00
-- lain related
2017-01-15 15:23:09 +00:00
theme.layout_txt_termfair = "[termfair]"
theme.layout_txt_centerfair = "[centerfair]"
2014-01-09 13:33:33 +00:00
2017-01-29 15:13:15 +00:00
local markup = lain.util.markup
local gray = "#94928F"
-- Textclock
local mytextclock = wibox.widget.textclock(" %H:%M ")
mytextclock.font = theme.font
-- Calendar
2018-09-14 19:24:48 +00:00
theme.cal = lain.widget.cal({
2017-01-29 15:13:15 +00:00
attach_to = { mytextclock },
notification_preset = {
2019-08-20 13:54:41 +00:00
font = "Terminus 11",
2017-01-29 15:13:15 +00:00
fg = theme.fg_normal,
bg = theme.bg_normal
}
})
2018-09-17 19:35:27 +00:00
-- Mail IMAP check
--[[ to be set before use
2018-09-17 19:35:27 +00:00
theme.mail = lain.widget.imap({
2017-01-29 15:13:15 +00:00
timeout = 180,
server = "server",
mail = "mail",
password = "keyring get mail",
settings = function()
mail = ""
count = ""
if mailcount > 0 then
mail = "Mail "
count = mailcount .. " "
end
widget:set_markup(markup(gray, mail) .. count)
end
})
--]]
-- MPD
2017-02-08 13:16:12 +00:00
theme.mpd = lain.widget.mpd({
2017-01-29 15:13:15 +00:00
settings = function()
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) .. title))
end
})
-- CPU
2017-02-08 13:16:12 +00:00
local cpu = lain.widget.sysload({
2017-01-29 15:13:15 +00:00
settings = function()
widget:set_markup(markup.font(theme.font, markup(gray, " Cpu ") .. load_1 .. " "))
end
})
-- MEM
2017-02-08 13:16:12 +00:00
local mem = lain.widget.mem({
2017-01-29 15:13:15 +00:00
settings = function()
widget:set_markup(markup.font(theme.font, markup(gray, " Mem ") .. mem_now.used .. " "))
end
})
-- /home fs
2018-09-17 19:35:27 +00:00
--[[ commented because it needs Gio/Glib >= 2.54
2017-02-08 13:16:12 +00:00
theme.fs = lain.widget.fs({
2017-01-29 15:13:15 +00:00
partition = "/home",
2019-08-20 13:54:41 +00:00
notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Terminus 10.5" },
2017-01-29 15:13:15 +00:00
})
2018-09-17 19:35:27 +00:00
--]]
2017-01-29 15:13:15 +00:00
-- Battery
2017-02-08 13:16:12 +00:00
local bat = lain.widget.bat({
2017-01-29 15:13:15 +00:00
settings = function()
2017-06-23 09:56:47 +00:00
local perc = bat_now.perc
2018-07-25 10:45:34 +00:00
if bat_now.ac_status == 1 then perc = perc .. " Plug" end
2017-06-23 09:56:47 +00:00
widget:set_markup(markup.font(theme.font, markup(gray, " Bat ") .. perc .. " "))
2017-01-29 15:13:15 +00:00
end
})
-- Net checker
2017-02-08 13:16:12 +00:00
local net = lain.widget.net({
2017-01-29 15:13:15 +00:00
settings = function()
if net_now.state == "up" then net_state = "On"
else net_state = "Off" end
widget:set_markup(markup.font(theme.font, markup(gray, " Net ") .. net_state .. " "))
end
})
-- ALSA volume
2017-02-08 13:16:12 +00:00
theme.volume = lain.widget.alsa({
2017-01-29 15:13:15 +00:00
settings = function()
header = " Vol "
vlevel = volume_now.level
if volume_now.status == "off" then
vlevel = vlevel .. "M "
else
vlevel = vlevel .. " "
end
widget:set_markup(markup.font(theme.font, markup(gray, header) .. vlevel))
end
})
-- Weather
--[[ to be set before use
2017-02-08 13:16:12 +00:00
theme.weather = lain.widget.weather({
--APPID =
2017-01-29 15:13:15 +00:00
city_id = 2643743, -- placeholder (London)
})
--]]
2017-01-29 15:13:15 +00:00
-- Separators
2019-08-20 13:54:41 +00:00
local first = wibox.widget.textbox(markup.font("Terminus 4", " "))
2017-01-29 15:13:15 +00:00
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
local wallpaper = theme.wallpaper
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
2017-01-29 15:13:15 +00:00
end
gears.wallpaper.maximized(wallpaper, s, true)
2017-01-29 15:13:15 +00: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)
s.mytxtlayoutbox:buttons(my_table.join(
2017-02-04 16:54:12 +00:00
awful.button({}, 1, function() awful.layout.inc(1) end),
awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
2017-02-04 16:54:12 +00:00
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 15:13:15 +00: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
2019-03-02 18:05:33 +00:00
s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(18) })
2017-01-29 15:13:15 +00:00
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
first,
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 19:35:27 +00:00
--theme.mail.widget,
2017-01-29 15:13:15 +00:00
cpu.widget,
mem.widget,
bat.widget,
net.widget,
theme.volume.widget,
mytextclock
},
}
end
2013-03-27 12:49:37 +00:00
return theme