Added script to switch color schemes.
This commit is contained in:
parent
6491065ac4
commit
a411154407
38
bin/executable_setScheme.sh
Executable file
38
bin/executable_setScheme.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Set color scheme.
|
||||
# Color scheme must be present: ~/.config/color-schemes/<NAME>.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
|
||||
Loading…
Reference in New Issue
Block a user