2017-10-18 12:11:10 -04:00
|
|
|
#!/bin/bash
|
2024-04-22 07:48:54 -04:00
|
|
|
#DivestOS: A mobile operating system divested from the norm.
|
2022-05-01 01:13:46 -04:00
|
|
|
#Copyright (c) 2017-2021 Divested Computing Group
|
2017-11-05 10:58:01 -05:00
|
|
|
#
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
2024-07-27 18:00:56 -04:00
|
|
|
#it under the terms of the GNU Affero General Public License as published by
|
2017-11-05 10:58:01 -05:00
|
|
|
#the Free Software Foundation, either version 3 of the License, or
|
|
|
|
#(at your option) any later version.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2024-07-27 18:00:56 -04:00
|
|
|
#GNU Affero General Public License for more details.
|
2017-11-05 10:58:01 -05:00
|
|
|
#
|
2024-07-27 18:00:56 -04:00
|
|
|
#You should have received a copy of the GNU Affero General Public License
|
2024-07-27 18:31:21 -04:00
|
|
|
#along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2021-10-16 19:15:19 -04:00
|
|
|
umask 0022;
|
2021-10-16 15:28:15 -04:00
|
|
|
set -euo pipefail;
|
2021-10-16 19:15:19 -04:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Shell.sh";
|
2017-10-18 12:11:10 -04:00
|
|
|
|
2017-10-18 19:29:00 -04:00
|
|
|
#Replaces teal accents with orange/yellow ones
|
2021-10-16 16:28:41 -04:00
|
|
|
#Last verified: 2021-10-16
|
2017-10-18 12:11:10 -04:00
|
|
|
|
2018-04-23 08:59:18 -04:00
|
|
|
echo "Applying theme...";
|
2017-10-18 12:11:10 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "frameworks/base"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/#ffe0f2f1/#ff$DOS_THEME_50/" core/res/res/values/colors_material.xml;
|
|
|
|
sed -i "s/#ffb2dfdb/#ff$DOS_THEME_100/" core/res/res/values/colors_material.xml;
|
|
|
|
sed -i "s/#ff80cbc4/#ff$DOS_THEME_200/" core/res/res/values/colors_material.xml;
|
|
|
|
sed -i "s/#ff4db6ac/#ff$DOS_THEME_300/" core/res/res/values/colors_material.xml;
|
|
|
|
sed -i "s/#ff009688/#ff$DOS_THEME_500/" core/res/res/values/colors_material.xml;
|
|
|
|
sed -i "s/#ff00796b/#ff$DOS_THEME_700/" core/res/res/values/colors_material.xml;
|
2018-04-23 08:59:18 -04:00
|
|
|
sed -i "s/#fff4511e/#ffe53935/" core/res/res/values/colors.xml;
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 12:22:19 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "packages/apps/CMParts"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/colors.xml;
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 19:29:00 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "packages/apps/Settings"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/styles.xml;
|
2017-10-19 13:40:10 -04:00
|
|
|
#TODO: Fix: Storage, Profiles
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 12:22:19 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "packages/apps/Trebuchet"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/009688/$DOS_THEME_500/" res/values/*colors.xml;
|
|
|
|
sed -i "s/009688/$DOS_THEME_500/" WallpaperPicker/res/values/colors.xml;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_500" -opaque "#009688" -fuzz 10% res/drawable*/cling_bg.9.png;
|
2017-10-19 13:40:10 -04:00
|
|
|
#TODO: Fix: Open app icon
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 19:08:22 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "packages/apps/Updater"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/colors.xml;
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 19:29:00 -04:00
|
|
|
|
2021-07-08 20:41:33 -04:00
|
|
|
if enter "packages/inputmethods/LatinIME"; then
|
2018-06-29 00:55:21 -04:00
|
|
|
sed -i "s/#80CBC4/#$DOS_THEME_200/" java/res/values/colors.xml;
|
|
|
|
sed -i "s/#4DB6AC/#$DOS_THEME_300/" java/res/values/colors.xml;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_100" -opaque "#b2dfdb" -fuzz 10% java/res/drawable*/*lxx*.png;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_200" -opaque "#80cbc4" -fuzz 10% java/res/drawable*/*lxx*.png;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_300" -opaque "#4db6ac" -fuzz 10% java/res/drawable*/*lxx*.png;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_300" -opaque "#7fcac3" -fuzz 10% java/res/drawable*/*lxx*.png;
|
|
|
|
mogrify -format png -fill "#$DOS_THEME_500" -opaque "#26a69a" -fuzz 10% java/res/drawable*/*lxx*.png;
|
2021-07-08 20:41:33 -04:00
|
|
|
fi;
|
2017-10-18 12:11:10 -04:00
|
|
|
|
2018-06-29 00:55:21 -04:00
|
|
|
cd "$DOS_BUILD_BASE";
|
2021-10-16 15:28:15 -04:00
|
|
|
echo -e "\e[0;32m[SCRIPT COMPLETE] Applied theme\e[0m";
|