1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2026-03-23 05:55:12 +00:00

vertex personal theme

This commit is contained in:
Toma Adrian Ionut 2022-10-02 00:58:42 +03:00
parent 82636a6081
commit 81fc4af0d7
3 changed files with 320 additions and 210 deletions

BIN
themes/vertex/icons/cpu.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

BIN
themes/vertex/icons/mem.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

View file

@ -3,9 +3,7 @@
Vertex Awesome WM theme Vertex Awesome WM theme
github.com/lcpz github.com/lcpz
--]] --]] local gears = require("gears")
local gears = require("gears")
local lain = require("lain") local lain = require("lain")
local awful = require("awful") local awful = require("awful")
local wibox = require("wibox") local wibox = require("wibox")
@ -105,14 +103,17 @@ theme.titlebar_maximized_button_focus_inactive = theme.default_dir.."/titlebar/
theme.titlebar_maximized_button_normal_active = theme.default_dir .. "/titlebar/maximized_normal_active.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" theme.titlebar_maximized_button_focus_active = theme.default_dir .. "/titlebar/maximized_focus_active.png"
theme.widget_cpu = theme.icon_dir .. "/cpu.png"
theme.widget_mem = theme.icon_dir .. "/mem.png"
-- http://fontawesome.io/cheatsheet -- http://fontawesome.io/cheatsheet
awful.util.tagnames = { "", "", "", "", "", "", "", "" } awful.util.tagnames = {"", "", "", "", ""}
local markup = lain.util.markup local markup = lain.util.markup
-- Clock -- Clock
-- os.setlocale(os.getenv("LANG")) -- to localize the clock -- os.setlocale(os.getenv("LANG")) -- to localize the clock
local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "%a %d %b, %H:%M")) local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "| %a %d %b | %H:%M |"))
mytextclock.font = theme.font mytextclock.font = theme.font
theme.cal = lain.widget.cal({ theme.cal = lain.widget.cal({
attach_to = {mytextclock}, attach_to = {mytextclock},
@ -131,11 +132,12 @@ local battooltip = awful.tooltip({
margin_leftright = dpi(15), margin_leftright = dpi(15),
margin_topbottom = dpi(12) margin_topbottom = dpi(12)
}) })
battooltip.wibox.fg = theme.fg_normal battooltip.wibox.fg = "#fcfbf7"
battooltip.wibox.widget.bg = "#404040"
battooltip.textbox.font = theme.font battooltip.textbox.font = theme.font
battooltip.timeout = 0 battooltip.timeout = 0
battooltip:set_shape(function(cr, width, height) battooltip:set_shape(function(cr, width, height)
gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, width - dpi(35)) gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, 8)
end) end)
local bat = lain.widget.bat({ local bat = lain.widget.bat({
settings = function() settings = function()
@ -165,29 +167,32 @@ local bat = lain.widget.bat({
}) })
-- MPD -- MPD
theme.mpd = lain.widget.mpd({ -- theme.mpd = lain.widget.mpd({
music_dir = "/mnt/storage/Downloads/Music", -- music_dir = "/mnt/storage/Downloads/Music",
settings = function() -- settings = function()
if mpd_now.state == "play" then -- if mpd_now.state == "play" then
title = mpd_now.title -- title = mpd_now.title
artist = " " .. mpd_now.artist .. " " -- artist = " " .. mpd_now.artist .. " "
elseif mpd_now.state == "pause" then -- elseif mpd_now.state == "pause" then
title = "mpd " -- title = "mpd "
artist = "paused " -- artist = "paused "
else -- else
title = "" -- title = ""
artist = "" -- artist = ""
end -- end
widget:set_markup(markup.font(theme.font, title .. markup(theme.fg_focus, artist))) -- widget:set_markup(markup.font(theme.font, title .. markup(theme.fg_focus, artist)))
end -- end
}) -- })
-- ALSA volume -- ALSA volume
local volicon = wibox.widget.imagebox() local volicon = wibox.widget.imagebox()
theme.volume = lain.widget.alsabar({ theme.volume = lain.widget.alsabar({
-- togglechannel = "IEC958,3", -- togglechannel = "IEC958,3",
notification_preset = { font = "Monospace 12", fg = theme.fg_normal }, notification_preset = {
font = "Monospace 12",
fg = theme.fg_normal
},
settings = function() settings = function()
local index, perc = "", tonumber(volume_now.level) or 0 local index, perc = "", tonumber(volume_now.level) or 0
@ -208,45 +213,73 @@ theme.volume = lain.widget.alsabar({
volicon:set_image(theme[index]) volicon:set_image(theme[index])
end end
}) })
volicon:buttons(my_table.join ( volicon:buttons(my_table.join(awful.button({}, 1, function()
awful.button({}, 1, function()
awful.spawn(string.format("%s -e alsamixer", awful.util.terminal)) awful.spawn(string.format("%s -e alsamixer", awful.util.terminal))
end), end), awful.button({}, 2, function()
awful.button({}, 2, function()
os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel))
theme.volume.notify() theme.volume.notify()
end), end), awful.button({}, 3, function()
awful.button({}, 3, function()
os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel))
theme.volume.notify() theme.volume.notify()
end), end), awful.button({}, 4, function()
awful.button({}, 4, function() os.execute(string.format("%s set %s 5%%+", theme.volume.cmd, theme.volume.channel))
os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel))
theme.volume.notify() theme.volume.notify()
end), end), awful.button({}, 5, function()
awful.button({}, 5, function() os.execute(string.format("%s set %s 5%%-", theme.volume.cmd, theme.volume.channel))
os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel))
theme.volume.notify() theme.volume.notify()
end) end)))
))
-- MEM
function round_one_decimal(num)
return math.floor(num * 10) / 10
end
local memicon = wibox.widget.imagebox(theme.widget_mem)
local mem = lain.widget.mem({
settings = function()
local mem_used = mem_now.used
if mem_used >= 1000 then
mem_used = round_one_decimal(mem_used / 1000)
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " Gb "))
else
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " MB "))
end
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
})
-- Network
local net = lain.widget.net({
settings = function()
widget:set_markup(markup.font(theme.font,
markup("#7AC82E", " " .. string.format("%06.1f", net_now.received)) .. " " ..
markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " ")))
end
})
-- Wifi carrier and signal strength -- Wifi carrier and signal strength
local wificon = wibox.widget.imagebox(theme.wifidisc) local wificon = wibox.widget.imagebox(theme.wifidisc)
local wifitooltip = awful.tooltip({ -- local wifitooltip = awful.tooltip({
objects = { wificon }, -- objects = {wificon},
margin_leftright = dpi(15), -- margin_leftright = dpi(15),
margin_topbottom = dpi(15) -- margin_topbottom = dpi(15)
}) -- })
wifitooltip.wibox.fg = theme.fg_normal -- wifitooltip.wibox.fg = theme.fg_normal
wifitooltip.textbox.font = theme.font -- wifitooltip.textbox.font = theme.font
wifitooltip.timeout = 0 -- wifitooltip.timeout = 0
wifitooltip:set_shape(function(cr, width, height) -- wifitooltip:set_shape(function(cr, width, height)
gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, width - dpi(120)) -- gears.shape.infobubble(cr, width, height, corner_radius, arrow_size, width - dpi(120))
end) -- end)
local mywifisig = awful.widget.watch( local mywifisig = awful.widget.watch({awful.util.shell, "-c",
{ awful.util.shell, "-c", "awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link" }, "awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link"},
2, 2, function(widget, stdout)
function(widget, stdout)
local carrier, perc = stdout:match("(%d)-(%d+)") local carrier, perc = stdout:match("(%d)-(%d+)")
local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "") local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "")
perc = tonumber(perc) perc = tonumber(perc)
@ -268,9 +301,10 @@ local mywifisig = awful.widget.watch(
end end
wifitooltip:set_markup(tiptext) wifitooltip:set_markup(tiptext)
end end
end end)
) -- wificon:connect_signal("button::press", function()
wificon:connect_signal("button::press", function() awful.spawn(string.format("%s -e wavemon", awful.util.terminal)) end) -- awful.spawn(string.format("%s -e wavemon", awful.util.terminal))
-- end)
-- Weather -- Weather
--[[ to be set before use --[[ to be set before use
@ -285,8 +319,12 @@ theme.weather = lain.widget.weather({
--]] --]]
-- Launcher -- Launcher
local mylauncher = awful.widget.button({image = theme.awesome_icon}) -- local mylauncher = awful.widget.button({
mylauncher:connect_signal("button::press", function() awful.util.mymainmenu:toggle() end) -- image = theme.awesome_icon
-- })
-- mylauncher:connect_signal("button::press", function()
-- awful.util.mymainmenu:toggle()
-- end)
-- Separators -- Separators
local space = wibox.widget.textbox(" ") local space = wibox.widget.textbox(" ")
@ -328,9 +366,20 @@ end
function theme.vertical_wibox(s) function theme.vertical_wibox(s)
-- Create the vertical wibox -- Create the vertical wibox
s.dockheight = (35 * s.workarea.height)/100 s.dockheight = (21.5 * s.workarea.height) / 100
s.myleftwibox = wibox({ screen = s, x=0, y=s.workarea.height/2 - s.dockheight/2, width = dpi(6), height = s.dockheight, fg = theme.fg_normal, bg = barcolor2, ontop = true, visible = true, type = "dock" }) s.myleftwibox = wibox({
screen = s,
x = 0,
y = s.workarea.height / 2 - s.dockheight / 2,
width = dpi(6),
height = s.dockheight,
fg = theme.fg_normal,
bg = barcolor2,
ontop = true,
visible = true,
type = "dock"
})
if s.index > 1 and s.myleftwibox.y == 0 then if s.index > 1 and s.myleftwibox.y == 0 then
s.myleftwibox.y = screen[1].myleftwibox.y s.myleftwibox.y = screen[1].myleftwibox.y
@ -343,19 +392,21 @@ function theme.vertical_wibox(s)
layout = wibox.layout.fixed.vertical, layout = wibox.layout.fixed.vertical,
lspace1, lspace1,
s.mytaglist, s.mytaglist,
lspace2, lspace2
s.layoutb, -- s.layoutb,
wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)), -- wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)),
}, }
} }
-- Add toggling functionalities -- Add toggling functionalities
s.docktimer = gears.timer{ timeout = 2 } s.docktimer = gears.timer {
timeout = 2
}
s.docktimer:connect_signal("timeout", function() s.docktimer:connect_signal("timeout", function()
local s = awful.screen.focused() local s = awful.screen.focused()
s.myleftwibox.width = dpi(9) s.myleftwibox.width = dpi(9)
s.layoutb.visible = false -- s.layoutb.visible = false
mylauncher.visible = false -- mylauncher.visible = false
if s.docktimer.started then if s.docktimer.started then
s.docktimer:stop() s.docktimer:stop()
end end
@ -363,8 +414,8 @@ function theme.vertical_wibox(s)
tag.connect_signal("property::selected", function(t) tag.connect_signal("property::selected", function(t)
local s = t.screen or awful.screen.focused() local s = t.screen or awful.screen.focused()
s.myleftwibox.width = dpi(38) s.myleftwibox.width = dpi(38)
s.layoutb.visible = true -- s.layoutb.visible = true
mylauncher.visible = true -- mylauncher.visible = true
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
if not s.docktimer.started then if not s.docktimer.started then
s.docktimer:start() s.docktimer:start()
@ -374,30 +425,32 @@ function theme.vertical_wibox(s)
s.myleftwibox:connect_signal("mouse::leave", function() s.myleftwibox:connect_signal("mouse::leave", function()
local s = awful.screen.focused() local s = awful.screen.focused()
s.myleftwibox.width = dpi(9) s.myleftwibox.width = dpi(9)
s.layoutb.visible = false -- s.layoutb.visible = false
mylauncher.visible = false -- mylauncher.visible = false
end) end)
s.myleftwibox:connect_signal("mouse::enter", function() s.myleftwibox:connect_signal("mouse::enter", function()
local s = awful.screen.focused() local s = awful.screen.focused()
s.myleftwibox.width = dpi(38) s.myleftwibox.width = dpi(38)
s.layoutb.visible = true -- s.layoutb.visible = true
mylauncher.visible = true -- mylauncher.visible = true
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape) gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
end) end)
end end
function theme.at_screen_connect(s) function theme.at_screen_connect(s)
-- Quake application -- Quake application
s.quake = lain.util.quake({ app = awful.util.terminal, border = theme.border_width }) s.quake = lain.util.quake({
app = awful.util.terminal,
border = theme.border_width
})
-- If wallpaper is a function, call it with the screen -- If wallpaper is a function, call it with the screen
local wallpaper = theme.wallpaper -- local wallpaper = theme.wallpaper
if type(wallpaper) == "function" then -- if type(wallpaper) == "function" then
wallpaper = wallpaper(s) -- wallpaper = wallpaper(s)
end -- end
gears.wallpaper.maximized(wallpaper, s, true) -- gears.wallpaper.maximized(wallpaper, s, true)
-- Tags -- Tags
awful.tag(awful.util.tagnames, s, awful.layout.layouts[1]) awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
@ -409,12 +462,17 @@ function theme.at_screen_connect(s)
-- Create an imagebox widget which will contains an icon indicating which layout we're using. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen. -- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(my_table.join( s.mylayoutbox:buttons(my_table.join(awful.button({}, 1, function()
awful.button({}, 1, function () awful.layout.inc( 1) end), awful.layout.inc(1)
awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end), end), awful.button({}, 2, function()
awful.button({}, 3, function () awful.layout.inc(-1) end), awful.layout.set(awful.layout.layouts[1])
awful.button({}, 4, function () awful.layout.inc( 1) end), end), awful.button({}, 3, function()
awful.button({}, 5, function () awful.layout.inc(-1) end))) awful.layout.inc(-1)
end), awful.button({}, 4, function()
awful.layout.inc(1)
end), awful.button({}, 5, function()
awful.layout.inc(-1)
end)))
s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3)) s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3))
-- Create a taglist widget -- Create a taglist widget
@ -427,10 +485,27 @@ function theme.at_screen_connect(s)
}, nil, wibox.layout.fixed.vertical()) }, nil, wibox.layout.fixed.vertical())
-- Create a tasklist widget -- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.focused, awful.util.tasklist_buttons, { bg_focus = "#00000000" }) s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons, {
bg_focus = theme.panelbg,
bg_normal = theme.panelbg
})
-- Create the wibox -- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(25), bg = gears.color.create_png_pattern(theme.panelbg) }) s.mywibox = awful.wibar({
position = "top",
screen = s,
height = dpi(25),
bg = gears.color.create_png_pattern(theme.panelbg)
})
-- LogOut widget
local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu")
-- BrightnessWidget
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
-- Weatherwidget
local weather_widget = require("awesome-wm-widgets.weather-widget.weather")
-- Add widgets to the wibox -- Add widgets to the wibox
s.mywibox:setup{ s.mywibox:setup{
@ -438,9 +513,12 @@ function theme.at_screen_connect(s)
expand = "none", expand = "none",
{ -- Left widgets { -- Left widgets
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
rspace0,
s.layoutb,
rspace1,
s.mypromptbox, s.mypromptbox,
tspace1, tspace1,
s.mytasklist, s.mytasklist
}, },
{ -- Middle widgets { -- Middle widgets
layout = wibox.layout.flex.horizontal, layout = wibox.layout.flex.horizontal,
@ -449,19 +527,51 @@ function theme.at_screen_connect(s)
}, },
{ -- Right widgets { -- Right widgets
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal }, -- wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal },
rspace0, rspace0,
-- theme.weather.icon, -- theme.weather.icon,
-- theme.weather.widget, -- theme.weather.widget,
rspace1, wibox.widget.systray(),
rspace0,
wificon, wificon,
-- rspace0,
net.widget,
rspace0,
cpuicon,
cpu.widget,
rspace0,
memicon,
mem.widget,
rspace0,
weather_widget({
api_key = 'aeec45216dbe6d619167d2e9c9380fd7',
coordinates = {45.95, 24.14},
time_format_12h = true,
units = 'metric',
both_units_widget = true,
font_name = 'Carter One',
icons = 'VitalyGorbachev',
icons_extension = '.svg',
show_hourly_forecast = true,
show_daily_forecast = true
}),
rspace0,
brightness_widget({
type = 'icon_and_text',
program = 'light',
step = 10,
base = 20
}),
rspace0, rspace0,
volicon, volicon,
rspace2, rspace0,
baticon, baticon,
rspace3, rspace0,
wibox.widget.systray(), logout_menu_widget({
}, font = theme.font
}),
rspace0
}
} }
gears.timer.delayed_call(theme.vertical_wibox, s) gears.timer.delayed_call(theme.vertical_wibox, s)