dwl-tags config started
This commit is contained in:
@@ -7,7 +7,6 @@ Author's email: nwg.piotr@gmail.com
|
||||
Copyright (c) 2021 Piotr Miller & Contributors
|
||||
License: MIT
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
@@ -204,16 +203,18 @@ def instantiate_content(panel, container, content_list, icons_path=""):
|
||||
container.pack_start(cpu_avg, False, False, panel["items-padding"])
|
||||
|
||||
if item == "dwl-tags":
|
||||
print("dwl-tags module found in {}".format(panel["output"]))
|
||||
print("dwl data file: {}".format(common.dwl_data_file))
|
||||
if os.path.isfile(common.dwl_data_file):
|
||||
common.dwl_data = load_json(common.dwl_data_file)
|
||||
print("dwl data:", common.dwl_data)
|
||||
#Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 200, check_dwl_data)
|
||||
if "dwl-tags" not in panel:
|
||||
panel["dwl-tags"] = {}
|
||||
|
||||
dwl_tags = DwlTags(panel["output"], common.dwl_data)
|
||||
common.dwl_instances.append(dwl_tags)
|
||||
container.pack_start(dwl_tags, False, False, panel["items-padding"])
|
||||
dwl_tags = DwlTags(panel["output"], panel["dwl-tags"])
|
||||
common.dwl_instances.append(dwl_tags)
|
||||
container.pack_start(dwl_tags, False, False, panel["items-padding"])
|
||||
dwl_data = load_json(common.dwl_data_file)
|
||||
if dwl_data:
|
||||
dwl_tags.refresh(dwl_data)
|
||||
else:
|
||||
print("{} data file not found".format(common.dwl_data_file))
|
||||
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user