[modules/all] Update constructore to include theme
This commit is contained in:
parent
1f94eab927
commit
f2d411276d
78 changed files with 158 additions and 158 deletions
|
@ -11,8 +11,8 @@ import core.widget
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.volume))
|
super().__init__(config, theme, core.widget.Widget(self.volume))
|
||||||
|
|
||||||
self.__level = 'n/a'
|
self.__level = 'n/a'
|
||||||
self.__muted = True
|
self.__muted = True
|
||||||
|
|
|
@ -46,8 +46,8 @@ def get_apt_check_info(module):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=30)
|
@core.decorators.every(minutes=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.updates))
|
super().__init__(config, theme, core.widget.Widget(self.updates))
|
||||||
self.__thread = None
|
self.__thread = None
|
||||||
|
|
||||||
def updates(self, widget):
|
def updates(self, widget):
|
||||||
|
|
|
@ -12,8 +12,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.utilization))
|
super().__init__(config, theme, core.widget.Widget(self.utilization))
|
||||||
self.__packages = None
|
self.__packages = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -23,8 +23,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=10)
|
@core.decorators.every(minutes=10)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(''))
|
super().__init__(config, theme, core.widget.Widget(''))
|
||||||
|
|
||||||
self.__active = False
|
self.__active = False
|
||||||
self.__xid = None
|
self.__xid = None
|
||||||
|
|
|
@ -43,8 +43,8 @@ import util.graph
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.__layout = self.parameter('layout', 'cpu2.maxfreq cpu2.cpuload cpu2.coresload cpu2.temp cpu2.fanspeed')
|
self.__layout = self.parameter('layout', 'cpu2.maxfreq cpu2.cpuload cpu2.coresload cpu2.temp cpu2.fanspeed')
|
||||||
self.__widget_names = self.__layout.split()
|
self.__widget_names = self.__layout.split()
|
||||||
|
|
|
@ -1018,8 +1018,8 @@ def load_country_to_currency():
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=5)
|
@core.decorators.every(minutes=5)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.price))
|
super().__init__(config, theme, core.widget.Widget(self.price))
|
||||||
|
|
||||||
self.__data = []
|
self.__data = []
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ def default_format(module):
|
||||||
return default
|
return default
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.get_time))
|
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.LEFT_MOUSE, cmd=self.next_tz)
|
||||||
core.input.register(self, button=core.input.RIGHT_MOUSE, cmd=self.prev_tz)
|
core.input.register(self, button=core.input.RIGHT_MOUSE, cmd=self.prev_tz)
|
||||||
|
|
|
@ -12,8 +12,8 @@ from .datetimetz import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
@core.decorators.every(hours=1)
|
@core.decorators.every(hours=1)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config)
|
super().__init__(config, theme)
|
||||||
|
|
||||||
def default_format(self):
|
def default_format(self):
|
||||||
return '%x %Z'
|
return '%x %Z'
|
||||||
|
|
|
@ -20,8 +20,8 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.deezer))
|
super().__init__(config, theme, core.widget.Widget(self.deezer))
|
||||||
|
|
||||||
buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE,
|
buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE,
|
||||||
'RIGHT_CLICK':core.input.RIGHT_MOUSE,
|
'RIGHT_CLICK':core.input.RIGHT_MOUSE,
|
||||||
|
|
|
@ -50,8 +50,8 @@ def get_dnf_info(widget):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=30)
|
@core.decorators.every(minutes=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.updates))
|
super().__init__(config, theme, core.widget.Widget(self.updates))
|
||||||
|
|
||||||
def updates(self, widget):
|
def updates(self, widget):
|
||||||
result = []
|
result = []
|
||||||
|
|
|
@ -17,8 +17,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=5)
|
@core.decorators.every(seconds=5)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.docker_info))
|
super().__init__(config, theme, core.widget.Widget(self.docker_info))
|
||||||
self.__info = ''
|
self.__info = ''
|
||||||
|
|
||||||
def state(self, widget):
|
def state(self, widget):
|
||||||
|
|
|
@ -9,8 +9,8 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(''))
|
super().__init__(config, theme, core.widget.Widget(''))
|
||||||
self._paused = False
|
self._paused = False
|
||||||
# Make sure that dunst is currently not paused
|
# Make sure that dunst is currently not paused
|
||||||
util.cli.execute('killall -s SIGUSR2 dunst', ignore_errors=True)
|
util.cli.execute('killall -s SIGUSR2 dunst', ignore_errors=True)
|
||||||
|
|
|
@ -46,8 +46,8 @@ def getfromkrak(coin, currency):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=30)
|
@core.decorators.every(minutes=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.curprice))
|
super().__init__(config, theme, core.widget.Widget(self.curprice))
|
||||||
|
|
||||||
self.__curprice = ''
|
self.__curprice = ''
|
||||||
self.__getbtc = util.format.asbool(self.parameter('getbtc', True))
|
self.__getbtc = util.format.asbool(self.parameter('getbtc', True))
|
||||||
|
|
|
@ -20,8 +20,8 @@ import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=5)
|
@core.decorators.every(minutes=5)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.github))
|
super().__init__(config, theme, core.widget.Widget(self.github))
|
||||||
|
|
||||||
self.__count = 0
|
self.__count = 0
|
||||||
self.__requests = requests.Session()
|
self.__requests = requests.Session()
|
||||||
|
|
|
@ -13,13 +13,13 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widgets = [
|
widgets = [
|
||||||
core.widget.Widget(name='gpmdp.prev'),
|
core.widget.Widget(name='gpmdp.prev'),
|
||||||
core.widget.Widget(name='gpmdp.main', full_text=self.description),
|
core.widget.Widget(name='gpmdp.main', full_text=self.description),
|
||||||
core.widget.Widget(name='gpmdp.next'),
|
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,
|
core.input.register(widgets[0], button=core.input.LEFT_MOUSE,
|
||||||
cmd='playerctl previous')
|
cmd='playerctl previous')
|
||||||
|
|
|
@ -17,8 +17,8 @@ RECORD_SIZE = 5
|
||||||
SEPARATOR = '|'
|
SEPARATOR = '|'
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.hddtemps))
|
super().__init__(config, theme, core.widget.Widget(self.hddtemps))
|
||||||
self.__hddtemps = self.__get_hddtemps()
|
self.__hddtemps = self.__get_hddtemps()
|
||||||
|
|
||||||
def hddtemps(self, _):
|
def hddtemps(self, _):
|
||||||
|
|
|
@ -10,8 +10,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
self.__hname = ''
|
self.__hname = ''
|
||||||
|
|
||||||
def output(self, _):
|
def output(self, _):
|
||||||
|
|
|
@ -20,8 +20,8 @@ class Module(core.module.Module):
|
||||||
UNK = 'UNK'
|
UNK = 'UNK'
|
||||||
|
|
||||||
@core.decorators.every(seconds=30)
|
@core.decorators.every(seconds=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
|
|
||||||
self.__label = self.parameter('label')
|
self.__label = self.parameter('label')
|
||||||
self.__target = self.parameter('target')
|
self.__target = self.parameter('target')
|
||||||
|
|
|
@ -14,8 +14,8 @@ import util.cli
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.__include = tuple(filter(len, util.format.aslist(self.parameter('include', 'NumLock,CapsLock'))))
|
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'
|
self.__signalType = self.parameter('signaltype') if not self.parameter('signaltype') is None else 'warning'
|
||||||
|
|
|
@ -13,8 +13,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=60)
|
@core.decorators.every(seconds=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.current_layout))
|
super().__init__(config, theme, core.widget.Widget(self.current_layout))
|
||||||
|
|
||||||
core.input.register(
|
core.input.register(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -13,8 +13,8 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.current_layout))
|
super().__init__(config, theme, core.widget.Widget(self.current_layout))
|
||||||
|
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd=self.__next_keymap)
|
cmd=self.__next_keymap)
|
||||||
|
|
|
@ -13,8 +13,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=10)
|
@core.decorators.every(seconds=10)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.status))
|
super().__init__(config, theme, core.widget.Widget(self.status))
|
||||||
|
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd='virt-manager')
|
cmd='virt-manager')
|
||||||
|
|
|
@ -30,8 +30,8 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.description))
|
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.LEFT_MOUSE, cmd='mocp -G')
|
||||||
core.input.register(self, button=core.input.RIGHT_MOUSE, cmd='mocp -t shuffle')
|
core.input.register(self, button=core.input.RIGHT_MOUSE, cmd='mocp -t shuffle')
|
||||||
|
|
|
@ -21,8 +21,8 @@ import core.widget
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
|
|
||||||
self.__notmuch_count_query = self.parameter('query', 'tag:unread AND NOT path:/.*Trash.*/')
|
self.__notmuch_count_query = self.parameter('query', 'tag:unread AND NOT path:/.*Trash.*/')
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ import core.widget
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.utilization))
|
super().__init__(config, theme, core.widget.Widget(self.utilization))
|
||||||
|
|
||||||
self.__utilization = 'Not found: 0 0/0'
|
self.__utilization = 'Not found: 0 0/0'
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ def get_pacman_info(widget, path):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=30)
|
@core.decorators.every(minutes=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.updates))
|
super().__init__(config, theme, core.widget.Widget(self.updates))
|
||||||
|
|
||||||
def updates(self, widget):
|
def updates(self, widget):
|
||||||
if util.format.asbool(self.parameter('sum')):
|
if util.format.asbool(self.parameter('sum')):
|
||||||
|
|
|
@ -14,8 +14,8 @@ import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=1)
|
@core.decorators.every(minutes=1)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.pihole_status))
|
super().__init__(config, theme, core.widget.Widget(self.pihole_status))
|
||||||
|
|
||||||
self._pihole_address = self.parameter('address', '')
|
self._pihole_address = self.parameter('address', '')
|
||||||
self._pihole_pw_hash = self.parameter('pwhash', '')
|
self._pihole_pw_hash = self.parameter('pwhash', '')
|
||||||
|
|
|
@ -27,8 +27,8 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.text))
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
|
|
||||||
# Parameters
|
# Parameters
|
||||||
self.__work_period = int(self.parameter('work', 25))
|
self.__work_period = int(self.parameter('work', 25))
|
||||||
|
|
|
@ -32,8 +32,8 @@ import core.input
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.query))
|
super().__init__(config, theme, core.widget.Widget(self.query))
|
||||||
|
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd=self.__chooseNvidia)
|
cmd=self.__chooseNvidia)
|
||||||
|
|
|
@ -22,8 +22,8 @@ import util.format
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.get_progress_text))
|
super().__init__(config, theme, core.widget.Widget(self.get_progress_text))
|
||||||
self.__active = False
|
self.__active = False
|
||||||
|
|
||||||
def get_progress_text(self, widget):
|
def get_progress_text(self, widget):
|
||||||
|
|
|
@ -9,8 +9,8 @@ import util.location
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.public_ip))
|
super().__init__(config, theme, core.widget.Widget(self.public_ip))
|
||||||
|
|
||||||
self.__ip = ''
|
self.__ip = ''
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ import util.cli
|
||||||
possible_orientations = ['normal', 'left', 'inverted', 'right']
|
possible_orientations = ['normal', 'left', 'inverted', 'right']
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
widgets = self.widgets()
|
widgets = self.widgets()
|
||||||
|
|
|
@ -34,8 +34,8 @@ import util.format
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.get_output))
|
super().__init__(config, theme, core.widget.Widget(self.get_output))
|
||||||
|
|
||||||
self.__command = self.parameter('command', 'echo "no command configured"')
|
self.__command = self.parameter('command', 'echo "no command configured"')
|
||||||
self.__async = util.format.asbool(self.parameter('async'))
|
self.__async = util.format.asbool(self.parameter('async'))
|
||||||
|
|
|
@ -29,8 +29,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.__labels = self.parameter('labels', '{}'.format(LABEL))
|
self.__labels = self.parameter('labels', '{}'.format(LABEL))
|
||||||
self.__cmds = self.parameter('cmds', 'firefox {}'.format(LINK))
|
self.__cmds = self.parameter('cmds', 'firefox {}'.format(LINK))
|
||||||
|
|
|
@ -22,8 +22,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=5)
|
@core.decorators.every(minutes=5)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.devices = self.list_devices()
|
self.devices = self.list_devices()
|
||||||
self.display = self.parameter('display', 'combined')
|
self.display = self.parameter('display', 'combined')
|
||||||
|
|
|
@ -63,8 +63,8 @@ def formatStringBuilder(s, json):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=15)
|
@core.decorators.every(minutes=15)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.getState))
|
super().__init__(config, theme, core.widget.Widget(self.getState))
|
||||||
|
|
||||||
core.input.register(
|
core.input.register(
|
||||||
self, button=core.input.LEFT_MOUSE, cmd=self.__forceReload
|
self, button=core.input.LEFT_MOUSE, cmd=self.__forceReload
|
||||||
|
|
|
@ -22,8 +22,8 @@ import core.input
|
||||||
import core.decorators
|
import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.spotify))
|
super().__init__(config, theme, core.widget.Widget(self.spotify))
|
||||||
|
|
||||||
buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE,
|
buttons = {'LEFT_CLICK':core.input.LEFT_MOUSE,
|
||||||
'RIGHT_CLICK':core.input.RIGHT_MOUSE,
|
'RIGHT_CLICK':core.input.RIGHT_MOUSE,
|
||||||
|
|
|
@ -24,8 +24,8 @@ import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(hours=1)
|
@core.decorators.every(hours=1)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.value))
|
super().__init__(config, theme, core.widget.Widget(self.value))
|
||||||
|
|
||||||
self.__symbols = self.parameter('symbols', '')
|
self.__symbols = self.parameter('symbols', '')
|
||||||
self.__change = util.format.asbool(self.parameter('change', True))
|
self.__change = util.format.asbool(self.parameter('change', True))
|
||||||
|
|
|
@ -25,8 +25,8 @@ import util.location
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(hours=1)
|
@core.decorators.every(hours=1)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.suntimes))
|
super().__init__(config, theme, core.widget.Widget(self.suntimes))
|
||||||
|
|
||||||
lat = self.parameter('lat', None)
|
lat = self.parameter('lat', None)
|
||||||
lon = self.parameter('lon', None)
|
lon = self.parameter('lon', None)
|
||||||
|
|
|
@ -41,8 +41,8 @@ import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.text))
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
|
|
||||||
self.__confirm = util.format.asbool(self.parameter('confirm', True))
|
self.__confirm = util.format.asbool(self.parameter('confirm', True))
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ import core.widget
|
||||||
import core.decorators
|
import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
|
|
||||||
self.__pending_tasks = '0'
|
self.__pending_tasks = '0'
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ from .datetimetz import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
@core.decorators.every(seconds=59) # ensures one update per minute
|
@core.decorators.every(seconds=59) # ensures one update per minute
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config)
|
super().__init__(config, theme)
|
||||||
|
|
||||||
def default_format(self):
|
def default_format(self):
|
||||||
return '%X %Z'
|
return '%X %Z'
|
||||||
|
|
|
@ -27,8 +27,8 @@ import core.decorators
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
# parsing of parameters
|
# parsing of parameters
|
||||||
self.__scroll = util.format.asbool(self.parameter('scroll', False))
|
self.__scroll = util.format.asbool(self.parameter('scroll', False))
|
||||||
|
|
|
@ -13,8 +13,8 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
|
|
||||||
self.__doc = os.path.expanduser(self.parameter('file', '~/Documents/todo.txt'))
|
self.__doc = os.path.expanduser(self.parameter('file', '~/Documents/todo.txt'))
|
||||||
self.__todos = self.count_items()
|
self.__todos = self.count_items()
|
||||||
|
|
|
@ -25,9 +25,9 @@ import util.format
|
||||||
import util.graph
|
import util.graph
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widgets = []
|
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._exclude = tuple(filter(len, util.format.aslist(self.parameter('exclude', 'lo,virbr,docker,vboxnet,veth'))))
|
||||||
self._status = ''
|
self._status = ''
|
||||||
|
|
|
@ -11,8 +11,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(''))
|
super().__init__(config, theme, core.widget.Widget(''))
|
||||||
|
|
||||||
self.__paused = False
|
self.__paused = False
|
||||||
# Make sure that twmn is currently not paused
|
# Make sure that twmn is currently not paused
|
||||||
|
|
|
@ -8,8 +8,8 @@ import core.module
|
||||||
import core.widget
|
import core.widget
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
self.__uptime = ''
|
self.__uptime = ''
|
||||||
|
|
||||||
def output(self, _):
|
def output(self, _):
|
||||||
|
|
|
@ -26,8 +26,8 @@ import util.cli
|
||||||
import util.popup
|
import util.popup
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.vpn_status))
|
super().__init__(config, theme, core.widget.Widget(self.vpn_status))
|
||||||
|
|
||||||
self.__connected_vpn_profile = None
|
self.__connected_vpn_profile = None
|
||||||
self.__selected_vpn_profile = None
|
self.__selected_vpn_profile = None
|
||||||
|
|
|
@ -19,8 +19,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.text))
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
|
|
||||||
self.__tracking = False
|
self.__tracking = False
|
||||||
self.__project = ''
|
self.__project = ''
|
||||||
|
|
|
@ -30,8 +30,8 @@ from requests.exceptions import RequestException
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=15)
|
@core.decorators.every(minutes=15)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.output))
|
super().__init__(config, theme, core.widget.Widget(self.output))
|
||||||
|
|
||||||
self.__temperature = 0
|
self.__temperature = 0
|
||||||
self.__apikey = self.parameter('apikey', 'af7bfe22287c652d032a3064ffa44088')
|
self.__apikey = self.parameter('apikey', 'af7bfe22287c652d032a3064ffa44088')
|
||||||
|
|
|
@ -9,8 +9,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.never
|
@core.decorators.never
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget('xkcd'))
|
super().__init__(config, theme, core.widget.Widget('xkcd'))
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd="xdg-open https://c.xkcd.com/random/comic/"
|
cmd="xdg-open https://c.xkcd.com/random/comic/"
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,8 +17,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=5)
|
@core.decorators.every(seconds=5)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.keystate))
|
super().__init__(config, theme, core.widget.Widget(self.keystate))
|
||||||
self.__keystate = 'No YubiKey'
|
self.__keystate = 'No YubiKey'
|
||||||
|
|
||||||
def keystate(self, widget):
|
def keystate(self, widget):
|
||||||
|
|
|
@ -37,8 +37,8 @@ import util.cli
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self._includelist = set(filter(lambda x: len(x) > 0,
|
self._includelist = set(filter(lambda x: len(x) > 0,
|
||||||
util.format.aslist(self.parameter('list', default=''))))
|
util.format.aslist(self.parameter('list', default=''))))
|
||||||
|
|
|
@ -30,8 +30,8 @@ import util.graph
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config, channel):
|
def __init__(self, config, theme, channel):
|
||||||
super().__init__(config, core.widget.Widget(self.volume))
|
super().__init__(config, theme, core.widget.Widget(self.volume))
|
||||||
|
|
||||||
if util.format.asbool(self.parameter('autostart', False)):
|
if util.format.asbool(self.parameter('autostart', False)):
|
||||||
util.cli.execute('pulseaudio --start', ignore_errors=True)
|
util.cli.execute('pulseaudio --start', ignore_errors=True)
|
||||||
|
|
|
@ -193,8 +193,8 @@ class UPowerManager():
|
||||||
return "Pending discharge"
|
return "Pending discharge"
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.capacity))
|
super().__init__(config, theme, core.widget.Widget(self.capacity))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.power = UPowerManager()
|
self.power = UPowerManager()
|
||||||
|
|
|
@ -97,9 +97,9 @@ class BatteryManager(object):
|
||||||
return 'Charged'
|
return 'Charged'
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widgets = []
|
widgets = []
|
||||||
super().__init__(config, widgets)
|
super().__init__(config, theme, widgets)
|
||||||
|
|
||||||
self.__manager = BatteryManager()
|
self.__manager = BatteryManager()
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=30)
|
@core.decorators.every(seconds=30)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.brightness))
|
super().__init__(config, theme, core.widget.Widget(self.brightness))
|
||||||
|
|
||||||
self.__brightness = 'n/a'
|
self.__brightness = 'n/a'
|
||||||
self.__readcmd = None
|
self.__readcmd = None
|
||||||
|
|
|
@ -15,8 +15,8 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.utilization))
|
super().__init__(config, theme, core.widget.Widget(self.utilization))
|
||||||
self.widget().set('theme.minwidth', self._format.format(100.0-10e-20))
|
self.widget().set('theme.minwidth', self._format.format(100.0-10e-20))
|
||||||
self._utilization = psutil.cpu_percent(percpu=False)
|
self._utilization = psutil.cpu_percent(percpu=False)
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
|
|
|
@ -12,8 +12,8 @@ from .datetime import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
@core.decorators.every(hours=1)
|
@core.decorators.every(hours=1)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config)
|
super().__init__(config, theme)
|
||||||
|
|
||||||
def default_format(self):
|
def default_format(self):
|
||||||
return '%x'
|
return '%x'
|
||||||
|
|
|
@ -16,8 +16,8 @@ import core.widget
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.full_text))
|
super().__init__(config, theme, core.widget.Widget(self.full_text))
|
||||||
|
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE, cmd='calendar')
|
core.input.register(self, button=core.input.LEFT_MOUSE, cmd='calendar')
|
||||||
self._fmt = self.parameter('format', self.default_format())
|
self._fmt = self.parameter('format', self.default_format())
|
||||||
|
|
|
@ -19,8 +19,8 @@ import core.input
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.diskspace))
|
super().__init__(config, theme, core.widget.Widget(self.diskspace))
|
||||||
|
|
||||||
self._path = self.parameter('path', '/')
|
self._path = self.parameter('path', '/')
|
||||||
self._format = self.parameter('format', '{used}/{size} ({percent:05.02f}%)')
|
self._format = self.parameter('format', '{used}/{size} ({percent:05.02f}%)')
|
||||||
|
|
|
@ -9,8 +9,8 @@ import core.widget
|
||||||
import core.event
|
import core.event
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.full_text))
|
super().__init__(config, theme, core.widget.Widget(self.full_text))
|
||||||
self.__error = ''
|
self.__error = ''
|
||||||
self.__state = 'critical'
|
self.__state = 'critical'
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ import core.widget
|
||||||
import util.cli
|
import util.cli
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.__error = False
|
self.__error = False
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.full_text))
|
super().__init__(config, theme, core.widget.Widget(self.full_text))
|
||||||
|
|
||||||
def full_text(self, widgets):
|
def full_text(self, widgets):
|
||||||
return platform.release()
|
return platform.release()
|
||||||
|
|
|
@ -24,8 +24,8 @@ import core.input
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.current_layout))
|
super().__init__(config, theme, core.widget.Widget(self.current_layout))
|
||||||
|
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd=self.__next_keymap)
|
cmd=self.__next_keymap)
|
||||||
|
|
|
@ -14,8 +14,8 @@ import core.module
|
||||||
import core.input
|
import core.input
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.load))
|
super().__init__(config, theme, core.widget.Widget(self.load))
|
||||||
self._load = [0, 0, 0]
|
self._load = [0, 0, 0]
|
||||||
try:
|
try:
|
||||||
self._cpus = multiprocessing.cpu_count()
|
self._cpus = multiprocessing.cpu_count()
|
||||||
|
|
|
@ -18,8 +18,8 @@ import core.input
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.memory_usage))
|
super().__init__(config, theme, core.widget.Widget(self.memory_usage))
|
||||||
core.input.register(self, button=core.input.LEFT_MOUSE,
|
core.input.register(self, button=core.input.LEFT_MOUSE,
|
||||||
cmd='gnome-system-monitor')
|
cmd='gnome-system-monitor')
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,9 @@ import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=10)
|
@core.decorators.every(seconds=10)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widgets = []
|
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._exclude = tuple(filter(len, self.parameter('exclude', 'lo,virbr,docker,vboxnet,veth,br').split(',')))
|
||||||
self._include = self.parameter('include', '').split(',')
|
self._include = self.parameter('include', '').split(',')
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from .__pulseaudio import Module
|
from .__pulseaudio import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, 'sink')
|
super().__init__(config, theme, 'sink')
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from .__pulseaudio import Module
|
from .__pulseaudio import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, 'source')
|
super().__init__(config, theme, 'source')
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
|
@ -51,9 +51,10 @@ def get_rtt(module, widget):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=60)
|
@core.decorators.every(seconds=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widget = core.widget.Widget(self.rtt)
|
super().__init__(config, theme, core.widget.Widget(self.rtt))
|
||||||
super().__init__(config, widget)
|
|
||||||
|
widget = self.widget()
|
||||||
|
|
||||||
widget.set('address', self.parameter('address', '8.8.8.8'))
|
widget.set('address', self.parameter('address', '8.8.8.8'))
|
||||||
widget.set('rtt-probes', self.parameter('probes', 5))
|
widget.set('rtt-probes', self.parameter('probes', 5))
|
||||||
|
|
|
@ -66,9 +66,8 @@ def get_redshift_value(module):
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=10)
|
@core.decorators.every(seconds=10)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widget = core.widget.Widget(self.text)
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
super().__init__(config, widget)
|
|
||||||
|
|
||||||
self.__thread = None
|
self.__thread = None
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ import util.cli
|
||||||
import util.format
|
import util.format
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, [])
|
super().__init__(config, theme, [])
|
||||||
|
|
||||||
self.__chip = self.parameter('chip', '')
|
self.__chip = self.parameter('chip', '')
|
||||||
self.__data = {}
|
self.__data = {}
|
||||||
|
|
|
@ -12,8 +12,8 @@ import core.decorators
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(minutes=60)
|
@core.decorators.every(minutes=60)
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.text))
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
self.__text = self.parameter("text", "")
|
self.__text = self.parameter("text", "")
|
||||||
|
|
||||||
def text(self, _):
|
def text(self, _):
|
||||||
|
|
|
@ -7,7 +7,7 @@ import core.widget
|
||||||
import core.module
|
import core.module
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget('test'))
|
super().__init__(config=config, theme=theme, widgets=core.widget.Widget('test'))
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
|
@ -12,8 +12,8 @@ from .datetime import Module
|
||||||
|
|
||||||
class Module(Module):
|
class Module(Module):
|
||||||
@core.decorators.every(seconds=59) # ensures one update per minute
|
@core.decorators.every(seconds=59) # ensures one update per minute
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config)
|
super().__init__(config, theme)
|
||||||
|
|
||||||
def default_format(self):
|
def default_format(self):
|
||||||
return '%X'
|
return '%X'
|
||||||
|
|
|
@ -43,8 +43,8 @@ def build_menu(parent, current_directory, callback):
|
||||||
parent.add_cascade(entry.name, submenu)
|
parent.add_cascade(entry.name, submenu)
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
super().__init__(config, core.widget.Widget(self.text))
|
super().__init__(config, theme, core.widget.Widget(self.text))
|
||||||
|
|
||||||
self.__duration = int(self.parameter('duration', 30))
|
self.__duration = int(self.parameter('duration', 30))
|
||||||
self.__offx = int(self.parameter('offx', 0))
|
self.__offx = int(self.parameter('offx', 0))
|
||||||
|
|
|
@ -35,9 +35,9 @@ except:
|
||||||
|
|
||||||
class Module(core.module.Module):
|
class Module(core.module.Module):
|
||||||
@core.decorators.every(seconds=5) # takes up to 5s to detect a new screen
|
@core.decorators.every(seconds=5) # takes up to 5s to detect a new screen
|
||||||
def __init__(self, config):
|
def __init__(self, config, theme):
|
||||||
widgets = []
|
widgets = []
|
||||||
super().__init__(config, widgets)
|
super().__init__(config, theme, widgets)
|
||||||
|
|
||||||
self._autoupdate = util.format.asbool(self.parameter('autoupdate', True))
|
self._autoupdate = util.format.asbool(self.parameter('autoupdate', True))
|
||||||
self._needs_update = True
|
self._needs_update = True
|
||||||
|
|
Loading…
Reference in a new issue