Colloid-gtk-theme/gtkrc.sh

378 lines
9.5 KiB
Bash
Raw Normal View History

2022-02-20 22:17:51 -05:00
make_gtkrc() {
local dest="${1}"
local name="${2}"
local theme="${3}"
local color="${4}"
local size="${5}"
2024-04-12 14:34:30 -04:00
local scheme="${6}"
2022-02-20 22:17:51 -05:00
local window="${7}"
2022-02-15 03:51:51 -05:00
2022-05-14 13:41:43 -04:00
[[ "${color}" == '-Light' ]] && local ELSE_LIGHT="${color}"
[[ "${color}" == '-Dark' ]] && local ELSE_DARK="${color}"
2022-02-20 22:17:51 -05:00
local GTKRC_DIR="${SRC_DIR}/main/gtk-2.0"
local THEME_DIR="${1}/${2}${3}${4}${5}${6}"
2024-04-28 19:28:36 -04:00
case "$theme" in
'')
theme_color_dark='#3c84f7'
theme_color_light='#5b9bf8'
;;
-Purple)
theme_color_dark='#AB47BC'
theme_color_light='#BA68C8'
;;
-Pink)
theme_color_dark='#EC407A'
theme_color_light='#F06292'
;;
-Red)
theme_color_dark='#E53935'
theme_color_light='#F44336'
;;
-Orange)
theme_color_dark='#F57C00'
theme_color_light='#FB8C00'
;;
-Yellow)
theme_color_dark='#FBC02D'
theme_color_light='#FFD600'
;;
-Green)
theme_color_dark='#4CAF50'
theme_color_light='#66BB6A'
;;
-Teal)
theme_color_dark='#009688'
theme_color_light='#4DB6AC'
;;
-Grey)
theme_color_dark='#464646'
theme_color_light='#DDDDDD'
;;
esac
2022-02-15 03:51:51 -05:00
2024-04-28 19:28:36 -04:00
if [[ "$scheme" == '-Nord' ]]; then
case "$theme" in
'')
theme_color_dark='#5e81ac'
theme_color_light='#89a3c2'
;;
-Purple)
theme_color_dark='#b57daa'
theme_color_light='#c89dbf'
;;
-Pink)
theme_color_dark='#cd7092'
theme_color_light='#dc98b1'
;;
-Red)
theme_color_dark='#c35b65'
theme_color_light='#d4878f'
;;
-Orange)
theme_color_dark='#d0846c'
theme_color_light='#dca493'
;;
-Yellow)
theme_color_dark='#e4b558'
theme_color_light='#eac985'
;;
-Green)
theme_color_dark='#82ac5d'
theme_color_light='#a0c082'
;;
-Teal)
theme_color_dark='#63a6a5'
theme_color_light='#83b9b8'
;;
-Grey)
theme_color_dark='#3a4150'
theme_color_light='#d9dce3'
;;
esac
2024-04-28 19:28:36 -04:00
fi
2022-02-15 03:51:51 -05:00
2024-04-28 19:28:36 -04:00
if [[ "$scheme" == '-Dracula' ]]; then
case "$theme" in
'')
theme_color_dark='#a679ec'
theme_color_light='#bd93f9'
;;
-Purple)
theme_color_dark='#a679ec'
theme_color_light='#bd93f9'
;;
-Pink)
theme_color_dark='#f04cab'
theme_color_light='#ff79c6'
;;
-Red)
theme_color_dark='#f44d4d'
theme_color_light='#ff5555'
;;
-Orange)
theme_color_dark='#f8a854'
theme_color_light='#ffb86c'
;;
-Yellow)
theme_color_dark='#e8f467'
theme_color_light='#f1fa8c'
;;
-Green)
theme_color_dark='#4be772'
theme_color_light='#50fa7b'
;;
-Teal)
theme_color_dark='#20eed9'
theme_color_light='#50fae9'
;;
-Grey)
theme_color_dark='#3c3f51'
theme_color_light='#d9dae3'
;;
esac
2024-04-28 19:28:36 -04:00
fi
2022-02-15 03:51:51 -05:00
2024-04-28 19:28:36 -04:00
if [[ "$scheme" == '-Gruvbox' ]]; then
case "$theme" in
'')
theme_color_dark='#458588'
theme_color_light='#83a598'
;;
-Purple)
theme_color_dark='#ab62b1'
theme_color_light='#d386cd'
;;
-Pink)
theme_color_dark='#b16286'
theme_color_light='#d3869b'
;;
-Red)
theme_color_dark='#cc241d'
theme_color_light='#fb4934'
;;
-Orange)
theme_color_dark='#d65d0e'
theme_color_light='#fe8019'
;;
-Yellow)
theme_color_dark='#d79921'
theme_color_light='#fabd2f'
;;
-Green)
theme_color_dark='#98971a'
theme_color_light='#b8bb26'
;;
-Teal)
theme_color_dark='#689d6a'
theme_color_light='#8ec07c'
;;
-Grey)
theme_color_dark='#3c3836'
theme_color_light='#a89984'
;;
esac
2024-04-28 19:28:36 -04:00
fi
2022-02-15 03:51:51 -05:00
2024-04-28 19:28:36 -04:00
if [[ "$scheme" == '-Everforest' ]]; then
case "$theme" in
'')
2024-06-20 09:04:15 -04:00
theme_color_dark='#3a94c5'
theme_color_light='#7fbbb3'
;;
-Purple)
2024-06-20 09:04:15 -04:00
theme_color_dark='#df69ba'
theme_color_light='#D699B6'
;;
-Pink)
theme_color_dark='#b16286'
theme_color_light='#d3869b'
;;
-Red)
2024-06-20 09:04:15 -04:00
theme_color_dark='#f85552'
theme_color_light='#E67E80'
;;
-Orange)
2024-06-20 09:04:15 -04:00
theme_color_dark='#f57d26'
theme_color_light='#E69875'
;;
-Yellow)
2024-06-20 09:04:15 -04:00
theme_color_dark='#dfa000'
theme_color_light='#DBBC7F'
;;
-Green)
2024-06-20 09:04:15 -04:00
theme_color_dark='#8da101'
theme_color_light='#A7C080'
;;
-Teal)
2024-06-20 09:04:15 -04:00
theme_color_dark='#35a77c'
theme_color_light='#83C092'
;;
-Grey)
2024-06-20 09:04:15 -04:00
theme_color_dark='#414b50'
theme_color_light='#e6e2cc'
;;
esac
fi
if [[ "$scheme" == '-Catppuccin' ]]; then
case "$theme" in
'')
theme_color_dark='#1e66f5'
theme_color_light='#8caaee'
;;
-Purple)
theme_color_dark='#8839ef'
theme_color_light='#ca9ee6'
;;
-Pink)
theme_color_dark='#ea76cb'
theme_color_light='#f4b8e4'
;;
-Red)
theme_color_dark='#e64553'
theme_color_light='#ea999c'
;;
-Orange)
theme_color_dark='#fe640b'
theme_color_light='#fe8019'
;;
-Yellow)
theme_color_dark='#df8e1d'
theme_color_light='#ef9f76'
;;
-Green)
theme_color_dark='#40a02b'
theme_color_light='#a6d189'
;;
-Teal)
theme_color_dark='#179299'
theme_color_light='#81c8be'
;;
-Grey)
theme_color_dark='#5c5f77'
theme_color_light='#ccd0da'
;;
esac
2022-02-15 03:51:51 -05:00
fi
2022-02-20 22:17:51 -05:00
if [[ "$blackness" == 'true' ]]; then
2024-04-12 14:34:30 -04:00
case "$scheme" in
2022-02-20 22:17:51 -05:00
'')
background_light='#FFFFFF'
background_dark='#0F0F0F'
background_darker='#121212'
background_alt='#212121'
titlebar_light='#F2F2F2'
titlebar_dark='#030303'
;;
2022-05-14 13:41:43 -04:00
-Nord)
2022-02-20 22:17:51 -05:00
background_light='#f8fafc'
background_dark='#0d0e11'
background_darker='#0f1115'
background_alt='#1c1f26'
titlebar_light='#f0f1f4'
titlebar_dark='#020203'
;;
2022-05-14 13:41:43 -04:00
-Dracula)
2022-02-20 22:17:51 -05:00
background_light='#f9f9fb'
background_dark='#0d0d11'
background_darker='#0f1015'
background_alt='#1c1e26'
titlebar_light='#f0f1f4'
titlebar_dark='#020203'
;;
2024-04-28 19:28:36 -04:00
-Gruvbox)
background_light='#f9f5d7'
background_dark='#0f0e0e'
background_darker='#121110'
background_alt='#211f1e'
titlebar_light='#fbf1c7'
titlebar_dark='#0d0907'
;;
2024-02-22 13:03:48 -05:00
-Everforest)
background_light='#fffbef'
background_dark='#1e2326'
background_darker='#232a2e'
background_alt='#293136'
titlebar_light='#f2efdf'
titlebar_dark='#020203'
;;
-Catppuccin)
background_light='#eff1f5'
background_dark='#181825'
background_darker='#1e1e2e'
background_alt='#232634'
titlebar_light='#e6e9ef'
titlebar_dark='#11111b'
;;
2022-02-20 22:17:51 -05:00
esac
else
2024-04-12 14:34:30 -04:00
case "$scheme" in
2022-02-20 22:17:51 -05:00
'')
background_light='#FFFFFF'
background_dark='#2C2C2C'
background_darker='#3C3C3C'
background_alt='#464646'
titlebar_light='#F2F2F2'
titlebar_dark='#242424'
;;
2022-05-14 13:41:43 -04:00
-Nord)
2022-02-15 03:51:51 -05:00
background_light='#f8fafc'
background_dark='#242932'
background_darker='#333a47'
background_alt='#3a4150'
2022-02-19 09:57:13 -05:00
titlebar_light='#f0f1f4'
titlebar_dark='#1e222a'
2022-02-15 03:51:51 -05:00
;;
2022-05-14 13:41:43 -04:00
-Dracula)
2022-02-15 03:51:51 -05:00
background_light='#f9f9fb'
background_dark='#242632'
background_darker='#343746'
background_alt='#3c3f51'
2022-02-19 09:57:13 -05:00
titlebar_light='#f0f1f4'
titlebar_dark='#1f2029'
2022-02-15 03:51:51 -05:00
;;
2024-04-28 19:28:36 -04:00
-Gruvbox)
background_light='#f9f5d7'
background_dark='#282524'
background_darker='#3c3836'
background_alt='#504945'
titlebar_light='#fbf1c7'
titlebar_dark='#242220'
;;
2024-02-22 13:03:48 -05:00
-Everforest)
2024-06-17 23:24:39 -04:00
background_light='#fdf6e3'
background_dark='#2d353b'
background_darker='#343f44'
background_alt='#414b50'
titlebar_light='#f4f0d9'
titlebar_dark='#272e33'
2024-02-22 13:03:48 -05:00
;;
-Catppuccin)
background_light='#eff1f5'
background_dark='#292c3c'
background_darker='#303446'
background_alt='#4c4f69'
titlebar_light='#e6e9ef'
titlebar_dark='#24273a'
;;
2022-02-15 03:51:51 -05:00
esac
fi
2022-02-20 22:17:51 -05:00
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"
2022-02-15 03:51:51 -05:00
2022-05-14 13:41:43 -04:00
if [[ "${color}" == '-Dark' ]]; then
2024-04-28 19:28:36 -04:00
sed -i "s/#5b9bf8/${theme_color_light}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
2022-02-20 22:17:51 -05:00
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
2024-04-28 19:28:36 -04:00
sed -i "s/#3c84f7/${theme_color_dark}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
2022-02-20 22:17:51 -05:00
sed -i "s/#F2F2F2/${titlebar_light}/g" "${THEME_DIR}/gtk-2.0/gtkrc"
fi
}