mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-22 19:22:32 +00:00
steamburn: added automatic mpd notification
This commit is contained in:
parent
24689086bc
commit
032745d7b2
|
@ -3,7 +3,7 @@
|
||||||
-- Steamburn Awesome WM 3.5.+ config --
|
-- Steamburn Awesome WM 3.5.+ config --
|
||||||
-- github.com/copycat-killer --
|
-- github.com/copycat-killer --
|
||||||
-- -
|
-- -
|
||||||
--[[ ]--
|
--[[ ]]--
|
||||||
|
|
||||||
|
|
||||||
-- Required Libraries
|
-- Required Libraries
|
||||||
|
@ -19,7 +19,7 @@ vicious = require("vicious")
|
||||||
scratch = require("scratch")
|
scratch = require("scratch")
|
||||||
|
|
||||||
|
|
||||||
-- Autostart function
|
-- Run once function
|
||||||
|
|
||||||
function run_once(cmd)
|
function run_once(cmd)
|
||||||
findme = cmd
|
findme = cmd
|
||||||
|
@ -30,6 +30,7 @@ function run_once(cmd)
|
||||||
awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
|
awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- autostart applications
|
||||||
run_once("urxvtd")
|
run_once("urxvtd")
|
||||||
run_once("unclutter -idle 10")
|
run_once("unclutter -idle 10")
|
||||||
|
|
||||||
|
@ -334,13 +335,16 @@ mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.uti
|
||||||
-- Mpd widget
|
-- Mpd widget
|
||||||
mpdwidget = wibox.widget.textbox()
|
mpdwidget = wibox.widget.textbox()
|
||||||
mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end)))
|
mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end)))
|
||||||
|
curr_track = nil
|
||||||
vicious.register(mpdwidget, vicious.widgets.mpd,
|
vicious.register(mpdwidget, vicious.widgets.mpd,
|
||||||
function(widget, args)
|
function(widget, args)
|
||||||
-- play
|
|
||||||
if (args["{state}"] == "Play") then
|
if (args["{state}"] == "Play") then
|
||||||
|
if( args["{Title}"] ~= curr_track )
|
||||||
|
then
|
||||||
|
curr_track = args["{Title}"]
|
||||||
|
run_once("mpdinfo")
|
||||||
|
end
|
||||||
return gray .. args["{Title}"] .. coldef .. white .. " " .. args["{Artist}"] .. coldef
|
return gray .. args["{Title}"] .. coldef .. white .. " " .. args["{Artist}"] .. coldef
|
||||||
-- pause
|
|
||||||
elseif (args["{state}"] == "Pause") then
|
elseif (args["{state}"] == "Pause") then
|
||||||
return gray .. "mpd " .. coldef .. white .. "in pausa" .. coldef
|
return gray .. "mpd " .. coldef .. white .. "in pausa" .. coldef
|
||||||
else
|
else
|
||||||
|
@ -934,4 +938,3 @@ end)
|
||||||
|
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue