From 0271860fea422febe6dfc6e6423bab7e2f423c03 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 30 Oct 2024 12:44:41 +0100 Subject: [PATCH] bitwarden --- mqtt_srv.cfg | 18 +++++++++--------- mqtt_srv.py | 13 +++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/mqtt_srv.cfg b/mqtt_srv.cfg index aa222de..85fec35 100644 --- a/mqtt_srv.cfg +++ b/mqtt_srv.cfg @@ -1,9 +1,9 @@ -[global] -mykey = prod/v1/install/ - -[morefine] -right = ["HDMI-A-0", "1920x1080"] -tleft = ["DisplayPort-6", "1920x1080"] -tright = ["DisplayPort-8", "1920x1080"] -left = ["DisplayPort-7", "2560x1440"] -mid = ["DisplayPort-0", "3440x1440"] \ No newline at end of file +{"global": + {"mykey": "prod/v1/install/"} +"morefine": + {"right": ["HDMI-A-0", "1920x1080"]}, + {"tleft": ["DisplayPort-6", "1920x1080"]}, + {"tright": ["DisplayPort-8", "1920x1080"]}, + {"left": ["DisplayPort-7", "2560x1440"]}, + {"mid": ["DisplayPort-0", "3440x1440"]} +} \ No newline at end of file diff --git a/mqtt_srv.py b/mqtt_srv.py index 49c4dd1..8b8f6a9 100755 --- a/mqtt_srv.py +++ b/mqtt_srv.py @@ -17,14 +17,15 @@ import ctypes import getopt import random import requests -import configparser -config = configparser.ConfigParser() -config.read(r'/etc/mqtt_srv/mqtt_srv.cfg') -lala = config.get('morefine', 'right') -print(lala) -print(lala[0]) +with open("/etc/mqtt_srv/mqtt_srv.cfg") as json_file: + config = json.load(json_file) + print(config) + + +print(config["morefine"]) + #import psutil stats = {}