mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-04 12:29:35 +01:00
themes: Enhance listing.
This commit is contained in:
parent
59b4c54086
commit
68e20cc90a
@ -118,12 +118,13 @@ def parse_args_exit(parser):
|
|||||||
if args.theme == "list_themes":
|
if args.theme == "list_themes":
|
||||||
themes = [theme.name.replace(".json", "")
|
themes = [theme.name.replace(".json", "")
|
||||||
for theme in theme.list_themes()]
|
for theme in theme.list_themes()]
|
||||||
print("Themes:", themes)
|
print("\n - ".join(["\033[1;32mThemes\033[0m:", *sorted(themes)]))
|
||||||
print("Extra: 'random' (select a random theme)")
|
print("\033[1;32mExtra\033[0m:\n - random (select a random theme)")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.backend == "list_backends":
|
if args.backend == "list_backends":
|
||||||
print("Backends:", colors.list_backends())
|
print("\n - ".join(["\033[1;32mBackends\033[0m:",
|
||||||
|
*colors.list_backends()]))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,9 +12,11 @@ from . import util
|
|||||||
|
|
||||||
def list_themes():
|
def list_themes():
|
||||||
"""List all installed theme files."""
|
"""List all installed theme files."""
|
||||||
return [*os.scandir(os.path.join(CONF_DIR, "colorschemes")),
|
themes = [*os.scandir(os.path.join(CONF_DIR, "colorschemes")),
|
||||||
*os.scandir(os.path.join(MODULE_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):
|
def terminal_sexy_to_wal(data):
|
||||||
"""Convert terminal.sexy json schema to wal."""
|
"""Convert terminal.sexy json schema to wal."""
|
||||||
|
Loading…
Reference in New Issue
Block a user