summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-04-03 12:06:41 +1000
committerDylan Araps <dylan.araps@gmail.com>2018-04-03 12:06:41 +1000
commit68e20cc90a1037bc4f4e16a79bb3add922c5711c (patch)
tree3fe083da62e4c57e733c02caa64edf317f361216
parent59b4c5408608eee60e7273d3a5ed2ba15d489b1d (diff)
themes: Enhance listing.
-rw-r--r--pywal/__main__.py7
-rw-r--r--pywal/theme.py6
2 files changed, 8 insertions, 5 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index f6e8222..a06eab9 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -118,12 +118,13 @@ def parse_args_exit(parser):
if args.theme == "list_themes":
themes = [theme.name.replace(".json", "")
for theme in theme.list_themes()]
- print("Themes:", themes)
- print("Extra: 'random' (select a random theme)")
+ print("\n - ".join(["\033[1;32mThemes\033[0m:", *sorted(themes)]))
+ print("\033[1;32mExtra\033[0m:\n - random (select a random theme)")
sys.exit(0)
if args.backend == "list_backends":
- print("Backends:", colors.list_backends())
+ print("\n - ".join(["\033[1;32mBackends\033[0m:",
+ *colors.list_backends()]))
sys.exit(0)
diff --git a/pywal/theme.py b/pywal/theme.py
index c331d24..b0dbbf6 100644
--- a/pywal/theme.py
+++ b/pywal/theme.py
@@ -12,8 +12,10 @@ from . import util
def list_themes():
"""List all installed theme files."""
- return [*os.scandir(os.path.join(CONF_DIR, "colorschemes")),
- *os.scandir(os.path.join(MODULE_DIR, "colorschemes"))]
+ themes = [*os.scandir(os.path.join(CONF_DIR, "colorschemes")),
+ *os.scandir(os.path.join(MODULE_DIR, "colorschemes"))]
+
+ return [t for t in themes if os.path.isfile(t)]
def terminal_sexy_to_wal(data):