mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-25 07:19:27 +01:00
themes: -f with no args lists themes.
This commit is contained in:
parent
3569d10312
commit
98418fc3d0
@ -14,7 +14,7 @@ import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from .settings import __version__, CACHE_DIR
|
||||
from .settings import __version__, CACHE_DIR, MODULE_DIR
|
||||
from . import colors
|
||||
from . import export
|
||||
from . import image
|
||||
@ -42,8 +42,10 @@ def get_args(args):
|
||||
arg.add_argument("-i", metavar="\"/path/to/img.jpg\"",
|
||||
help="Which image or directory to use.")
|
||||
|
||||
arg.add_argument("-f", metavar="\"/path/to/colorscheme/file\"",
|
||||
help="Which colorscheme file to use.")
|
||||
arg.add_argument("-f", metavar="/path/to/colorscheme/file or theme_name",
|
||||
help="Which colorscheme file to use. \
|
||||
Use 'wal -f' to list available builtin themes.",
|
||||
const="list_themes", nargs="?")
|
||||
|
||||
arg.add_argument("-g", action="store_true",
|
||||
help="Generate an oomox theme.")
|
||||
@ -122,6 +124,14 @@ def process_args(args):
|
||||
image_file = image.get(args.i)
|
||||
colors_plain = colors.get(image_file, light=args.l)
|
||||
|
||||
if args.f == "list_themes":
|
||||
themes = os.listdir(os.path.join(MODULE_DIR, "colorschemes"))
|
||||
|
||||
print("Themes:",
|
||||
", ".join([theme.replace(".json", "") for theme in themes]))
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
if args.f:
|
||||
colors_plain = colors.file(args.f)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user