added theme selection

This commit is contained in:
Paul Houser 2020-08-24 15:52:49 -07:00
parent a2fd07f2df
commit 0da73d49ed
5 changed files with 39 additions and 7 deletions

View File

@ -1,4 +1,5 @@
font_size: 22
theme: void
tree_1:
general:
github: "https://www.github.com/"

View File

@ -21,11 +21,6 @@ config_path = home + '/.config/StartTree/config.yaml'
# get cache path
cache_dir = home + '/.cache/StartTree'
def prettifyHTML(html):
soup = BeautifulSoup(html, 'html.parser')
prettyHTML = soup.prettify()
return prettyHTML
def setup():
# check if .config path exists
if not os.path.isdir(home + '/.config'):
@ -57,6 +52,9 @@ def setup():
print("Creating '" + cache_dir + "'...")
os.mkdir(cache_dir)
print("symlinking themes")
os.symlink(os.getcwd() + '/themes', home + '/.cache/StartTree/themes')
print("Creating '" + cache_dir + "/styles'")
os.mkdir(cache_dir + '/styles')

View File

@ -103,11 +103,21 @@ def gen_style(file_dict):
skeleton_style = open('./skeletons/style.css', 'r')
cache_style = open(cache_dir + '/styles/style.css', 'w')
# find style attributes in file_dict
font_size = 20
theme = "void"
for key in file_dict:
if key == "font_size":
font_size = file_dict[key]
break
if key == "theme":
theme = file_dict[key]
if theme == "pywal":
theme = home + '/.cache/wal/colors.css'
else:
theme = '../themes/' + theme + '.css'
cache_style.write("@import url('" + theme + "');\n")
lines = skeleton_style.readlines()
for line in lines:

View File

@ -1,4 +1,3 @@
@import url('/home/paul/.cache/wal/colors.css');
@font-face {
font-family: "Roboto Mono";
src: url("./Hack.ttf");

24
themes/black-ice.css Normal file
View File

@ -0,0 +1,24 @@
:root {
/* Special */
--background: #000000;
--foreground: #9a9c9f;
--cursor: #9a9c9f;
/* Colors */
--color0: #000000;
--color1: #04294d;
--color2: #2d2d2d;
--color3: #094c57;
--color4: #176485;
--color5: #585a5a;
--color6: #62909b;
--color7: #9a9c9f;
--color8: #36393f;
--color9: #04294d;
--color10: #2d2d2d;
--color11: #094c57;
--color12: #176485;
--color13: #585a5a;
--color14: #62909b;
--color15: #9a9c9f;
}