forked from vinceliuice/Layan-kde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·65 lines (53 loc) · 2.8 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
ROOT_UID=0
# Destination directory
if [ "$UID" -eq "$ROOT_UID" ]; then
AURORAE_DIR="/usr/share/aurorae/themes"
SCHEMES_DIR="/usr/share/color-schemes"
PLASMA_DIR="/usr/share/plasma/desktoptheme"
LAYOUT_DIR="/usr/share/plasma/layout-templates"
LOOKFEEL_DIR="/usr/share/plasma/look-and-feel"
KVANTUM_DIR="/usr/share/Kvantum"
WALLPAPER_DIR="/usr/share/wallpapers"
else
AURORAE_DIR="$HOME/.local/share/aurorae/themes"
SCHEMES_DIR="$HOME/.local/share/color-schemes"
PLASMA_DIR="$HOME/.local/share/plasma/desktoptheme"
LAYOUT_DIR="$HOME/.local/share/plasma/layout-templates"
LOOKFEEL_DIR="$HOME/.local/share/plasma/look-and-feel"
KVANTUM_DIR="$HOME/.config/Kvantum"
WALLPAPER_DIR="$HOME/.local/share/wallpapers"
fi
SRC_DIR=$(cd $(dirname $0) && pwd)
THEME_NAME=Layan
COLOR_VARIANTS=('' '-light')
[[ ! -d ${AURORAE_DIR} ]] && mkdir -p ${AURORAE_DIR}
[[ ! -d ${SCHEMES_DIR} ]] && mkdir -p ${SCHEMES_DIR}
[[ ! -d ${PLASMA_DIR} ]] && mkdir -p ${PLASMA_DIR}
[[ ! -d ${LOOKFEEL_DIR} ]] && mkdir -p ${LOOKFEEL_DIR}
[[ ! -d ${KVANTUM_DIR} ]] && mkdir -p ${KVANTUM_DIR}
[[ ! -d ${WALLPAPER_DIR} ]] && mkdir -p ${WALLPAPER_DIR}
install() {
local name=${1}
local color=${2}
[[ ${color} == '-light' ]] && local ELSE_COLOR='Light'
[[ -d ${AURORAE_DIR}/${name}${color} ]] && rm -rf ${AURORAE_DIR}/${name}${color}
[[ -d ${PLASMA_DIR}/${name}${color} ]] && rm -rf ${PLASMA_DIR}/${name}${color}
[[ -f ${SCHEMES_DIR}/${name}${ELSE_COLOR}.colors ]] && rm -rf ${SCHEMES_DIR}/${name}${ELSE_COLOR}.colors
[[ -d ${LOOKFEEL_DIR}/com.github.vinceliuice.${name}${color} ]] && rm -rf ${LOOKFEEL_DIR}/com.github.vinceliuice.${name}${color}
[[ -d ${KVANTUM_DIR}/${name} ]] && rm -rf ${KVANTUM_DIR}/${name}*
[[ -d ${WALLPAPER_DIR}/${name}${color} ]] && rm -rf ${WALLPAPER_DIR}/${name}${color}
cp -r ${SRC_DIR}/aurorae/themes/${name}${color} ${AURORAE_DIR}
cp -r ${SRC_DIR}/color-schemes/${name}${ELSE_COLOR}.colors ${SCHEMES_DIR}
cp -r ${SRC_DIR}/Kvantum/* ${KVANTUM_DIR}
cp -r ${SRC_DIR}/plasma/desktoptheme/common ${PLASMA_DIR}/${name}${color}
cp -r ${SRC_DIR}/plasma/desktoptheme/${name}${color}/* ${PLASMA_DIR}/${name}${color}
cp -r ${SRC_DIR}/color-schemes/${name}${ELSE_COLOR}.colors ${PLASMA_DIR}/${name}${color}/colors
cp -r ${SRC_DIR}/plasma/look-and-feel/com.github.vinceliuice.${name}${color} ${LOOKFEEL_DIR}
cp -r ${SRC_DIR}/wallpaper/${name}${color} ${WALLPAPER_DIR}
}
echo "Installing '${THEME_NAME} kde themes'..."
for color in "${colors[@]:-${COLOR_VARIANTS[@]}}"; do
install "${name:-${THEME_NAME}}" "${color}"
done
echo "Install finished..."