Files
catppuccin-gtk/gtkrc.sh
2022-08-11 21:09:47 -04:00

276 lines
6.3 KiB
Bash
Executable File

make_gtkrc() {
local dest="${1}"
local name="${2}"
local theme="${3}"
local color="${4}"
local size="${5}"
local ctype="${6}"
local window="${7}"
[[ "${color}" == '-Light' ]] && local ELSE_LIGHT="${color}"
[[ "${color}" == '-Dark' ]] && local ELSE_DARK="${color}"
local GTKRC_DIR="${SRC_DIR}/main/gtk-2.0"
local THEME_DIR="${1}/${2}${3}${4}${5}${6}"
if [[ "${color}" != '-Dark' ]]; then
case "$theme" in
'')
theme_color='#b4befe'
;;
-Purple)
theme_color='#ca9ee6'
;;
-Pink)
theme_color='#f4b8e4'
;;
-Red)
theme_color='#e78284'
;;
-Orange)
theme_color='#ef9f76'
;;
-Yellow)
theme_color='#e5c890'
;;
-Green)
theme_color='#a6d189'
;;
-Teal)
theme_color='#babbf1'
;;
-Grey)
theme_color='#7c7f93'
;;
esac
if [[ "$ctype" == '-Nord' ]]; then
case "$theme" in
'')
theme_color='#5e81ac'
;;
-Purple)
theme_color='#b57daa'
;;
-Pink)
theme_color='#cd7092'
;;
-Red)
theme_color='#c35b65'
;;
-Orange)
theme_color='#d0846c'
;;
-Yellow)
theme_color='#e4b558'
;;
-Green)
theme_color='#82ac5d'
;;
-Teal)
theme_color='#83b9b8'
;;
-Grey)
theme_color='#3a4150'
;;
esac
fi
if [[ "$ctype" == '-Dracula' ]]; then
case "$theme" in
'')
theme_color='#a679ec'
;;
-Purple)
theme_color='#a679ec'
;;
-Pink)
theme_color='#f04cab'
;;
-Red)
theme_color='#f44d4d'
;;
-Orange)
theme_color='#f8a854'
;;
-Yellow)
theme_color='#e8f467'
;;
-Green)
theme_color='#4be772'
;;
-Teal)
theme_color='#20eed9'
;;
-Grey)
theme_color='#3c3f51'
;;
esac
fi
else
case "$theme" in
'')
theme_color='#b4befe'
;;
-Purple)
theme_color='#ca9ee6'
;;
-Pink)
theme_color='#f4b8e4'
;;
-Red)
theme_color='#e78284'
;;
-Orange)
theme_color='#ef9f76'
;;
-Yellow)
theme_color='#e5c890'
;;
-Green)
theme_color='#a6d189'
;;
-Teal)
theme_color='#81c8be'
;;
-Grey)
theme_color='#7c7f93'
;;
esac
if [[ "$ctype" == '-Nord' ]]; then
case "$theme" in
'')
theme_color='#89a3c2'
;;
-Purple)
theme_color='#c89dbf'
;;
-Pink)
theme_color='#dc98b1'
;;
-Red)
theme_color='#d4878f'
;;
-Orange)
theme_color='#dca493'
;;
-Yellow)
theme_color='#eac985'
;;
-Green)
theme_color='#a0c082'
;;
-Teal)
theme_color='#83b9b8'
;;
-Grey)
theme_color='#d9dce3'
;;
esac
fi
if [[ "$ctype" == '-Dracula' ]]; then
case "$theme" in
'')
theme_color='#bd93f9'
;;
-Purple)
theme_color='#bd93f9'
;;
-Pink)
theme_color='#ff79c6'
;;
-Red)
theme_color='#ff5555'
;;
-Orange)
theme_color='#ffb86c'
;;
-Yellow)
theme_color='#f1fa8c'
;;
-Green)
theme_color='#50fa7b'
;;
-Teal)
theme_color='#50fae9'
;;
-Grey)
theme_color='#d9dae3'
;;
esac
fi
fi
if [[ "$blackness" == 'true' ]]; then
case "$ctype" in
'')
background_light='#eff1f5'
background_dark='#232634'
background_darker='#11111b'
background_alt='#212121'
titlebar_light='#dce0e8'
titlebar_dark='#232634'
;;
-Nord)
background_light='#f8fafc'
background_dark='#0d0e11'
background_darker='#0f1115'
background_alt='#1c1f26'
titlebar_light='#f0f1f4'
titlebar_dark='#020203'
;;
-Dracula)
background_light='#f9f9fb'
background_dark='#0d0d11'
background_darker='#0f1015'
background_alt='#1c1e26'
titlebar_light='#f0f1f4'
titlebar_dark='#020203'
;;
esac
else
case "$ctype" in
'')
background_light='#eff1f5'
background_dark='#232634'
background_darker='#11111b'
background_alt='#464646'
titlebar_light='#dce0e8'
titlebar_dark='#232634'
;;
-Nord)
background_light='#f8fafc'
background_dark='#242932'
background_darker='#333a47'
background_alt='#3a4150'
titlebar_light='#f0f1f4'
titlebar_dark='#1e222a'
;;
-Dracula)
background_light='#f9f9fb'
background_dark='#242632'
background_darker='#343746'
background_alt='#3c3f51'
titlebar_light='#f0f1f4'
titlebar_dark='#1f2029'
;;
esac
fi
cp -r "${GTKRC_DIR}/gtkrc${ELSE_DARK:-}-default" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#FFFFFF/${background_light}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#2C2C2C/${background_dark}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#464646/${background_alt}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
if [[ "${color}" == '-Dark' ]]; then
sed -i "s/#5b9bf8/${theme_color}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#3C3C3C/${background_darker}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#242424/${titlebar_dark}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
else
sed -i "s/#3c84f7/${theme_color}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
sed -i "s/#F2F2F2/${titlebar_light}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
fi
}