[core] get output for list of themes/modules

This commit is contained in:
tobi-wan-kenobi 2020-05-01 20:15:39 +02:00
parent 2ab575d190
commit 87915a34e9
4 changed files with 178 additions and 69 deletions

View file

@ -3,6 +3,7 @@ import io
import json
import logging
import copy
import glob
import core.event
import util.algorithm
@ -16,6 +17,17 @@ PATHS=[
os.path.expanduser('~/.config/bumblebee-status/themes'),
]
def themes():
themes_dict = {}
for path in PATHS:
for filename in glob.iglob('{}/*.json'.format(path)):
if 'test' not in filename:
themes_dict[os.path.basename(filename).replace('.json', '')] = 1
result = list(themes_dict.keys())
result.sort()
return result
def merge_replace(value, new_value, key):
if not isinstance(value, dict):
return new_value