bumblebee-status/bumblebee/modules/time.py
Tobias Witek 6278a4e564 [modules] Add module "date" as alias of "time"
The "time" module now has an alias (symlink) called "date". This is used
to differentiate a widget showing the time from a widget showing the
date.
2016-10-31 11:11:53 +01:00

16 lines
440 B
Python

import datetime
import bumblebee.module
class Module(bumblebee.module.Module):
def __init__(self, args):
module = self.__module__.split(".")[-1]
default = "%x" if module == "date" else "%X"
self._fmt = args[0] if args else default
super(Module, self).__init__(args)
def data(self):
return datetime.datetime.now().strftime(self._fmt)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4