mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-21 16:50:55 +02: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 shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .settings import __version__, CACHE_DIR
|
from .settings import __version__, CACHE_DIR, MODULE_DIR
|
||||||
from . import colors
|
from . import colors
|
||||||
from . import export
|
from . import export
|
||||||
from . import image
|
from . import image
|
||||||
@ -42,8 +42,10 @@ def get_args(args):
|
|||||||
arg.add_argument("-i", metavar="\"/path/to/img.jpg\"",
|
arg.add_argument("-i", metavar="\"/path/to/img.jpg\"",
|
||||||
help="Which image or directory to use.")
|
help="Which image or directory to use.")
|
||||||
|
|
||||||
arg.add_argument("-f", metavar="\"/path/to/colorscheme/file\"",
|
arg.add_argument("-f", metavar="/path/to/colorscheme/file or theme_name",
|
||||||
help="Which colorscheme file to use.")
|
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",
|
arg.add_argument("-g", action="store_true",
|
||||||
help="Generate an oomox theme.")
|
help="Generate an oomox theme.")
|
||||||
@ -122,6 +124,14 @@ def process_args(args):
|
|||||||
image_file = image.get(args.i)
|
image_file = image.get(args.i)
|
||||||
colors_plain = colors.get(image_file, light=args.l)
|
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:
|
if args.f:
|
||||||
colors_plain = colors.file(args.f)
|
colors_plain = colors.file(args.f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user