From 88184c858172474757375c2a92882afecd5a3b60 Mon Sep 17 00:00:00 2001 From: Aetnaeus Date: Sat, 5 Jun 2021 23:40:08 -0400 Subject: [PATCH] Updated documentation. --- README.md | 33 +++++++++++++++++---------------- theme.sh | 6 +++--- theme_base.sh | 6 +++--- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 91513b4..930078e 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,23 @@ One theme script to rule them all. - Lets you keep your shell's init file as the single source of truth. - Lets you script theme changes +# Installation + +Simply put `theme.sh` somewhere in your path. + +E.G + +``` +sudo curl -o /usr/bin/theme.sh 'https://raw.githubusercontent.com/lemnos/theme.sh/master/theme.sh' && sudo chmod +x /usr/bin/theme.sh +``` + # Usage -Put theme.sh somewhere in your `$PATH` -Then: +``` +Usage: theme.sh [--light] [--dark] [-l|--list] [-i|--interactive] [-i2|--interactive2] [-r|--random] [-a|--add ] +``` ``` > theme.sh -l @@ -50,19 +61,7 @@ Once you find something you like simply put theme.sh ``` -in your `~/.bashrc` - -See the output of `theme.sh` for a list of options. - -Note that `--dark` and `--light` can be used to filter most options. - -E.G - -``` -theme.sh --light -r -``` - -will select a random light theme. +in your `~/.bashrc`. # Configuration @@ -111,7 +110,9 @@ theme.sh --add Solarized_Darcula.conf theme.sh Solarized_Darcula ``` -Note that if a theme with the same name already exists it will be overwritten. +If a theme with the same name already exists it will be overwritten. + +Note that adding themes requires write access to the script and may require `sudo` for system-wide installations. If you find a theme that is already not included in the script you are encouraged to submit a PR (see CONTRIBUTING.md). diff --git a/theme.sh b/theme.sh index aa8131d..3680306 100755 --- a/theme.sh +++ b/theme.sh @@ -203,11 +203,11 @@ add() { awk '{print} /^# Themes/ { exit }' "$0" > "$tmp2" normalize_themes "$tmp1" >> "$tmp2" - printf 'Successfully annexed %d themes. More! Feed me more!\n' $# rm "$tmp1" - mv "$tmp2" "$0" - chmod +x "$0" + cat "$tmp2" > "$0" || exit $? + + printf 'Successfully annexed %d themes. More! Feed me more!\n' $# } preview2() { diff --git a/theme_base.sh b/theme_base.sh index 078880b..82754bb 100644 --- a/theme_base.sh +++ b/theme_base.sh @@ -203,11 +203,11 @@ add() { awk '{print} /^# Themes/ { exit }' "$0" > "$tmp2" normalize_themes "$tmp1" >> "$tmp2" - printf 'Successfully annexed %d themes. More! Feed me more!\n' $# rm "$tmp1" - mv "$tmp2" "$0" - chmod +x "$0" + cat "$tmp2" > "$0" || exit $? + + printf 'Successfully annexed %d themes. More! Feed me more!\n' $# } preview2() {