Add new widget and only show thermal widget if setting is set

This commit is contained in:
Kevin Alberts 2019-05-27 23:43:25 +02:00
parent 5c19e442fa
commit 99d4919539
Signed by: Kurocon
GPG key ID: BCD496FEBA0C6BC1
4 changed files with 246 additions and 63 deletions

102
config.py
View file

@ -46,57 +46,69 @@ try:
except ImportError as e:
logger.error("Could not load Kuro Config. Trying to load BaseConfig. Error: {}".format(e))
try:
from kuro.baseconfig import BaseConfig as Config
from kuro.base import BaseConfig as Config
except ImportError as e:
Config = None
raise ImportError("Could not load theme Config or BaseConfig! Error: {}".format(e))
# Initialize the Theme
Theme.initialize()
# Hook theme into all hooks we know of
hook.subscribe.startup_once(Theme.callback_startup_once)
hook.subscribe.startup(Theme.callback_startup)
hook.subscribe.startup_complete(Theme.callback_startup_complete)
hook.subscribe.setgroup(Theme.callback_setgroup)
hook.subscribe.addgroup(Theme.callback_addgroup)
hook.subscribe.delgroup(Theme.callback_delgroup)
hook.subscribe.changegroup(Theme.callback_changegroup)
hook.subscribe.focus_change(Theme.callback_focus_change)
hook.subscribe.float_change(Theme.callback_float_change)
hook.subscribe.group_window_add(Theme.callback_group_window_add)
hook.subscribe.client_new(Theme.callback_client_new)
hook.subscribe.client_managed(Theme.callback_client_managed)
hook.subscribe.client_killed(Theme.callback_client_killed)
hook.subscribe.client_state_changed(Theme.callback_client_state_changed)
hook.subscribe.client_type_changed(Theme.callback_client_type_changed)
hook.subscribe.client_focus(Theme.callback_client_focus)
hook.subscribe.client_mouse_enter(Theme.callback_client_mouse_enter)
hook.subscribe.client_name_updated(Theme.callback_client_name_updated)
hook.subscribe.client_urgent_hint_changed(Theme.callback_client_urgent_hint_changed)
hook.subscribe.layout_change(Theme.callback_layout_change)
hook.subscribe.net_wm_icon_change(Theme.callback_net_wm_icon_change)
hook.subscribe.selection_notify(Theme.callback_selection_notify)
hook.subscribe.selection_change(Theme.callback_selection_change)
hook.subscribe.screen_change(Theme.callback_screen_change)
hook.subscribe.current_screen_change(Theme.callback_current_screen_change)
try:
logger.error("Initializing theme...")
# Initialize the Theme
Theme.initialize()
logger.error("Initialize done")
# Initialize variables from theme
keys = Theme.keys
groups = Theme.groups
layouts = Theme.layouts
widget_defaults = Theme.widget_defaults
screens = Theme.screens
dgroups_key_binder = Theme.dgroups_key_binder
dgroups_app_rules = Theme.dgroups_app_rules
main = Theme.main
follow_mouse_focus = Theme.follow_mouse_focus
bring_front_click = Theme.bring_front_click
cursor_warp = Theme.cursor_warp
floating_layout = Theme.floating_layout
auto_fullscreen = Theme.auto_fullscreen
focus_on_window_activation = Theme.focus_on_window_activation
extentions = Theme.extensions
logger.error("Hooking theme into callbacks...")
# Hook theme into all hooks we know of
hook.subscribe.startup_once(Theme.callback_startup_once)
hook.subscribe.startup(Theme.callback_startup)
hook.subscribe.startup_complete(Theme.callback_startup_complete)
hook.subscribe.setgroup(Theme.callback_setgroup)
hook.subscribe.addgroup(Theme.callback_addgroup)
hook.subscribe.delgroup(Theme.callback_delgroup)
hook.subscribe.changegroup(Theme.callback_changegroup)
hook.subscribe.focus_change(Theme.callback_focus_change)
hook.subscribe.float_change(Theme.callback_float_change)
hook.subscribe.group_window_add(Theme.callback_group_window_add)
hook.subscribe.client_new(Theme.callback_client_new)
hook.subscribe.client_managed(Theme.callback_client_managed)
hook.subscribe.client_killed(Theme.callback_client_killed)
hook.subscribe.client_state_changed(Theme.callback_client_state_changed)
hook.subscribe.client_type_changed(Theme.callback_client_type_changed)
hook.subscribe.client_focus(Theme.callback_client_focus)
hook.subscribe.client_mouse_enter(Theme.callback_client_mouse_enter)
hook.subscribe.client_name_updated(Theme.callback_client_name_updated)
hook.subscribe.client_urgent_hint_changed(Theme.callback_client_urgent_hint_changed)
hook.subscribe.layout_change(Theme.callback_layout_change)
hook.subscribe.net_wm_icon_change(Theme.callback_net_wm_icon_change)
hook.subscribe.selection_notify(Theme.callback_selection_notify)
hook.subscribe.selection_change(Theme.callback_selection_change)
hook.subscribe.screen_change(Theme.callback_screen_change)
hook.subscribe.current_screen_change(Theme.callback_current_screen_change)
logger.error("Hooking done")
logger.error("Initializing theme variables")
# Initialize variables from theme
keys = Theme.keys
groups = Theme.groups
layouts = Theme.layouts
widget_defaults = Theme.widget_defaults
screens = Theme.screens
dgroups_key_binder = Theme.dgroups_key_binder
dgroups_app_rules = Theme.dgroups_app_rules
main = Theme.main
follow_mouse_focus = Theme.follow_mouse_focus
bring_front_click = Theme.bring_front_click
cursor_warp = Theme.cursor_warp
floating_layout = Theme.floating_layout
auto_fullscreen = Theme.auto_fullscreen
focus_on_window_activation = Theme.focus_on_window_activation
extentions = Theme.extensions
logger.error("Variable initialization done")
except Exception as e:
Theme = None
Config = None
raise AttributeError("Could not configure theme! Error: {}".format(e))
def main(qtile):