summaryrefslogtreecommitdiff
path: root/pywal/theme.py
diff options
context:
space:
mode:
authorLorenz Leitner <lorenz.leitner@student.tugraz.at>2019-10-01 10:58:39 +0200
committerLorenz Leitner <lorenz.leitner@student.tugraz.at>2019-10-01 10:58:39 +0200
commit3476989e6bd7a0526ff4dc4d592c8327a4c64f50 (patch)
treeeca68b2f7e9ed20f5678952ccf1102560edef791 /pywal/theme.py
parent3bc9f104518c4b480591c16404a4c04ca4801a7a (diff)
Print (last used) next to last used theme
Diffstat (limited to 'pywal/theme.py')
-rw-r--r--pywal/theme.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pywal/theme.py b/pywal/theme.py
index 423a4c5..5c973da 100644
--- a/pywal/theme.py
+++ b/pywal/theme.py
@@ -19,12 +19,16 @@ def list_out():
user_themes = [theme.name.replace(".json", "")
for theme in list_themes_user()]
+ last_used_theme = util.read_file(os.path.join(CACHE_DIR,
+ "last_used_theme"))[0].replace(".json", "")
+
if user_themes:
print("\033[1;32mUser Themes\033[0m:")
print(" -", "\n - ".join(sorted(user_themes)))
print("\033[1;32mDark Themes\033[0m:")
print(" -", "\n - ".join(sorted(dark_themes)))
+ print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t for t in sorted(dark_themes)))
print("\033[1;32mLight Themes\033[0m:")
print(" -", "\n - ".join(sorted(ligh_themes)))
@@ -116,7 +120,8 @@ def file(input_file, light=False):
if os.path.isfile(theme_file):
logging.info("Set theme to \033[1;37m%s\033[0m.",
os.path.basename(theme_file))
- util.save_file(os.path.basename(theme_file), os.path.join(CACHE_DIR, "theme"))
+ util.save_file(os.path.basename(theme_file), os.path.join(CACHE_DIR,
+ "last_used_theme"))
return parse(theme_file)
logging.error("No %s colorscheme file found.", bri)