[modules/all] Update constructore to include theme

This commit is contained in:
tobi-wan-kenobi 2020-04-26 16:39:24 +02:00
parent 1f94eab927
commit f2d411276d
78 changed files with 158 additions and 158 deletions

View file

@ -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

View file

@ -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):

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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 = []

View file

@ -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)

View file

@ -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'

View file

@ -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,

View file

@ -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 = []

View file

@ -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):

View file

@ -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)

View file

@ -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))

View file

@ -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()

View file

@ -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')

View file

@ -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, _):

View file

@ -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, _):

View file

@ -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')

View file

@ -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'

View file

@ -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,

View file

@ -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)

View file

@ -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')

View file

@ -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')

View file

@ -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.*/')

View file

@ -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'

View file

@ -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')):

View file

@ -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', '')

View file

@ -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))

View file

@ -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)

View file

@ -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):

View file

@ -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 = ''

View file

@ -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()

View file

@ -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'))

View file

@ -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))

View file

@ -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')

View file

@ -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

View file

@ -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,

View file

@ -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))

View file

@ -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)

View file

@ -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))

View file

@ -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'

View file

@ -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'

View file

@ -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))

View file

@ -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()

View file

@ -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 = ''

View file

@ -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

View file

@ -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, _):

View file

@ -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

View file

@ -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 = ''

View file

@ -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')

View file

@ -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/"
)

View file

@ -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):

View file

@ -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=''))))

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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

View file

@ -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,

View file

@ -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'

View file

@ -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())

View file

@ -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}%)')

View file

@ -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'

View file

@ -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

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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')

View file

@ -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(',')

View file

@ -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

View file

@ -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

View file

@ -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))

View file

@ -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

View file

@ -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 = {}

View file

@ -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, _):

View file

@ -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

View file

@ -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'

View file

@ -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))

View file

@ -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