diff --git a/modules/contrib/amixer.py b/modules/contrib/amixer.py index 2a55b77..6c94e72 100644 --- a/modules/contrib/amixer.py +++ b/modules/contrib/amixer.py @@ -11,8 +11,8 @@ import core.widget import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.volume)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.volume)) self.__level = 'n/a' self.__muted = True diff --git a/modules/contrib/apt.py b/modules/contrib/apt.py index 0974499..4673606 100644 --- a/modules/contrib/apt.py +++ b/modules/contrib/apt.py @@ -46,8 +46,8 @@ def get_apt_check_info(module): class Module(core.module.Module): @core.decorators.every(minutes=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.updates)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.updates)) self.__thread = None def updates(self, widget): diff --git a/modules/contrib/arch-update.py b/modules/contrib/arch-update.py index 65c8b23..f4a910f 100644 --- a/modules/contrib/arch-update.py +++ b/modules/contrib/arch-update.py @@ -12,8 +12,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.utilization)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.utilization)) self.__packages = None @property diff --git a/modules/contrib/caffeine.py b/modules/contrib/caffeine.py index e995998..45b1b1d 100644 --- a/modules/contrib/caffeine.py +++ b/modules/contrib/caffeine.py @@ -23,8 +23,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(minutes=10) - def __init__(self, config): - super().__init__(config, core.widget.Widget('')) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget('')) self.__active = False self.__xid = None diff --git a/modules/contrib/cpu2.py b/modules/contrib/cpu2.py index 8792b78..4c3af00 100644 --- a/modules/contrib/cpu2.py +++ b/modules/contrib/cpu2.py @@ -43,8 +43,8 @@ import util.graph import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.__layout = self.parameter('layout', 'cpu2.maxfreq cpu2.cpuload cpu2.coresload cpu2.temp cpu2.fanspeed') self.__widget_names = self.__layout.split() diff --git a/modules/contrib/currency.py b/modules/contrib/currency.py index f701718..3aa1634 100644 --- a/modules/contrib/currency.py +++ b/modules/contrib/currency.py @@ -1018,8 +1018,8 @@ def load_country_to_currency(): class Module(core.module.Module): @core.decorators.every(minutes=5) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.price)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.price)) self.__data = [] diff --git a/modules/contrib/datetimetz.py b/modules/contrib/datetimetz.py index 08c6631..3efb7b0 100644 --- a/modules/contrib/datetimetz.py +++ b/modules/contrib/datetimetz.py @@ -36,8 +36,8 @@ def default_format(module): return default class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.get_time)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.get_time)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.next_tz) core.input.register(self, button=core.input.RIGHT_MOUSE, cmd=self.prev_tz) diff --git a/modules/contrib/datetz.py b/modules/contrib/datetz.py index 48541dc..e2b727f 100644 --- a/modules/contrib/datetz.py +++ b/modules/contrib/datetz.py @@ -12,8 +12,8 @@ from .datetimetz import Module class Module(Module): @core.decorators.every(hours=1) - def __init__(self, config): - super().__init__(config) + def __init__(self, config, theme): + super().__init__(config, theme) def default_format(self): return '%x %Z' diff --git a/modules/contrib/deezer.py b/modules/contrib/deezer.py index aed8b7c..3843e70 100644 --- a/modules/contrib/deezer.py +++ b/modules/contrib/deezer.py @@ -20,8 +20,8 @@ import core.widget import core.input class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.deezer)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.deezer)) buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE, 'RIGHT_CLICK':core.input.RIGHT_MOUSE, diff --git a/modules/contrib/dnf.py b/modules/contrib/dnf.py index f138b27..e9dce5b 100644 --- a/modules/contrib/dnf.py +++ b/modules/contrib/dnf.py @@ -50,8 +50,8 @@ def get_dnf_info(widget): class Module(core.module.Module): @core.decorators.every(minutes=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.updates)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.updates)) def updates(self, widget): result = [] diff --git a/modules/contrib/docker_ps.py b/modules/contrib/docker_ps.py index c8ea2e6..044dd49 100644 --- a/modules/contrib/docker_ps.py +++ b/modules/contrib/docker_ps.py @@ -17,8 +17,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(seconds=5) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.docker_info)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.docker_info)) self.__info = '' def state(self, widget): diff --git a/modules/contrib/dunst.py b/modules/contrib/dunst.py index 10cd362..399d997 100644 --- a/modules/contrib/dunst.py +++ b/modules/contrib/dunst.py @@ -9,8 +9,8 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget('')) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget('')) self._paused = False # Make sure that dunst is currently not paused util.cli.execute('killall -s SIGUSR2 dunst', ignore_errors=True) diff --git a/modules/contrib/getcrypto.py b/modules/contrib/getcrypto.py index 201bbf8..2381609 100644 --- a/modules/contrib/getcrypto.py +++ b/modules/contrib/getcrypto.py @@ -46,8 +46,8 @@ def getfromkrak(coin, currency): class Module(core.module.Module): @core.decorators.every(minutes=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.curprice)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.curprice)) self.__curprice = '' self.__getbtc = util.format.asbool(self.parameter('getbtc', True)) diff --git a/modules/contrib/github.py b/modules/contrib/github.py index f995ce5..b22fed1 100644 --- a/modules/contrib/github.py +++ b/modules/contrib/github.py @@ -20,8 +20,8 @@ import core.input class Module(core.module.Module): @core.decorators.every(minutes=5) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.github)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.github)) self.__count = 0 self.__requests = requests.Session() diff --git a/modules/contrib/gpmdp.py b/modules/contrib/gpmdp.py index 7aea271..549983d 100644 --- a/modules/contrib/gpmdp.py +++ b/modules/contrib/gpmdp.py @@ -13,13 +13,13 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): + def __init__(self, config, theme): widgets = [ core.widget.Widget(name='gpmdp.prev'), core.widget.Widget(name='gpmdp.main', full_text=self.description), core.widget.Widget(name='gpmdp.next'), ] - super().__init__(config, widgets) + super().__init__(config, theme, widgets) core.input.register(widgets[0], button=core.input.LEFT_MOUSE, cmd='playerctl previous') diff --git a/modules/contrib/hddtemp.py b/modules/contrib/hddtemp.py index 0a70bf1..84b43d3 100644 --- a/modules/contrib/hddtemp.py +++ b/modules/contrib/hddtemp.py @@ -17,8 +17,8 @@ RECORD_SIZE = 5 SEPARATOR = '|' class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.hddtemps)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.hddtemps)) self.__hddtemps = self.__get_hddtemps() def hddtemps(self, _): diff --git a/modules/contrib/hostname.py b/modules/contrib/hostname.py index 7f7c6c4..43a9521 100644 --- a/modules/contrib/hostname.py +++ b/modules/contrib/hostname.py @@ -10,8 +10,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__hname = '' def output(self, _): diff --git a/modules/contrib/http_status.py b/modules/contrib/http_status.py index 7230987..49f6f7b 100644 --- a/modules/contrib/http_status.py +++ b/modules/contrib/http_status.py @@ -20,8 +20,8 @@ class Module(core.module.Module): UNK = 'UNK' @core.decorators.every(seconds=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__label = self.parameter('label') self.__target = self.parameter('target') diff --git a/modules/contrib/indicator.py b/modules/contrib/indicator.py index 842f20b..b761b3e 100644 --- a/modules/contrib/indicator.py +++ b/modules/contrib/indicator.py @@ -14,8 +14,8 @@ import util.cli import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.__include = tuple(filter(len, util.format.aslist(self.parameter('include', 'NumLock,CapsLock')))) self.__signalType = self.parameter('signaltype') if not self.parameter('signaltype') is None else 'warning' diff --git a/modules/contrib/layout-xkbswitch.py b/modules/contrib/layout-xkbswitch.py index 9aa4225..cf18be6 100644 --- a/modules/contrib/layout-xkbswitch.py +++ b/modules/contrib/layout-xkbswitch.py @@ -13,8 +13,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(seconds=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.current_layout)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.current_layout)) core.input.register( self, diff --git a/modules/contrib/layout.py b/modules/contrib/layout.py index dd07402..5004bdb 100644 --- a/modules/contrib/layout.py +++ b/modules/contrib/layout.py @@ -13,8 +13,8 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.current_layout)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.current_layout)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.__next_keymap) diff --git a/modules/contrib/libvirtvms.py b/modules/contrib/libvirtvms.py index be6ef4c..8f39814 100644 --- a/modules/contrib/libvirtvms.py +++ b/modules/contrib/libvirtvms.py @@ -13,8 +13,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(seconds=10) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.status)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.status)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd='virt-manager') diff --git a/modules/contrib/mocp.py b/modules/contrib/mocp.py index 533d641..db83800 100644 --- a/modules/contrib/mocp.py +++ b/modules/contrib/mocp.py @@ -30,8 +30,8 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.description)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.description)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd='mocp -G') core.input.register(self, button=core.input.RIGHT_MOUSE, cmd='mocp -t shuffle') diff --git a/modules/contrib/notmuch_count.py b/modules/contrib/notmuch_count.py index 6bdd2f0..e1ac040 100644 --- a/modules/contrib/notmuch_count.py +++ b/modules/contrib/notmuch_count.py @@ -21,8 +21,8 @@ import core.widget import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__notmuch_count_query = self.parameter('query', 'tag:unread AND NOT path:/.*Trash.*/') diff --git a/modules/contrib/nvidiagpu.py b/modules/contrib/nvidiagpu.py index 0ba7cc9..11b31b9 100644 --- a/modules/contrib/nvidiagpu.py +++ b/modules/contrib/nvidiagpu.py @@ -15,8 +15,8 @@ import core.widget import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.utilization)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.utilization)) self.__utilization = 'Not found: 0 0/0' diff --git a/modules/contrib/pacman.py b/modules/contrib/pacman.py index 10c22c8..64b47a9 100644 --- a/modules/contrib/pacman.py +++ b/modules/contrib/pacman.py @@ -47,8 +47,8 @@ def get_pacman_info(widget, path): class Module(core.module.Module): @core.decorators.every(minutes=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.updates)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.updates)) def updates(self, widget): if util.format.asbool(self.parameter('sum')): diff --git a/modules/contrib/pihole.py b/modules/contrib/pihole.py index 471a00c..8ae228f 100644 --- a/modules/contrib/pihole.py +++ b/modules/contrib/pihole.py @@ -14,8 +14,8 @@ import core.input class Module(core.module.Module): @core.decorators.every(minutes=1) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.pihole_status)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.pihole_status)) self._pihole_address = self.parameter('address', '') self._pihole_pw_hash = self.parameter('pwhash', '') diff --git a/modules/contrib/pomodoro.py b/modules/contrib/pomodoro.py index 09bf659..2c1b175 100644 --- a/modules/contrib/pomodoro.py +++ b/modules/contrib/pomodoro.py @@ -27,8 +27,8 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) # Parameters self.__work_period = int(self.parameter('work', 25)) diff --git a/modules/contrib/prime.py b/modules/contrib/prime.py index 12b64de..2b140e8 100644 --- a/modules/contrib/prime.py +++ b/modules/contrib/prime.py @@ -32,8 +32,8 @@ import core.input import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.query)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.query)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.__chooseNvidia) diff --git a/modules/contrib/progress.py b/modules/contrib/progress.py index 871a954..35f210a 100644 --- a/modules/contrib/progress.py +++ b/modules/contrib/progress.py @@ -22,8 +22,8 @@ import util.format import re class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.get_progress_text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.get_progress_text)) self.__active = False def get_progress_text(self, widget): diff --git a/modules/contrib/publicip.py b/modules/contrib/publicip.py index 41aa2e4..0fd5ac2 100644 --- a/modules/contrib/publicip.py +++ b/modules/contrib/publicip.py @@ -9,8 +9,8 @@ import util.location class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.public_ip)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.public_ip)) self.__ip = '' diff --git a/modules/contrib/rotation.py b/modules/contrib/rotation.py index d19bbe8..baf7a4d 100644 --- a/modules/contrib/rotation.py +++ b/modules/contrib/rotation.py @@ -15,8 +15,8 @@ import util.cli possible_orientations = ['normal', 'left', 'inverted', 'right'] class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) def update(self): widgets = self.widgets() diff --git a/modules/contrib/shell.py b/modules/contrib/shell.py index 2c0ac60..41e56e1 100644 --- a/modules/contrib/shell.py +++ b/modules/contrib/shell.py @@ -34,8 +34,8 @@ import util.format import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.get_output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.get_output)) self.__command = self.parameter('command', 'echo "no command configured"') self.__async = util.format.asbool(self.parameter('async')) diff --git a/modules/contrib/shortcut.py b/modules/contrib/shortcut.py index b038f37..b31a808 100644 --- a/modules/contrib/shortcut.py +++ b/modules/contrib/shortcut.py @@ -29,8 +29,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.__labels = self.parameter('labels', '{}'.format(LABEL)) self.__cmds = self.parameter('cmds', 'firefox {}'.format(LINK)) diff --git a/modules/contrib/smartstatus.py b/modules/contrib/smartstatus.py index 3ff1a31..095cea8 100644 --- a/modules/contrib/smartstatus.py +++ b/modules/contrib/smartstatus.py @@ -22,8 +22,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(minutes=5) - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.devices = self.list_devices() self.display = self.parameter('display', 'combined') diff --git a/modules/contrib/spaceapi.py b/modules/contrib/spaceapi.py index 60c03fd..567a605 100644 --- a/modules/contrib/spaceapi.py +++ b/modules/contrib/spaceapi.py @@ -63,8 +63,8 @@ def formatStringBuilder(s, json): class Module(core.module.Module): @core.decorators.every(minutes=15) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.getState)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.getState)) core.input.register( self, button=core.input.LEFT_MOUSE, cmd=self.__forceReload diff --git a/modules/contrib/spotify.py b/modules/contrib/spotify.py index 672423e..3982ee7 100644 --- a/modules/contrib/spotify.py +++ b/modules/contrib/spotify.py @@ -22,8 +22,8 @@ import core.input import core.decorators class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.spotify)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.spotify)) buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE, 'RIGHT_CLICK':core.input.RIGHT_MOUSE, diff --git a/modules/contrib/stock.py b/modules/contrib/stock.py index 1a4f200..7f62c18 100644 --- a/modules/contrib/stock.py +++ b/modules/contrib/stock.py @@ -24,8 +24,8 @@ import util.format class Module(core.module.Module): @core.decorators.every(hours=1) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.value)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.value)) self.__symbols = self.parameter('symbols', '') self.__change = util.format.asbool(self.parameter('change', True)) diff --git a/modules/contrib/sun.py b/modules/contrib/sun.py index b80051d..75ee7a6 100644 --- a/modules/contrib/sun.py +++ b/modules/contrib/sun.py @@ -25,8 +25,8 @@ import util.location class Module(core.module.Module): @core.decorators.every(hours=1) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.suntimes)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.suntimes)) lat = self.parameter('lat', None) lon = self.parameter('lon', None) diff --git a/modules/contrib/system.py b/modules/contrib/system.py index 3fb9dbf..1ffd750 100644 --- a/modules/contrib/system.py +++ b/modules/contrib/system.py @@ -41,8 +41,8 @@ import util.format class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) self.__confirm = util.format.asbool(self.parameter('confirm', True)) diff --git a/modules/contrib/taskwarrior.py b/modules/contrib/taskwarrior.py index 0c186de..958463f 100644 --- a/modules/contrib/taskwarrior.py +++ b/modules/contrib/taskwarrior.py @@ -14,8 +14,8 @@ import core.widget import core.decorators class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__pending_tasks = '0' diff --git a/modules/contrib/timetz.py b/modules/contrib/timetz.py index aeaa6f6..ea96fe1 100644 --- a/modules/contrib/timetz.py +++ b/modules/contrib/timetz.py @@ -12,8 +12,8 @@ from .datetimetz import Module class Module(Module): @core.decorators.every(seconds=59) # ensures one update per minute - def __init__(self, config): - super().__init__(config) + def __init__(self, config, theme): + super().__init__(config, theme) def default_format(self): return '%X %Z' diff --git a/modules/contrib/title.py b/modules/contrib/title.py index c0eff67..25c674c 100644 --- a/modules/contrib/title.py +++ b/modules/contrib/title.py @@ -27,8 +27,8 @@ import core.decorators import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) # parsing of parameters self.__scroll = util.format.asbool(self.parameter('scroll', False)) diff --git a/modules/contrib/todo.py b/modules/contrib/todo.py index 4965886..3be3b82 100644 --- a/modules/contrib/todo.py +++ b/modules/contrib/todo.py @@ -13,8 +13,8 @@ import core.widget import core.input class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__doc = os.path.expanduser(self.parameter('file', '~/Documents/todo.txt')) self.__todos = self.count_items() diff --git a/modules/contrib/traffic.py b/modules/contrib/traffic.py index bd9aabd..1c85405 100644 --- a/modules/contrib/traffic.py +++ b/modules/contrib/traffic.py @@ -25,9 +25,9 @@ import util.format import util.graph class Module(core.module.Module): - def __init__(self, config): + def __init__(self, config, theme): widgets = [] - super().__init__(config, widgets) + super().__init__(config, theme, widgets) self._exclude = tuple(filter(len, util.format.aslist(self.parameter('exclude', 'lo,virbr,docker,vboxnet,veth')))) self._status = '' diff --git a/modules/contrib/twmn.py b/modules/contrib/twmn.py index b1ad74b..bda1c96 100644 --- a/modules/contrib/twmn.py +++ b/modules/contrib/twmn.py @@ -11,8 +11,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget('')) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget('')) self.__paused = False # Make sure that twmn is currently not paused diff --git a/modules/contrib/uptime.py b/modules/contrib/uptime.py index 68cb94c..dd39da3 100644 --- a/modules/contrib/uptime.py +++ b/modules/contrib/uptime.py @@ -8,8 +8,8 @@ import core.module import core.widget class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__uptime = '' def output(self, _): diff --git a/modules/contrib/vpn.py b/modules/contrib/vpn.py index f8f5d94..6f64792 100644 --- a/modules/contrib/vpn.py +++ b/modules/contrib/vpn.py @@ -26,8 +26,8 @@ import util.cli import util.popup class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.vpn_status)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.vpn_status)) self.__connected_vpn_profile = None self.__selected_vpn_profile = None diff --git a/modules/contrib/watson.py b/modules/contrib/watson.py index 21540f4..f8f7076 100644 --- a/modules/contrib/watson.py +++ b/modules/contrib/watson.py @@ -19,8 +19,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) self.__tracking = False self.__project = '' diff --git a/modules/contrib/weather.py b/modules/contrib/weather.py index 0f391b3..21927d7 100644 --- a/modules/contrib/weather.py +++ b/modules/contrib/weather.py @@ -30,8 +30,8 @@ from requests.exceptions import RequestException class Module(core.module.Module): @core.decorators.every(minutes=15) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.output)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.output)) self.__temperature = 0 self.__apikey = self.parameter('apikey', 'af7bfe22287c652d032a3064ffa44088') diff --git a/modules/contrib/xkcd.py b/modules/contrib/xkcd.py index 85a8713..4e91959 100644 --- a/modules/contrib/xkcd.py +++ b/modules/contrib/xkcd.py @@ -9,8 +9,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.never - def __init__(self, config): - super().__init__(config, core.widget.Widget('xkcd')) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget('xkcd')) core.input.register(self, button=core.input.LEFT_MOUSE, cmd="xdg-open https://c.xkcd.com/random/comic/" ) diff --git a/modules/contrib/yubikey.py b/modules/contrib/yubikey.py index 840a0ce..2cfe80f 100644 --- a/modules/contrib/yubikey.py +++ b/modules/contrib/yubikey.py @@ -17,8 +17,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(seconds=5) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.keystate)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.keystate)) self.__keystate = 'No YubiKey' def keystate(self, widget): diff --git a/modules/contrib/zpool.py b/modules/contrib/zpool.py index 6f9f284..8218793 100644 --- a/modules/contrib/zpool.py +++ b/modules/contrib/zpool.py @@ -37,8 +37,8 @@ import util.cli import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self._includelist = set(filter(lambda x: len(x) > 0, util.format.aslist(self.parameter('list', default='')))) diff --git a/modules/core/__pulseaudio.py b/modules/core/__pulseaudio.py index 4a13963..22136a8 100644 --- a/modules/core/__pulseaudio.py +++ b/modules/core/__pulseaudio.py @@ -30,8 +30,8 @@ import util.graph import util.format class Module(core.module.Module): - def __init__(self, config, channel): - super().__init__(config, core.widget.Widget(self.volume)) + def __init__(self, config, theme, channel): + super().__init__(config, theme, core.widget.Widget(self.volume)) if util.format.asbool(self.parameter('autostart', False)): util.cli.execute('pulseaudio --start', ignore_errors=True) diff --git a/modules/core/battery-upower.py b/modules/core/battery-upower.py index 0d8ffd5..ca1d7b7 100644 --- a/modules/core/battery-upower.py +++ b/modules/core/battery-upower.py @@ -193,8 +193,8 @@ class UPowerManager(): return "Pending discharge" class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.capacity)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.capacity)) try: self.power = UPowerManager() diff --git a/modules/core/battery.py b/modules/core/battery.py index 6ebd99e..54af015 100644 --- a/modules/core/battery.py +++ b/modules/core/battery.py @@ -97,9 +97,9 @@ class BatteryManager(object): return 'Charged' class Module(core.module.Module): - def __init__(self, config): + def __init__(self, config, theme): widgets = [] - super().__init__(config, widgets) + super().__init__(config, theme, widgets) self.__manager = BatteryManager() diff --git a/modules/core/brightness.py b/modules/core/brightness.py index ae198c2..6cc1610 100644 --- a/modules/core/brightness.py +++ b/modules/core/brightness.py @@ -19,8 +19,8 @@ import util.cli class Module(core.module.Module): @core.decorators.every(seconds=30) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.brightness)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.brightness)) self.__brightness = 'n/a' self.__readcmd = None diff --git a/modules/core/cpu.py b/modules/core/cpu.py index c25ab5b..65d30a7 100644 --- a/modules/core/cpu.py +++ b/modules/core/cpu.py @@ -15,8 +15,8 @@ import core.widget import core.input class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.utilization)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.utilization)) self.widget().set('theme.minwidth', self._format.format(100.0-10e-20)) self._utilization = psutil.cpu_percent(percpu=False) core.input.register(self, button=core.input.LEFT_MOUSE, diff --git a/modules/core/date.py b/modules/core/date.py index 2da8639..bb4ff0d 100644 --- a/modules/core/date.py +++ b/modules/core/date.py @@ -12,8 +12,8 @@ from .datetime import Module class Module(Module): @core.decorators.every(hours=1) - def __init__(self, config): - super().__init__(config) + def __init__(self, config, theme): + super().__init__(config, theme) def default_format(self): return '%x' diff --git a/modules/core/datetime.py b/modules/core/datetime.py index 8d03a9c..ada5fdd 100644 --- a/modules/core/datetime.py +++ b/modules/core/datetime.py @@ -16,8 +16,8 @@ import core.widget import core.input class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.full_text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.full_text)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd='calendar') self._fmt = self.parameter('format', self.default_format()) diff --git a/modules/core/disk.py b/modules/core/disk.py index a4dfebb..bcd9328 100644 --- a/modules/core/disk.py +++ b/modules/core/disk.py @@ -19,8 +19,8 @@ import core.input import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.diskspace)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.diskspace)) self._path = self.parameter('path', '/') self._format = self.parameter('format', '{used}/{size} ({percent:05.02f}%)') diff --git a/modules/core/error.py b/modules/core/error.py index e551099..959a52f 100644 --- a/modules/core/error.py +++ b/modules/core/error.py @@ -9,8 +9,8 @@ import core.widget import core.event class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.full_text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.full_text)) self.__error = '' self.__state = 'critical' diff --git a/modules/core/git.py b/modules/core/git.py index 7bff60b..f9b4b87 100644 --- a/modules/core/git.py +++ b/modules/core/git.py @@ -17,8 +17,8 @@ import core.widget import util.cli class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.__error = False diff --git a/modules/core/kernel.py b/modules/core/kernel.py index fb8dc7c..1432a05 100644 --- a/modules/core/kernel.py +++ b/modules/core/kernel.py @@ -10,8 +10,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.full_text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.full_text)) def full_text(self, widgets): return platform.release() diff --git a/modules/core/layout-xkb.py b/modules/core/layout-xkb.py index 203ca1d..1b02900 100644 --- a/modules/core/layout-xkb.py +++ b/modules/core/layout-xkb.py @@ -24,8 +24,8 @@ import core.input import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.current_layout)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.current_layout)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.__next_keymap) diff --git a/modules/core/load.py b/modules/core/load.py index 87f4d3a..646a876 100644 --- a/modules/core/load.py +++ b/modules/core/load.py @@ -14,8 +14,8 @@ import core.module import core.input class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.load)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.load)) self._load = [0, 0, 0] try: self._cpus = multiprocessing.cpu_count() diff --git a/modules/core/memory.py b/modules/core/memory.py index 2a6b090..544cd12 100644 --- a/modules/core/memory.py +++ b/modules/core/memory.py @@ -18,8 +18,8 @@ import core.input import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.memory_usage)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.memory_usage)) core.input.register(self, button=core.input.LEFT_MOUSE, cmd='gnome-system-monitor') diff --git a/modules/core/nic.py b/modules/core/nic.py index b54680b..b2ec324 100644 --- a/modules/core/nic.py +++ b/modules/core/nic.py @@ -24,9 +24,9 @@ import util.format class Module(core.module.Module): @core.decorators.every(seconds=10) - def __init__(self, config): + def __init__(self, config, theme): widgets = [] - super().__init__(config, widgets) + super().__init__(config, theme, widgets) self._exclude = tuple(filter(len, self.parameter('exclude', 'lo,virbr,docker,vboxnet,veth,br').split(','))) self._include = self.parameter('include', '').split(',') diff --git a/modules/core/pasink.py b/modules/core/pasink.py index 423bcb9..ba30597 100644 --- a/modules/core/pasink.py +++ b/modules/core/pasink.py @@ -1,7 +1,7 @@ from .__pulseaudio import Module class Module(Module): - def __init__(self, config): - super().__init__(config, 'sink') + def __init__(self, config, theme): + super().__init__(config, theme, 'sink') # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/modules/core/pasource.py b/modules/core/pasource.py index d3c9a2a..7640d82 100644 --- a/modules/core/pasource.py +++ b/modules/core/pasource.py @@ -1,7 +1,7 @@ from .__pulseaudio import Module class Module(Module): - def __init__(self, config): - super().__init__(config, 'source') + def __init__(self, config, theme): + super().__init__(config, theme, 'source') # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/modules/core/ping.py b/modules/core/ping.py index c74b76b..a5ae490 100644 --- a/modules/core/ping.py +++ b/modules/core/ping.py @@ -51,9 +51,10 @@ def get_rtt(module, widget): class Module(core.module.Module): @core.decorators.every(seconds=60) - def __init__(self, config): - widget = core.widget.Widget(self.rtt) - super().__init__(config, widget) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.rtt)) + + widget = self.widget() widget.set('address', self.parameter('address', '8.8.8.8')) widget.set('rtt-probes', self.parameter('probes', 5)) diff --git a/modules/core/redshift.py b/modules/core/redshift.py index 2807422..1729d84 100644 --- a/modules/core/redshift.py +++ b/modules/core/redshift.py @@ -66,9 +66,8 @@ def get_redshift_value(module): class Module(core.module.Module): @core.decorators.every(seconds=10) - def __init__(self, config): - widget = core.widget.Widget(self.text) - super().__init__(config, widget) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) self.__thread = None diff --git a/modules/core/sensors2.py b/modules/core/sensors2.py index 2555620..d16a3ff 100644 --- a/modules/core/sensors2.py +++ b/modules/core/sensors2.py @@ -27,8 +27,8 @@ import util.cli import util.format class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, []) + def __init__(self, config, theme): + super().__init__(config, theme, []) self.__chip = self.parameter('chip', '') self.__data = {} diff --git a/modules/core/spacer.py b/modules/core/spacer.py index 15efa96..4ff8f3c 100644 --- a/modules/core/spacer.py +++ b/modules/core/spacer.py @@ -12,8 +12,8 @@ import core.decorators class Module(core.module.Module): @core.decorators.every(minutes=60) - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) self.__text = self.parameter("text", "") def text(self, _): diff --git a/modules/core/test.py b/modules/core/test.py index c88ccf4..31c3a1c 100644 --- a/modules/core/test.py +++ b/modules/core/test.py @@ -7,7 +7,7 @@ import core.widget import core.module class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget('test')) + def __init__(self, config, theme): + super().__init__(config=config, theme=theme, widgets=core.widget.Widget('test')) # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/modules/core/time.py b/modules/core/time.py index f35186e..f92ff8f 100644 --- a/modules/core/time.py +++ b/modules/core/time.py @@ -12,8 +12,8 @@ from .datetime import Module class Module(Module): @core.decorators.every(seconds=59) # ensures one update per minute - def __init__(self, config): - super().__init__(config) + def __init__(self, config, theme): + super().__init__(config, theme) def default_format(self): return '%X' diff --git a/modules/core/vault.py b/modules/core/vault.py index 6314cad..8447b2d 100644 --- a/modules/core/vault.py +++ b/modules/core/vault.py @@ -43,8 +43,8 @@ def build_menu(parent, current_directory, callback): parent.add_cascade(entry.name, submenu) class Module(core.module.Module): - def __init__(self, config): - super().__init__(config, core.widget.Widget(self.text)) + def __init__(self, config, theme): + super().__init__(config, theme, core.widget.Widget(self.text)) self.__duration = int(self.parameter('duration', 30)) self.__offx = int(self.parameter('offx', 0)) diff --git a/modules/core/xrandr.py b/modules/core/xrandr.py index 4b7d8b6..6d2f931 100644 --- a/modules/core/xrandr.py +++ b/modules/core/xrandr.py @@ -35,9 +35,9 @@ except: class Module(core.module.Module): @core.decorators.every(seconds=5) # takes up to 5s to detect a new screen - def __init__(self, config): + def __init__(self, config, theme): widgets = [] - super().__init__(config, widgets) + super().__init__(config, theme, widgets) self._autoupdate = util.format.asbool(self.parameter('autoupdate', True)) self._needs_update = True