aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kernozhitsky <[email protected]>2018-11-25 13:50:48 +0300
committerAlexander Kernozhitsky <[email protected]>2018-11-25 13:50:48 +0300
commitd5f5c7f3d071b14aad0853c5a7882dfa145ca691 (patch)
tree92b218fe1eda9f5354d1b91637a5d93f7c443c63
parent87d5c19115e5f4c2431606b246f601f0dcf8e6d8 (diff)
Minor refactoring in create_theme.sh
-rwxr-xr-xsrc/build_theme.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/build_theme.sh b/src/build_theme.sh
index f5af224..7aafb79 100755
--- a/src/build_theme.sh
+++ b/src/build_theme.sh
@@ -29,7 +29,9 @@ render_theme () {
mv -f "$2" "$HOME/.local/share/themes/"
}
-if [ -z "$1" ]; then
+COLOR_SCHEME="$1"
+
+if [ -z "$COLOR_SCHEME" ]; then
if [ -f "$HOME/.config/kdeglobals" ]; then
render_theme "$HOME/.config/kdeglobals" Breeze
else
@@ -37,12 +39,12 @@ if [ -z "$1" ]; then
render_theme /usr/share/color-schemes/Breeze.colors Breeze
fi
else
- if [ -f "/usr/share/color-schemes/$1.colors" ]; then
- render_theme "/usr/share/color-schemes/$1.colors" "$1"
- elif [ -f "$HOME/.local/share/color-schemes/$1.colors" ]; then
- render_theme "$HOME/.local/share/color-schemes/$1.colors" "$1"
+ if [ -f "/usr/share/color-schemes/$COLOR_SCHEME.colors" ]; then
+ render_theme "/usr/share/color-schemes/$COLOR_SCHEME.colors" "$COLOR_SCHEME"
+ elif [ -f "$HOME/.local/share/color-schemes/$COLOR_SCHEME.colors" ]; then
+ render_theme "$HOME/.local/share/color-schemes/$COLOR_SCHEME.colors" "$COLOR_SCHEME"
else
- echo "colorscheme $1 not found"
+ echo "colorscheme $COLOR_SCHEME not found"
fi
fi