diff --git a/bin/executable_setScheme.sh b/bin/executable_setScheme.sh new file mode 100755 index 0000000..9d83edf --- /dev/null +++ b/bin/executable_setScheme.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Set color scheme. +# Color scheme must be present: ~/.config/color-schemes/.scheme.sh +# +# author: Stefan Gaiselmann +# date: 2021-01-22 +# + +SCHEMA_DIR=$HOME/.config/color-schemes +SCHEMA=$1 +SCHEMA_FILE=$SCHEMA_DIR/${SCHEMA}.scheme.sh + +# SCHEMA=${SCHEMA:=$SCHEMA_LIGHT} +# +#case $SCHEMA in +# *dark*|*DARK*) +# SCHEMA_FILE="$HOME/.config/solarized/$SCHEMA_DARK" +# ;; +# *) +# SCHEMA_FILE="$HOME/.config/solarized/$SCHEMA_LIGHT" +# ;; +#esac + +function printUsage() { + local schemaFile=$1 + echo "Schema file not found: $schemaFile" + echo "Current schemas available: " + ls -l "$SCHEMA_DIR" + exit 1 +} + +if [[ -f "$SCHEMA_FILE" ]] +then + source "$SCHEMA_FILE" +else + printUsage "$SCHEMA_FILE" +fi