converted all colors to theme_config.lua; fixed and added some bugs; rewrote some stuff and added some
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -58,8 +57,8 @@ return function(s)
|
||||
id = "clearall"
|
||||
},
|
||||
id = "background4",
|
||||
fg = color["Grey900"],
|
||||
bg = color["Blue200"],
|
||||
fg = Theme_config.notification_center.clear_all_button.fg,
|
||||
bg = Theme_config.notification_center.clear_all_button.bg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 12)
|
||||
end,
|
||||
@@ -81,7 +80,7 @@ return function(s)
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = color["Grey700"],
|
||||
bg = Theme_config.notification_center.dnd.disabled,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
@@ -104,7 +103,7 @@ return function(s)
|
||||
{
|
||||
{
|
||||
widget = wibox.container.background,
|
||||
bg = color["Purple200"],
|
||||
bg = Theme_config.notification_center.dnd.border_enabled,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
@@ -131,8 +130,8 @@ return function(s)
|
||||
},
|
||||
active = false,
|
||||
widget = wibox.container.background,
|
||||
bg = color["Grey900"],
|
||||
border_color = color["Grey800"],
|
||||
bg = Theme_config.notification_center.dnd.bg,
|
||||
border_color = Theme_config.notification_center.dnd.border_disabled,
|
||||
border_width = dpi(2),
|
||||
forced_height = dpi(40),
|
||||
forced_width = dpi(80),
|
||||
@@ -148,13 +147,13 @@ return function(s)
|
||||
left_button.visible = true
|
||||
right_button.visible = false
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = color["Grey800"]
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_disabled
|
||||
User_config.dnd = false
|
||||
else
|
||||
left_button.visible = false
|
||||
right_button.visible = true
|
||||
toggle_button.active = not toggle_button.active
|
||||
toggle_button.border_color = color["Purple200"]
|
||||
toggle_button.border_color = Theme_config.notification_center.dnd.border_enabled
|
||||
User_config.dnd = true
|
||||
end
|
||||
end
|
||||
@@ -177,9 +176,9 @@ return function(s)
|
||||
id = "layout12"
|
||||
},
|
||||
id = "background4",
|
||||
fg = color["Pink200"],
|
||||
fg = Theme_config.notification_center.dnd.fg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 12)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
forced_height = dpi(40),
|
||||
widget = wibox.container.background
|
||||
@@ -227,9 +226,9 @@ return function(s)
|
||||
--#region Notification center
|
||||
local notification_center = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
bg = color["Grey900"],
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
bg = Theme_config.notification_center.bg,
|
||||
border_color = Theme_config.notification_center.border_color,
|
||||
border_width = Theme_config.notification_center.border_width,
|
||||
placement = function(c)
|
||||
awful.placement.top(c, { margins = dpi(10) })
|
||||
end,
|
||||
@@ -237,7 +236,7 @@ return function(s)
|
||||
screen = s,
|
||||
visible = false,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 12)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -295,8 +294,7 @@ return function(s)
|
||||
id = "yes",
|
||||
spacing_widget = {
|
||||
{
|
||||
fg = color["Grey800"],
|
||||
bg = color["Grey800"],
|
||||
bg = Theme_config.notification_center.spacing_color,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
top = dpi(40),
|
||||
@@ -365,7 +363,8 @@ return function(s)
|
||||
end
|
||||
)
|
||||
|
||||
Hover_signal(clear_all_widget, color["Blue200"], color["Grey900"])
|
||||
Hover_signal(clear_all_widget, Theme_config.notification_center.clear_all_button.bg,
|
||||
Theme_config.notification_center.clear_all_button.fg)
|
||||
--#endregion
|
||||
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -33,7 +32,7 @@ function nl.create_notification(n)
|
||||
id = "txt"
|
||||
},
|
||||
id = "background",
|
||||
fg = color["Teal200"],
|
||||
fg = Theme_config.notification_center.notification_list.timer_fg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
margins = dpi(10),
|
||||
@@ -81,7 +80,7 @@ function nl.create_notification(n)
|
||||
id = "arc_chart"
|
||||
},
|
||||
id = "background",
|
||||
fg = color["Teal200"],
|
||||
fg = Theme_config.notification_center.notification_list.close_color,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
strategy = "exact",
|
||||
@@ -108,7 +107,8 @@ function nl.create_notification(n)
|
||||
{
|
||||
{
|
||||
{
|
||||
image = gears.color.recolor_image(icondir .. "notification-outline.svg", color["Teal200"]),
|
||||
image = gears.color.recolor_image(icondir .. "notification-outline.svg",
|
||||
Theme_config.notification_center.notification_list.icon),
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
@@ -125,7 +125,7 @@ function nl.create_notification(n)
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
fg = color["Teal200"],
|
||||
fg = Theme_config.notification_center.notification_list.title_fg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
margins = dpi(10),
|
||||
@@ -141,8 +141,8 @@ function nl.create_notification(n)
|
||||
layout = wibox.layout.align.horizontal
|
||||
},
|
||||
id = "arc_app_bg",
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(2),
|
||||
border_color = Theme_config.notification_center.notification_list.title_border_color,
|
||||
border_width = Theme_config.notification_center.notification_list.title_border_width,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
@@ -211,12 +211,10 @@ function nl.create_notification(n)
|
||||
widget = wibox.container.constraint
|
||||
},
|
||||
pk = #nl.notification_list + 1,
|
||||
bg = color["Grey900"],
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 8)
|
||||
end,
|
||||
bg = Theme_config.notification_center.notification_list.notification_bg,
|
||||
border_color = Theme_config.notification_center.notification_list.notification_border_color,
|
||||
border_width = Theme_config.notification_center.notification_list.notification_border_width,
|
||||
shape = Theme_config.notification_center.notification_list.notification_shape,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
@@ -235,7 +233,8 @@ function nl.create_notification(n)
|
||||
end
|
||||
)
|
||||
|
||||
Hover_signal(close_widget.const.background, color["Grey900"], color["Teal200"])
|
||||
Hover_signal(close_widget.const.background, Theme_config.notification_center.notification_list.close_bg,
|
||||
Theme_config.notification_center.notification_list.close_color)
|
||||
|
||||
notification:connect_signal(
|
||||
"mouse::enter",
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -43,7 +42,8 @@ return function()
|
||||
{
|
||||
{ -- Username
|
||||
id = "username_prefix",
|
||||
image = gears.color.recolor_image(icondir .. "user.svg", color["Blue200"]),
|
||||
image = gears.color.recolor_image(icondir .. "user.svg",
|
||||
Theme_config.notification_center.profile.username_icon_color),
|
||||
valign = "center",
|
||||
halign = "left",
|
||||
resize = false,
|
||||
@@ -61,7 +61,8 @@ return function()
|
||||
{
|
||||
{
|
||||
id = "os_prefix",
|
||||
image = gears.color.recolor_image(icondir .. "laptop.svg", color["Blue200"]),
|
||||
image = gears.color.recolor_image(icondir .. "laptop.svg",
|
||||
Theme_config.notification_center.profile.os_prefix_icon_color),
|
||||
valign = "center",
|
||||
halign = "left",
|
||||
resize = false,
|
||||
@@ -79,7 +80,8 @@ return function()
|
||||
{
|
||||
{
|
||||
id = "kernel_prefix",
|
||||
image = gears.color.recolor_image(icondir .. "penguin.svg", color["Blue200"]),
|
||||
image = gears.color.recolor_image(icondir .. "penguin.svg",
|
||||
Theme_config.notification_center.profile.kernel_icon_color),
|
||||
valign = "center",
|
||||
halign = "left",
|
||||
resize = false,
|
||||
@@ -97,7 +99,8 @@ return function()
|
||||
{
|
||||
{
|
||||
id = "uptime_prefix",
|
||||
image = gears.color.recolor_image(icondir .. "clock.svg", color["Blue200"]),
|
||||
image = gears.color.recolor_image(icondir .. "clock.svg",
|
||||
Theme_config.notification_center.profile.uptime_icon_color),
|
||||
valign = "center",
|
||||
halign = "left",
|
||||
resize = false,
|
||||
@@ -129,12 +132,10 @@ return function()
|
||||
widget = wibox.layout.fixed.vertical
|
||||
},
|
||||
id = "wrapper",
|
||||
fg = color["Green200"],
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
fg = Theme_config.notification_center.profile.fg,
|
||||
border_color = Theme_config.notification_center.profile.border_color,
|
||||
border_width = Theme_config.notification_center.profile.border_width,
|
||||
shape = Theme_config.notification_center.profile.shape,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
id = "const",
|
||||
@@ -177,7 +178,6 @@ return function()
|
||||
profile_widget:get_children_by_id("username")[1].text = stdout:gsub("\n", "") or ""
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
-- function to fetch uptime async
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local naughty = require("naughty")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/notifications/"
|
||||
@@ -43,7 +41,8 @@ return function(s)
|
||||
|
||||
local shuffle_button = wibox.widget {
|
||||
resize = false,
|
||||
image = gears.color.recolor_image(icondir .. "shuffle.svg", color["Grey800"]),
|
||||
image = gears.color.recolor_image(icondir .. "shuffle.svg",
|
||||
Theme_config.notification_center.song_info.shuffle_disabled),
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
widget = wibox.widget.imagebox,
|
||||
@@ -55,10 +54,12 @@ return function(s)
|
||||
function(stdout)
|
||||
if stdout:match("On") then
|
||||
awful.spawn.with_shell("playerctl shuffle off")
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg", color["Grey800"])
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg",
|
||||
Theme_config.notification_center.song_info.shuffle_enabled)
|
||||
else
|
||||
awful.spawn.with_shell("playerctl shuffle on")
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg", color["Green200"])
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg",
|
||||
Theme_config.notification_center.song_info.shuffle_disabled)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -69,9 +70,11 @@ return function(s)
|
||||
"playerctl shuffle",
|
||||
function(stdout)
|
||||
if stdout:match("On") then
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg", color["Green200"])
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg",
|
||||
Theme_config.notification_center.song_info.shuffle_enabled)
|
||||
else
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg", color["Grey800"])
|
||||
shuffle_button.image = gears.color.recolor_image(icondir .. "shuffle.svg",
|
||||
Theme_config.notification_center.song_info.shuffle_disabled)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -81,7 +84,7 @@ return function(s)
|
||||
|
||||
local repeat_button = wibox.widget {
|
||||
resize = false,
|
||||
image = gears.color.recolor_image(icondir .. "repeat.svg", color["Grey800"]),
|
||||
image = gears.color.recolor_image(icondir .. "repeat.svg", Theme_config.notification_center.song_info.repeat_disabled),
|
||||
widget = wibox.widget.imagebox,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
@@ -95,11 +98,14 @@ return function(s)
|
||||
function(stdout)
|
||||
local loop_mode = stdout:gsub("\n", "")
|
||||
if loop_mode == "Track" then
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat-once.svg"), color["Green200"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat-once.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_single)
|
||||
elseif loop_mode == "None" then
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"), color["Grey800"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_disabled)
|
||||
elseif loop_mode == "Playlist" then
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"), color["Green200"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_all)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -114,7 +120,7 @@ return function(s)
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
image = gears.color.recolor_image(icondir .. "skip-prev.svg", color["Teal200"]),
|
||||
image = gears.color.recolor_image(icondir .. "skip-prev.svg", Theme_config.notification_center.song_info.prev_enabled),
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
|
||||
@@ -134,7 +140,8 @@ return function(s)
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
image = gears.color.recolor_image(icondir .. "play-pause.svg", color["Teal200"]),
|
||||
image = gears.color.recolor_image(icondir .. "play-pause.svg",
|
||||
Theme_config.notification_center.song_info.play_enabled),
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
|
||||
@@ -149,7 +156,7 @@ return function(s)
|
||||
resize = false,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
image = gears.color.recolor_image(icondir .. "skip-next.svg", color["Teal200"]),
|
||||
image = gears.color.recolor_image(icondir .. "skip-next.svg", Theme_config.notification_center.song_info.next_enabled),
|
||||
widget = wibox.widget.imagebox
|
||||
}
|
||||
|
||||
@@ -173,13 +180,16 @@ return function(s)
|
||||
local loop_mode = stdout:gsub("\n", "")
|
||||
if loop_mode == "None" then
|
||||
awful.spawn.with_shell("playerctl loop playlist")
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"), color["Green200"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_all)
|
||||
elseif loop_mode == "Playlist" then
|
||||
awful.spawn.with_shell("playerctl loop track")
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat-once.svg"), color["Green200"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat-once.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_single)
|
||||
elseif loop_mode == "Track" then
|
||||
awful.spawn.with_shell("playerctl loop none")
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"), color["Grey800"])
|
||||
repeat_button.image = gears.color.recolor_image(gears.surface.load_uncached(icondir .. "repeat.svg"),
|
||||
Theme_config.notification_center.song_info.repeat_disabled)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -187,9 +197,12 @@ return function(s)
|
||||
|
||||
repeat_button:buttons(gears.table.join(awful.button({}, 1, loop_handler)))
|
||||
|
||||
button_hover_effect(prev_button, "skip-prev.svg", color["Teal200"], color["Teal300"])
|
||||
button_hover_effect(pause_play_button, "play-pause.svg", color["Teal200"], color["Teal300"])
|
||||
button_hover_effect(next_button, "skip-next.svg", color["Teal200"], color["Teal300"])
|
||||
button_hover_effect(prev_button, "skip-prev.svg", Theme_config.notification_center.song_info.prev_enabled,
|
||||
Theme_config.notification_center.song_info.prev_hover)
|
||||
button_hover_effect(pause_play_button, "play-pause.svg", Theme_config.notification_center.song_info.play_enabled,
|
||||
Theme_config.notification_center.song_info.play_hover)
|
||||
button_hover_effect(next_button, "skip-next.svg", Theme_config.notification_center.song_info.next_enabled,
|
||||
Theme_config.notification_center.song_info.next_hover)
|
||||
|
||||
--#endregion
|
||||
|
||||
@@ -202,7 +215,7 @@ return function(s)
|
||||
{
|
||||
{ -- Album art
|
||||
{
|
||||
image = "default image",
|
||||
image = icondir .. "default_image.svg",
|
||||
resize = true,
|
||||
clip_shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
@@ -223,15 +236,16 @@ return function(s)
|
||||
{
|
||||
{
|
||||
{ --Title
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
align = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
id = "textbox4"
|
||||
},
|
||||
fg = color["Pink200"],
|
||||
fg = Theme_config.notification_center.song_info.title_fg,
|
||||
id = "textbox5",
|
||||
widget = wibox.container.background
|
||||
},
|
||||
id = "textbox_const",
|
||||
strategy = "max",
|
||||
width = dpi(400),
|
||||
widget = wibox.container.constraint
|
||||
@@ -250,7 +264,7 @@ return function(s)
|
||||
widget = wibox.widget.textbox,
|
||||
id = "textbox3"
|
||||
},
|
||||
fg = color["Teal200"],
|
||||
fg = Theme_config.notification_center.song_info.artist_fg,
|
||||
id = "background",
|
||||
widget = wibox.container.background
|
||||
},
|
||||
@@ -301,7 +315,7 @@ return function(s)
|
||||
widget = wibox.widget.textbox,
|
||||
id = "textbox2"
|
||||
},
|
||||
fg = color["Lime200"],
|
||||
fg = Theme_config.notification_center.song_info.duration_fg,
|
||||
widget = wibox.container.background,
|
||||
id = "background3"
|
||||
},
|
||||
@@ -311,8 +325,8 @@ return function(s)
|
||||
},
|
||||
{ -- Progressbar
|
||||
{
|
||||
color = color["Purple200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.song_info.progress_color,
|
||||
background_color = Theme_config.notification_center.song_info.progress_background_color,
|
||||
max_value = 100,
|
||||
value = 50,
|
||||
forced_height = dpi(5),
|
||||
@@ -335,7 +349,7 @@ return function(s)
|
||||
id = "text1"
|
||||
},
|
||||
id = "background2",
|
||||
fg = color["Lime200"],
|
||||
fg = Theme_config.notification_center.song_info.duration_fg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
id = "margin3",
|
||||
@@ -354,11 +368,9 @@ return function(s)
|
||||
margins = dpi(10)
|
||||
},
|
||||
id = "background1",
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(8))
|
||||
end,
|
||||
border_color = Theme_config.notification_center.song_info.border_color,
|
||||
border_width = Theme_config.notification_center.song_info.border_width,
|
||||
shape = Theme_config.notification_center.song_info.shape,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
id = "margin1",
|
||||
@@ -427,9 +439,12 @@ return function(s)
|
||||
function(stdout2)
|
||||
local length = stdout2:gsub("\n", "")
|
||||
if length ~= "" then
|
||||
local length_formated = string.format("%02d:%02d", math.floor(tonumber(length or 1) / 60000000) or 0, (math.floor(tonumber(length or 1) / 1000000) % 60) or 0)
|
||||
music_widget:get_children_by_id("progressbar1")[1].max_value = tonumber(math.floor(tonumber(length) / 1000000))
|
||||
music_widget:get_children_by_id("text1")[1].markup = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, Bold 14'>%s</span>", color["Teal200"], length_formated)
|
||||
local length_formated = string.format("%02d:%02d", math.floor(tonumber(length or 1) / 60000000) or 0,
|
||||
(math.floor(tonumber(length or 1) / 1000000) % 60) or 0)
|
||||
music_widget:get_children_by_id("progressbar1")[1].max_value = tonumber(math.floor(tonumber(length) /
|
||||
1000000))
|
||||
music_widget:get_children_by_id("text1")[1].markup = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, Bold 14'>%s</span>"
|
||||
, Theme_config.notification_center.song_info.duration_fg, length_formated)
|
||||
end
|
||||
end
|
||||
)
|
||||
@@ -442,7 +457,8 @@ return function(s)
|
||||
end
|
||||
)
|
||||
-- Update track id
|
||||
trackid, artist, title = stdout, music_widget:get_children_by_id("textbox3")[1].text, music_widget:get_children_by_id("textbox4")[1].text
|
||||
trackid, artist, title = stdout, music_widget:get_children_by_id("textbox3")[1].text,
|
||||
music_widget:get_children_by_id("textbox4")[1].text
|
||||
end
|
||||
)
|
||||
-- Always update the current song progression
|
||||
@@ -451,8 +467,10 @@ return function(s)
|
||||
function(stdout)
|
||||
local time = stdout:gsub("\n", "")
|
||||
if time ~= "" then
|
||||
local time_formated = string.format("%02d:%02d", math.floor(tonumber(time or "1") / 60), math.floor(tonumber(time or "1")) % 60)
|
||||
music_widget:get_children_by_id("textbox2")[1].markup = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, Bold 14'>%s</span>", color["Teal200"], time_formated)
|
||||
local time_formated = string.format("%02d:%02d", math.floor(tonumber(time or "1") / 60),
|
||||
math.floor(tonumber(time or "1")) % 60)
|
||||
music_widget:get_children_by_id("textbox2")[1].markup = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, Bold 14'>%s</span>"
|
||||
, Theme_config.notification_center.song_info.duration_fg, time_formated)
|
||||
music_widget:get_children_by_id("progressbar1")[1].value = tonumber(time)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
------------------------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local wibox = require("wibox")
|
||||
|
||||
@@ -12,7 +11,7 @@ return function()
|
||||
return wibox.widget {
|
||||
{
|
||||
forced_height = dpi(2),
|
||||
bg = color["Grey800"],
|
||||
bg = Theme_config.notification_center.spacing_line.color,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
left = dpi(80),
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -32,12 +31,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Blue200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.cpu_usage_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -56,7 +55,8 @@ return function()
|
||||
},
|
||||
{
|
||||
{ --Icon
|
||||
image = gears.color.recolor_image(icondir .. "cpu/cpu.svg", color["Cyan200"]),
|
||||
image = gears.color.recolor_image(icondir .. "cpu/cpu.svg",
|
||||
Theme_config.notification_center.status_bar.cpu_usage_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox,
|
||||
@@ -102,12 +102,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Blue200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.cpu_temp_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -127,7 +127,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "cpu/thermometer.svg", color["Cyan200"]),
|
||||
image = gears.color.recolor_image(icondir .. "cpu/thermometer.svg",
|
||||
Theme_config.notification_center.status_bar.cpu_temp_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -171,7 +172,8 @@ return function()
|
||||
elseif cpu_temp >= 80 then
|
||||
temp_icon = icondir .. "cpu/thermometer-high.svg"
|
||||
end
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(temp_icon, color["Blue200"])
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(temp_icon,
|
||||
Theme_config.notification_center.status_bar.cpu_temp_color)
|
||||
tooltip.text = "CPU Temp: " .. cpu_temp .. "°C"
|
||||
rubato_timer.target = cpu_temp
|
||||
end
|
||||
@@ -181,12 +183,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Red200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.ram_usage_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -205,7 +207,8 @@ return function()
|
||||
},
|
||||
{
|
||||
{ --Icon
|
||||
image = gears.color.recolor_image(icondir .. "cpu/ram.svg", color["Red200"]),
|
||||
image = gears.color.recolor_image(icondir .. "cpu/ram.svg",
|
||||
Theme_config.notification_center.status_bar.ram_usage_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -239,7 +242,10 @@ return function()
|
||||
|
||||
awesome.connect_signal(
|
||||
"update::ram_widget",
|
||||
function(MemTotal, MemFree, MemAvailable)
|
||||
function(MemTotal, _, MemAvailable)
|
||||
if not MemTotal or not MemAvailable then
|
||||
return
|
||||
end
|
||||
local ram_usage = math.floor(((MemTotal - MemAvailable) / MemTotal * 100) + 0.5)
|
||||
tooltip.text = "RAM Usage: " .. ram_usage .. "%"
|
||||
rubato_timer.target = ram_usage
|
||||
@@ -250,12 +256,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Green200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.gpu_usage_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -274,7 +280,8 @@ return function()
|
||||
},
|
||||
{
|
||||
{ --Icon
|
||||
image = gears.color.recolor_image(icondir .. "cpu/gpu.svg", color["Green200"]),
|
||||
image = gears.color.recolor_image(icondir .. "cpu/gpu.svg",
|
||||
Theme_config.notification_center.status_bar.gpu_usage_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -318,12 +325,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Green200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.gpu_temp_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -343,7 +350,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "cpu/thermometer.svg", color["Green200"]),
|
||||
image = gears.color.recolor_image(icondir .. "cpu/thermometer.svg",
|
||||
Theme_config.notification_center.status_bar.gpu_temp_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -395,7 +403,8 @@ return function()
|
||||
temp_num = "NaN"
|
||||
temp_icon = icondir .. "cpu/thermometer-low.svg"
|
||||
end
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(temp_icon, color["Green200"])
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(temp_icon,
|
||||
Theme_config.notification_center.status_bar.gpu_temp_color)
|
||||
tooltip.text = "GPU Temp: " .. temp_num .. "°C"
|
||||
rubato_timer.target = temp_num
|
||||
end
|
||||
@@ -405,12 +414,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Yellow200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.volume_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -430,7 +439,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "audio/volume-high.svg", color["Yellow200"]),
|
||||
image = gears.color.recolor_image(icondir .. "audio/volume-high.svg",
|
||||
Theme_config.notification_center.status_bar.volume_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -464,10 +474,25 @@ return function()
|
||||
}
|
||||
|
||||
awesome.connect_signal(
|
||||
"update::volume_widget",
|
||||
function(volume, volume_icon)
|
||||
--w:get_children_by_id("progressbar1")[1].value = volume
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(volume_icon, color["Yellow200"])
|
||||
"audio::get",
|
||||
function(muted, volume)
|
||||
local icon = icondir .. "audio/volume"
|
||||
volume = tonumber(volume)
|
||||
if muted then
|
||||
icon = icon .. "-mute"
|
||||
else
|
||||
if volume < 1 then
|
||||
icon = icon .. "-mute"
|
||||
elseif volume >= 1 and volume < 34 then
|
||||
icon = icon .. "-low"
|
||||
elseif volume >= 34 and volume < 67 then
|
||||
icon = icon .. "-medium"
|
||||
elseif volume >= 67 then
|
||||
icon = icon .. "-high"
|
||||
end
|
||||
end
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(icon .. ".svg",
|
||||
Theme_config.notification_center.status_bar.volume_color)
|
||||
tooltip.text = "Volume: " .. volume .. "%"
|
||||
rubato_timer.target = volume
|
||||
end
|
||||
@@ -477,12 +502,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Purple200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.microphone_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -502,7 +527,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "audio/microphone.svg", color["Purple200"]),
|
||||
image = gears.color.recolor_image(icondir .. "audio/microphone.svg",
|
||||
Theme_config.notification_center.status_bar.microphone_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -536,12 +562,17 @@ return function()
|
||||
}
|
||||
|
||||
awesome.connect_signal(
|
||||
"update::microphone_widget",
|
||||
function(microphone, microphone_icon)
|
||||
--w:get_children_by_id("progressbar1")[1].value = microphone
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(microphone_icon, color["Purple200"])
|
||||
tooltip.text = "Microphone: " .. microphone .. "%"
|
||||
rubato_timer.target = microphone
|
||||
"microphone::get",
|
||||
function(muted, volume)
|
||||
local icon = icondir .. "audio/microphone"
|
||||
volume = tonumber(volume)
|
||||
if muted or (volume < 1) then
|
||||
icon = icon .. "-off"
|
||||
end
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(icon .. ".svg",
|
||||
Theme_config.notification_center.status_bar.microphone_color)
|
||||
tooltip.text = "Microphone: " .. volume .. "%"
|
||||
rubato_timer.target = volume
|
||||
end
|
||||
)
|
||||
elseif widget == "backlight" then
|
||||
@@ -549,12 +580,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Pink200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.backlight_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -574,7 +605,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "brightness/brightness-high.svg", color["Pink200"]),
|
||||
image = gears.color.recolor_image(icondir .. "brightness/brightness-high.svg" .. ".svg",
|
||||
Theme_config.notification_center.status_bar.backlight_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -610,8 +642,8 @@ return function()
|
||||
awesome.connect_signal(
|
||||
"update::backlight",
|
||||
function(backlight, backlight_icon)
|
||||
--w:get_children_by_id("progressbar1")[1].value = backlight
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(backlight_icon, color["Pink200"])
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(backlight_icon,
|
||||
Theme_config.notification_center.status_bar.backlight_color)
|
||||
tooltip.text = "Backlight: " .. backlight .. "%"
|
||||
rubato_timer.target = backlight
|
||||
end
|
||||
@@ -621,12 +653,12 @@ return function()
|
||||
{
|
||||
{
|
||||
{ --Bar
|
||||
color = color["Purple200"],
|
||||
background_color = color["Grey800"],
|
||||
color = Theme_config.notification_center.status_bar.battery_color,
|
||||
background_color = Theme_config.notification_center.status_bar.bar_bg_color,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
forced_height = dpi(8),
|
||||
shape = function(cr, width, heigth)
|
||||
shape = function(cr)
|
||||
gears.shape.rounded_bar(cr, dpi(58), dpi(8))
|
||||
end,
|
||||
id = "progressbar1",
|
||||
@@ -646,7 +678,8 @@ return function()
|
||||
{
|
||||
{ --Icon
|
||||
id = "icon1",
|
||||
image = gears.color.recolor_image(icondir .. "battery/battery.svg", color["Purple200"]),
|
||||
image = gears.color.recolor_image(icondir .. "battery/battery.svg",
|
||||
Theme_config.notification_center.status_bar.battery_color),
|
||||
halign = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.imagebox
|
||||
@@ -682,8 +715,8 @@ return function()
|
||||
awesome.connect_signal(
|
||||
"update::battery_widget",
|
||||
function(battery, battery_icon)
|
||||
--w:get_children_by_id("progressbar1")[1].value = battery
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(battery_icon, color["Purple200"])
|
||||
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(battery_icon,
|
||||
Theme_config.notification_center.status_bar.battery_color)
|
||||
tooltip.text = "Battery: " .. battery .. "%"
|
||||
rubato_timer.target = battery
|
||||
end
|
||||
@@ -714,11 +747,9 @@ return function()
|
||||
},
|
||||
forced_height = dpi(120),
|
||||
forced_width = dpi(500),
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(10))
|
||||
end,
|
||||
border_color = Theme_config.notification_center.status_bar.border_color,
|
||||
border_width = Theme_config.notification_center.status_bar.border_width,
|
||||
shape = Theme_config.notification_center.status_bar.shape,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
top = dpi(10),
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
@@ -66,20 +65,21 @@ return function()
|
||||
widget = wibox.widget.textbox,
|
||||
id = "description"
|
||||
},
|
||||
fg = color["LightBlue200"],
|
||||
fg = Theme_config.notification_center.weather.description_fg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{ -- line
|
||||
forced_height = dpi(4),
|
||||
forced_width = dpi(10),
|
||||
bg = color["Grey800"],
|
||||
bg = Theme_config.notification_center.weather.line_bg,
|
||||
widget = wibox.container.background,
|
||||
id = "line"
|
||||
},
|
||||
{
|
||||
{ -- Speed
|
||||
{
|
||||
image = gears.color.recolor_image(icondir .. "weather-windy.svg", color["OrangeA200"]),
|
||||
image = gears.color.recolor_image(icondir .. "weather-windy.svg",
|
||||
Theme_config.notification_center.weather.speed_icon_color),
|
||||
resize = true,
|
||||
forced_width = dpi(24),
|
||||
forced_height = dpi(24),
|
||||
@@ -111,7 +111,8 @@ return function()
|
||||
widget = wibox.widget.imagebox,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
image = gears.color.recolor_image(icondir .. "humidity.svg", color["OrangeA200"]),
|
||||
image = gears.color.recolor_image(icondir .. "humidity.svg",
|
||||
Theme_config.notification_center.weather.humidity_icon_color),
|
||||
id = "humidity_icon"
|
||||
},
|
||||
{
|
||||
@@ -142,11 +143,9 @@ return function()
|
||||
widget = wibox.container.place
|
||||
},
|
||||
id = "background",
|
||||
border_color = color["Grey800"],
|
||||
border_width = dpi(4),
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(12))
|
||||
end,
|
||||
border_color = Theme_config.notification_center.weather.border_color,
|
||||
border_width = Theme_config.notification_center.weather.border_width,
|
||||
shape = Theme_config.notification_center.weather.shape,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
id = "margin",
|
||||
@@ -200,7 +199,7 @@ return function()
|
||||
weather_widget:get_children_by_id("city_country")[1].text = city .. ", " .. country
|
||||
weather_widget:get_children_by_id("description")[1].text = description:sub(1, 1):upper() ..
|
||||
description:sub(2)
|
||||
weather_widget:get_children_by_id("line")[1].bg = color["Grey800"]
|
||||
weather_widget:get_children_by_id("line")[1].bg = Theme_config.notification_center.weather.line_color
|
||||
weather_widget:get_children_by_id("speed")[1].text = speed .. " m/s"
|
||||
weather_widget:get_children_by_id("humidity")[1].text = humidity .. "%"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user