mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-01-27 10:47:13 +08:00
evil daemon system, dependency list update, README improvements.
Former-commit-id: db310f8e49
Former-commit-id: 4f25f9200c3ac9f9385daca5a68378249ff0329e
Former-commit-id: 69fa3954e5738446a59b409b7e326233e7c3ef55
Former-commit-id: 673176f7857e39f3455f4ccb426eef2789c0e891
54 lines
1.3 KiB
Lua
54 lines
1.3 KiB
Lua
local gears = require("gears")
|
|
local wibox = require("wibox")
|
|
local beautiful = require("beautiful")
|
|
|
|
-- Set colors
|
|
local title_color = beautiful.mpd_song_title_color or beautiful.wibar_fg
|
|
local artist_color = beautiful.mpd_song_artist_color or beautiful.wibar_fg
|
|
local paused_color = beautiful.mpd_song_paused_color or beautiful.normal_fg
|
|
|
|
local mpd_title = wibox.widget{
|
|
text = "---------",
|
|
align = "center",
|
|
valign = "center",
|
|
widget = wibox.widget.textbox
|
|
}
|
|
|
|
local mpd_artist = wibox.widget{
|
|
text = "---------",
|
|
align = "center",
|
|
valign = "center",
|
|
widget = wibox.widget.textbox
|
|
}
|
|
|
|
-- Main widget
|
|
local mpd_song = wibox.widget{
|
|
mpd_title,
|
|
mpd_artist,
|
|
layout = wibox.layout.fixed.vertical
|
|
}
|
|
|
|
local artist_fg
|
|
local artist_bg
|
|
awesome.connect_signal("evil::mpd", function(artist, title, status)
|
|
if status == "paused" then
|
|
artist_fg = paused_color
|
|
title_fg = paused_color
|
|
else
|
|
artist_fg = artist_color
|
|
title_fg = title_color
|
|
end
|
|
|
|
-- Escape &'s
|
|
title = string.gsub(title, "&", "&")
|
|
artist = string.gsub(artist, "&", "&")
|
|
|
|
mpd_title.markup =
|
|
"<span foreground='" .. title_fg .."'>"
|
|
.. title .. "</span>"
|
|
mpd_artist.markup =
|
|
"<span foreground='" .. artist_fg .."'>"
|
|
.. artist .. "</span>"
|
|
end)
|
|
|
|
return mpd_song
|