[modules/cmus] Re-add cmus module

Re-add a first version of the cmus module originally contributed by
@paxy97.

Still missing:
* Icon themes (status)
* On-click actions

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-10 07:47:24 +01:00
parent 9ce7739efb
commit 87e76b9e40
6 changed files with 102 additions and 1 deletions

View file

@ -18,4 +18,12 @@ def execute(cmd, wait=True):
return out.decode("utf-8")
return None
def durationfmt(duration):
minutes, seconds = divmod(duration, 60)
hours, minutes = divmod(minutes, 60)
res = "{:02d}:{:02d}".format(minutes, seconds)
if hours > 0: res = "{:02d}:{}".format(hours, res)
return res
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4