diff --git a/README.md b/README.md index 35df933..2137bd8 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,37 @@ A terminal-style home page replicating the tree command.

- +

-## TODO -- [x] Add screenshot to README.md -- [x] add install script - - [ ] Should allow selection of search engine - - [x] Should allow for multiple columns - - [x] User makes a 'config.yaml' file that is parsed and translated into the HTML - - [ ] Allow setting the font size in the config - - [ ] Install the update script into a `$PATH` directory +
+

+ + + + + + + +

+
+ ```yaml -Tree_1: - General: - Google: "https://www.google.com/" - Youtube: "https://www.youtube.com/" - Reddit: - Homepage: "https://www.reddit.com/" - Unixporn: "https://www.reddit.com/r/unixporn/" +font_size: 15 +theme: void + +tree_1: + general: + google: "https://www.google.com/" + youtube: "https://www.youtube.com/" + reddit: + homepage: "https://www.reddit.com/" + unixporn: "https://www.reddit.com/r/unixporn/" ``` + +# Themes + +A variety of themes can be found in the `themes` directory. + +If one wishes to dynamically theme from `pywal`, they may select `pywal` as their chosen theme in `config.yaml`. diff --git a/config.yaml b/config.yaml index 9645a31..ef89585 100644 --- a/config.yaml +++ b/config.yaml @@ -1,22 +1,15 @@ -Tree_1: +font_size: 22 +theme: void +tree_1: general: - nextcloud: "https://cloud.paulhouser.xyz/" - github: "https://www.github.com/Paul-Houser/" - wwu-gitlab: "https://gitlab.cs.wwu.edu/" + github: "https://www.github.com/" gmail: "https://mail.google.com/" reddit: frontpage: - "https://www.reddit.com/" - "front page" - profile: "https://www.reddit.com/u/P_swizzles/" unixporn: "https://www.reddit.com/r/unixporn/" - archlinux: "https://www.reddit.com/r/archlinux/" -Tree_2: - school: - canvas: "https://wwu.instructure.com/" - degreeworks: "https://dw.wwu.edu/Dashboard/dashboard" - outlook: "https://outlook.office.com" - web4u: "https://admin.wwu.edu/pls/wwis/twbkwbis.P_GenMenu?name=bmenu.P_MainMnu" +tree_2: other: archwiki: - "https://archlinux.org/" diff --git a/install.py b/generate.py similarity index 65% rename from install.py rename to generate.py index 8eb5354..d3f00f2 100755 --- a/install.py +++ b/generate.py @@ -56,17 +56,18 @@ def gen_col_headers(html_file, file_dict): def gen_columns(html_file, file_dict): for key in file_dict: - html_file.write("
\n") - html_file.write("
\n") - html_file.write("

.

\n") - html_file.write(" \n") + html_file.write("
\n") + html_file.write("
\n") def gen_html(file_dict): @@ -98,8 +99,36 @@ def gen_html(file_dict): print("Done!") +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] + 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: + if line == "/* font-size */\n": + cache_style.write("font-size: " + str(font_size) + "px;\n") + else: + cache_style.write(line) + def main(): file_dict = parse_yaml() + gen_style(file_dict) gen_html(file_dict) if __name__ == '__main__': diff --git a/StartTree.png b/images/StartTree.png similarity index 100% rename from StartTree.png rename to images/StartTree.png diff --git a/images/forest.png b/images/forest.png new file mode 100644 index 0000000..1493d18 Binary files /dev/null and b/images/forest.png differ diff --git a/images/void.png b/images/void.png new file mode 100644 index 0000000..32a1127 Binary files /dev/null and b/images/void.png differ diff --git a/init.py b/init.py index e67f7c8..cc68948 100755 --- a/init.py +++ b/init.py @@ -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') diff --git a/skeletons/style.css b/skeletons/style.css index 98ae136..4192209 100644 --- a/skeletons/style.css +++ b/skeletons/style.css @@ -1,4 +1,3 @@ -@import url('/home/paul/.cache/wal/colors.css'); @font-face { font-family: "Roboto Mono"; src: url("./Hack.ttf"); @@ -16,7 +15,7 @@ } html { - font-size: 22px; +/* font-size */ } body { diff --git a/themes/black-ice.css b/themes/black-ice.css new file mode 100644 index 0000000..523b860 --- /dev/null +++ b/themes/black-ice.css @@ -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; +} diff --git a/themes/forest.css b/themes/forest.css new file mode 100644 index 0000000..15041eb --- /dev/null +++ b/themes/forest.css @@ -0,0 +1,24 @@ +:root { + /* Special */ + --background: #020303; + --foreground: #9da0a0; + --cursor: #9da0a0; + + /* Colors */ + --color0: #020303; + --color1: #2b3d30; + --color2: #424a55; + --color3: #405642; + --color4: #5b6a55; + --color5: #7f8d76; + --color6: #82908c; + --color7: #9da0a0; + --color8: #3b4242; + --color9: #2b3d30; + --color10: #424a55; + --color11: #405642; + --color12: #5b6a55; + --color13: #7f8d76; + --color14: #82908c; + --color15: #9da0a0; +} diff --git a/themes/void.css b/themes/void.css new file mode 100644 index 0000000..121bca4 --- /dev/null +++ b/themes/void.css @@ -0,0 +1,24 @@ +:root { + /* Special */ + --background: #06070A; + --foreground: #79c4c6; + --cursor: #79c4c6; + + /* Colors */ + --color0: #06070A; + --color1: #175564; + --color2: #066C71; + --color3: #414255; + --color4: #0E7587; + --color5: #64468F; + --color6: #8D419F; + --color7: #79c4c6; + --color8: #54898a; + --color9: #175564; + --color10: #066C71; + --color11: #414255; + --color12: #0E7587; + --color13: #64468F; + --color14: #8D419F; + --color15: #79c4c6; +}