diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 657a4be..4dee7a7 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -1,5 +1,6 @@ import os import json +import yaml import glob def getpath(): @@ -12,8 +13,13 @@ def themes(): class Theme: def __init__(self, config): self._config = config - with open("{}/{}.json".format(getpath(), config.theme())) as f: - self._data = json.load(f) + + if os.path.isfile("{}/{}.yaml".format(getpath(), config.theme())): + with open("{}/{}.yaml".format(getpath(), config.theme())) as f: + self._data = yaml.load(f) + else: + with open("{}/{}.json".format(getpath(), config.theme())) as f: + self._data = json.load(f) self._defaults = self._data.get("defaults", {}) self._cycles = self._defaults.get("cycle", []) self.begin() diff --git a/bumblebee/themes/default.yaml b/bumblebee/themes/default.yaml new file mode 100644 index 0000000..4beca6d --- /dev/null +++ b/bumblebee/themes/default.yaml @@ -0,0 +1,60 @@ +defaults: + prefix: " " + suffix: " " + urgent: true + fg: "#aabbcc" +date: + prefix: " " +time: + prefix: " " +memory: + prefix: " ram " +cpu: + prefix: " cpu " +disk: + prefix: " hdd " +dnf: + prefix: " dnf " +pasink: + states: + muted: + prefix: " audio(mute) " + unmuted: + prefix: " audio " +pasource: + states: + muted: + prefix: " mic(mute) " + unmuted: + prefix: " mic " +nic: + states: + "wireless-up": + prefix: " wifi " + "wireless-down": + prefix: " wifi " + "wired-up": + prefix: " lan " + "wired-down": + prefix: " lan " + "tunnel-up": + prefix: " tun " + "tunnel-down": + prefix: " tun " +battery: + states: + charged: + suffix: " full " + charging: + suffix: " chr " + discharging_critical: + prefix: " ! " + suffix: " dis " + discharging_low: + suffix: " dis " + discharging_medium: + suffix: " dis " + discharging_high: + suffix: " dis " + discharging_full: + suffix: " dis "