1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-12-23 03:32:30 +00:00

holo: mpd update

This commit is contained in:
luke bonham 2013-09-15 22:00:40 +02:00
parent 502f774864
commit d1c73522c6
2 changed files with 61 additions and 4 deletions

57
eminent/init.lua Normal file
View file

@ -0,0 +1,57 @@
------------------------------------------
-- Effortless wmii-style dynamic tagging.
------------------------------------------
-- Lucas de Vries <lucas@glacicle.org>
-- Licensed under the WTFPL version 2
-- * http://sam.zoy.org/wtfpl/COPYING
-----------------------------------------
-- Cut version
-----------------------------------------
-- Grab environment
local ipairs = ipairs
local awful = require("awful")
local table = table
local capi = {
screen = screen,
}
-- Eminent: Effortless wmii-style dynamic tagging
module("eminent")
-- Grab the original functions we're replacing
local deflayout = nil
local orig = {
new = awful.tag.new,
taglist = awful.widget.taglist.new,
filter = awful.widget.taglist.filter.all,
}
-- Return tags with stuff on them, mark others hidden
function gettags(screen)
local tags = {}
for k, t in ipairs(capi.screen[screen]:tags()) do
if t.selected or #t:clients() > 0 then
awful.tag.setproperty(t, "hide", false)
table.insert(tags, t)
else
awful.tag.setproperty(t, "hide", true)
end
end
return tags
end
-- Pre-create tags
awful.tag.new = function (names, screen, layout)
deflayout = layout and layout[1] or layout
return orig.new(names, screen, layout)
end
-- Taglist label functions
awful.widget.taglist.filter.all = function (t, args)
if t.selected or #t:clients() > 0 then
return orig.filter(t, args)
end
end

View file

@ -202,23 +202,23 @@ function () awful.util.spawn_with_shell(musicplr) end)))
prev_icon:buttons(awful.util.table.join(awful.button({}, 1, prev_icon:buttons(awful.util.table.join(awful.button({}, 1,
function () function ()
awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev")
mpdwidget.notify() mpdwidget.update()
end))) end)))
next_icon:buttons(awful.util.table.join(awful.button({}, 1, next_icon:buttons(awful.util.table.join(awful.button({}, 1,
function () function ()
awful.util.spawn_with_shell("mpc next || ncmpcpp next || ncmpc next || pms next") awful.util.spawn_with_shell("mpc next || ncmpcpp next || ncmpc next || pms next")
mpdwidget.notify() mpdwidget.update()
end))) end)))
stop_icon:buttons(awful.util.table.join(awful.button({}, 1, stop_icon:buttons(awful.util.table.join(awful.button({}, 1,
function () function ()
play_pause_icon:set_image(beautiful.play) play_pause_icon:set_image(beautiful.play)
awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop")
mpdwidget.notify() mpdwidget.update()
end))) end)))
play_pause_icon:buttons(awful.util.table.join(awful.button({}, 1, play_pause_icon:buttons(awful.util.table.join(awful.button({}, 1,
function () function ()
awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle")
mpdwidget.notify() mpdwidget.update()
end))) end)))
-- Battery -- Battery