Gogh
Gogh copied to clipboard
Argument to select theme
Hi,
could you please add an argument to select the theme automatically? This would be useful for people, who want to set up their systems via a script.
It could be something like
bash -c "$(wget -qO- https://git.io/vQgMr) [number]"
Alternatively/additionally to select by name(s). This is really useful for people who want to set up their environment/workspace non-interactively.
I would assume something like:
if [[ ! $1 -eq "" ]]
then
# check $1 is valid
# apply theme
fi
Would be a good start.
You would then need to make sure it's within the number range to ensure the data is valid :upside_down_face:
I think a temporary workaround is
number=1
echo $number | bash -c "$(wget -qO- https://git.io/vQgMr)"
@Mayccoll , would some light refactoring be welcome in a PR for this? Basically, in order to build a list of scripts, I need to separate out OPTIONS
from the call of set_gogh
. Then, depending on CLI arguments, we go to interactive mode (as is, query OPTIONS
), numbered mode (use args as OPTIONS
), or named mode (go straight from list of names to list of themes, not indices). The default user experience does not change in any way.
Argument to select theme by number is useless for scripting because as new themes are added numbers will change and scripts will get broken. Themes must be chosen by name.
It is not necessary to make any changes in code because this functionality is already there.
I would only add to readme section about how to install in non interactive mode:
# clone the repo into "$HOME/src/gogh"
mkdir -p "$HOME/src"
cd "$HOME/src"
git clone https://github.com/Mayccoll/Gogh.git gogh
cd gogh/themes
# necessary on ubuntu
export TERMINAL=gnome-terminal
# install themes
./atom.sh
./dracula.sh
# some themes are not executable so make them executable before you install them
chmod +x ./palenight.sh
./palenight.sh
This would have saved me a couple of hours.
I have created a pull request to fix this issue: https://github.com/Mayccoll/Gogh/pull/245
Alternatively/additionally to select by name(s). This is really useful for people who want to set up their environment/workspace non-interactively.
I have a personal script gogh-themes
that performs all the setup of non-interactive use case and installs themes by name (see below)
https://user-images.githubusercontent.com/29641134/141422528-e2a343c8-7a8e-48e5-998b-aceb7b89cbd2.mov