Gogh icon indicating copy to clipboard operation
Gogh copied to clipboard

Argument to select theme

Open tw1t611 opened this issue 4 years ago • 8 comments

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]"

tw1t611 avatar Apr 11 '20 10:04 tw1t611

Alternatively/additionally to select by name(s). This is really useful for people who want to set up their environment/workspace non-interactively.

tfurf avatar Jun 19 '20 10:06 tfurf

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:

selfup avatar Jun 21 '20 14:06 selfup

I think a temporary workaround is

number=1
echo $number | bash -c "$(wget -qO- https://git.io/vQgMr)"

geodimm avatar Jun 21 '20 14:06 geodimm

@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.

tfurf avatar Jun 23 '20 17:06 tfurf

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.

marko-avlijas avatar Aug 31 '20 17:08 marko-avlijas

I have created a pull request to fix this issue: https://github.com/Mayccoll/Gogh/pull/245

marko-avlijas avatar Aug 31 '20 17:08 marko-avlijas

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

trevor-moon avatar Nov 12 '21 06:11 trevor-moon