[modules/cmus] Make displayed string configurable
Allow the user to use all tags read by cmus (cmus-remote -Q|grep ^tag) as part of the displayed data (plus the special 'tags' "duration" and "position").
This commit is contained in:
parent
507e0c36cc
commit
418dc1be86
2 changed files with 48 additions and 32 deletions
|
@ -6,3 +6,10 @@ def bytefmt(num):
|
|||
num /= 1024.0
|
||||
return "{:05.2f%}{}GiB".format(num)
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue