mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-23 11:01:31 +02:00
remove ref to 9 cols themes
This commit is contained in:
parent
42efe31c95
commit
558b7e2796
@ -16,10 +16,6 @@ def list_out():
|
|||||||
for theme in list_themes()]
|
for theme in list_themes()]
|
||||||
ligh_themes = [theme.name.replace(".json", "")
|
ligh_themes = [theme.name.replace(".json", "")
|
||||||
for theme in list_themes(dark=False)]
|
for theme in list_themes(dark=False)]
|
||||||
dark9_themes = [theme.name.replace(".json", "")
|
|
||||||
for theme in list_themes(nine=True)]
|
|
||||||
ligh9_themes = [theme.name.replace(".json", "")
|
|
||||||
for theme in list_themes(dark=False,nine=True)]
|
|
||||||
user_themes = [theme.name.replace(".json", "")
|
user_themes = [theme.name.replace(".json", "")
|
||||||
for theme in list_themes_user()]
|
for theme in list_themes_user()]
|
||||||
|
|
||||||
@ -37,14 +33,8 @@ def list_out():
|
|||||||
print("\033[1;32mDark Themes\033[0m:")
|
print("\033[1;32mDark Themes\033[0m:")
|
||||||
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
||||||
for t in sorted(dark_themes)))
|
for t in sorted(dark_themes)))
|
||||||
print("\033[1;32mDark9 Themes\033[0m:")
|
|
||||||
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
|
||||||
for t in sorted(dark9_themes)))
|
|
||||||
|
|
||||||
print("\033[1;32mLight Themes\033[0m:")
|
print("\033[1;32mLight Themes\033[0m:")
|
||||||
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
|
||||||
for t in sorted(ligh_themes)))
|
|
||||||
print("\033[1;32mLight9 Themes\033[0m:")
|
|
||||||
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t
|
||||||
for t in sorted(ligh_themes)))
|
for t in sorted(ligh_themes)))
|
||||||
|
|
||||||
@ -55,11 +45,10 @@ def list_out():
|
|||||||
print(" - random_user (select a random user theme)")
|
print(" - random_user (select a random user theme)")
|
||||||
|
|
||||||
|
|
||||||
def list_themes(dark=True, nine=False):
|
def list_themes(dark=True):
|
||||||
"""List all installed theme files."""
|
"""List all installed theme files."""
|
||||||
dark = "dark" if dark else "light"
|
dark = "dark" if dark else "light"
|
||||||
nine = "9" if nine else "16"
|
themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark))
|
||||||
themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark, nine))
|
|
||||||
return [t for t in themes if os.path.isfile(t.path)]
|
return [t for t in themes if os.path.isfile(t.path)]
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +91,7 @@ def parse(theme_file):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def get_random_theme(dark=True, nine=False):
|
def get_random_theme(dark=True):
|
||||||
"""Get a random theme file."""
|
"""Get a random theme file."""
|
||||||
themes = [theme.path for theme in list_themes(dark)]
|
themes = [theme.path for theme in list_themes(dark)]
|
||||||
random.shuffle(themes)
|
random.shuffle(themes)
|
||||||
@ -116,17 +105,16 @@ def get_random_theme_user():
|
|||||||
return themes[0]
|
return themes[0]
|
||||||
|
|
||||||
|
|
||||||
def file(input_file, light=False, nine=False):
|
def file(input_file, light=False):
|
||||||
"""Import colorscheme from json file."""
|
"""Import colorscheme from json file."""
|
||||||
util.create_dir(os.path.join(CONF_DIR, "colorschemes/light/"))
|
util.create_dir(os.path.join(CONF_DIR, "colorschemes/light/"))
|
||||||
util.create_dir(os.path.join(CONF_DIR, "colorschemes/dark/"))
|
util.create_dir(os.path.join(CONF_DIR, "colorschemes/dark/"))
|
||||||
|
|
||||||
theme_name = ".".join((input_file, "json"))
|
theme_name = ".".join((input_file, "json"))
|
||||||
bri = "light" if light else "dark"
|
bri = "light" if light else "dark"
|
||||||
full16 = "9" if nine else "16"
|
|
||||||
|
|
||||||
user_theme_file = os.path.join(CONF_DIR, "colorschemes", full16, bri, theme_name)
|
user_theme_file = os.path.join(CONF_DIR, "colorschemes", bri, theme_name)
|
||||||
theme_file = os.path.join(MODULE_DIR, "colorschemes", full16, bri, theme_name)
|
theme_file = os.path.join(MODULE_DIR, "colorschemes", bri, theme_name)
|
||||||
|
|
||||||
# Find the theme file.
|
# Find the theme file.
|
||||||
if input_file in ("random", "random_dark"):
|
if input_file in ("random", "random_dark"):
|
||||||
@ -158,11 +146,9 @@ def file(input_file, light=False, nine=False):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def save(colors, theme_name, light=False, nine=False):
|
def save(colors, theme_name, light=False):
|
||||||
"""Save colors to a theme file."""
|
"""Save colors to a theme file."""
|
||||||
theme_file = theme_name + ".json"
|
theme_file = theme_name + ".json"
|
||||||
theme_path = os.path.join(CONF_DIR, "colorschemes",
|
theme_path = os.path.join(CONF_DIR, "colorschemes",
|
||||||
"9" if nine else "16",
|
"light" if light else "dark", theme_file)
|
||||||
"light" if light else "dark",
|
|
||||||
theme_file)
|
|
||||||
util.save_file_json(colors, theme_path)
|
util.save_file_json(colors, theme_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user