Update with mpris, Macchiato catppuccin colors and awesome_switcher
This commit is contained in:
parent
64e9b9a3cb
commit
8d5ee408cf
22 changed files with 1038 additions and 79 deletions
75
src/widgets/mpris.lua
Normal file
75
src/widgets/mpris.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
---------------------------------
|
||||
-- This is the mPris2 widget --
|
||||
---------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local color = require("src.theme.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local watch = awful.widget.watch
|
||||
local wibox = require("wibox")
|
||||
require("src.core.signals")
|
||||
|
||||
-- Icon directory path
|
||||
local icon_dir = awful.util.getdir("config") .. "src/assets/icons/mpris/"
|
||||
|
||||
-- Returns the mPris widget
|
||||
return function()
|
||||
|
||||
local mpris_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
-- {
|
||||
-- {
|
||||
-- {
|
||||
-- id = "icon",
|
||||
-- widget = wibox.widget.imagebox,
|
||||
-- image = gears.color.recolor_image(icon_dir .. "cd.svg", color["Grey900"]),
|
||||
-- resize = false
|
||||
-- },
|
||||
-- id = "icon_layout",
|
||||
-- widget = wibox.container.place
|
||||
-- },
|
||||
-- top = dpi(2),
|
||||
-- widget = wibox.container.margin,
|
||||
-- id = "icon_margin"
|
||||
-- },
|
||||
-- spacing = dpi(10),
|
||||
{
|
||||
id = "label",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
font = "UbuntuMono Nerd Font, Bold",
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
id = "mpris_layout",
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color["Orange200"],
|
||||
fg = color["Grey900"],
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
Hover_signal(mpris_widget, color["Orange200"], color["Grey900"])
|
||||
|
||||
watch(
|
||||
[[ bash -c "$HOME/.config/awesome/bin/get_mpris_status_hide_album.sh" ]],
|
||||
5,
|
||||
function(_, stdout)
|
||||
mpris_widget.container.mpris_layout.label.text = stdout:gsub("\n", "")
|
||||
awesome.emit_signal("update::mpris_widget", tostring(stdout))
|
||||
end
|
||||
)
|
||||
|
||||
return mpris_widget
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue