Created
December 21, 2020 13:06
-
-
Save daniel12fsp/113717201a5bf3bcaa26a0701248ae86 to your computer and use it in GitHub Desktop.
Rotification for bumblebee_status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/home/linx/.local/lib/python3.8/site-packages/bumblebee_status/modules/contrib | |
# pylint: disable=C0111,R0903 | |
import os | |
import re | |
import platform | |
import core.module | |
import core.widget | |
import core.decorators | |
class Module(core.module.Module): | |
@core.decorators.every(seconds=1) | |
def __init__(self, config, theme): | |
super().__init__(config, theme, core.widget.Widget(self.output)) | |
def output(self, _): | |
stream = os.popen('rofication-status') | |
rofication_status_output = stream.read() | |
regex = r"(\d+)</span>$" | |
pattern = re.compile(regex) | |
matches = pattern.findall(rofication_status_output) | |
return matches[0] | |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment