Updates structure in dconf

This commit is contained in:
Alicia Sykes 2022-11-18 20:11:19 +00:00
parent ad4ed0da70
commit dadddea718

View File

@ -25,10 +25,11 @@ PARAMS=$*
show_help () { show_help () {
echo -e "${PRIMARY_COLOR}🐧 Linux Desktop Preferences${RESET_COLOR}\n"\ echo -e "${PRIMARY_COLOR}🐧 Linux Desktop Preferences${RESET_COLOR}\n"\
"${ACCENT_COLOR}This script will apply preferences to the GNOME shell and related applications using dconf\n"\ "${ACCENT_COLOR}This script will apply preferences to the GNOME shell and"\
"Config files are read from ./config/gnome and applied to the dconf database in ~/.config/dconf/[user]\n"\ "related applications using dconf\n Config files are read from"\
"./config/gnome and applied to the dconf database in ~/.config/dconf/[user]\n"\
"Before any changes are made, existing settings are backed up to ~/.cache/dconf-backups/\n"\ "Before any changes are made, existing settings are backed up to ~/.cache/dconf-backups/\n"\
"\nThe following applications will be configured:\n"\ "\n The following applications will be configured:\n"\
" - Calculator\n"\ " - Calculator\n"\
" - Evolution\n"\ " - Evolution\n"\
" - Geddit\n"\ " - Geddit\n"\
@ -47,7 +48,7 @@ fi
# Ask for user confirmation before proceeding (if skip flag isn't passed) # Ask for user confirmation before proceeding (if skip flag isn't passed)
if [[ ! $PARAMS == *"--yes-to-all"* ]]; then if [[ ! $PARAMS == *"--yes-to-all"* ]]; then
echo -e "\n${PRIMARY_COLOR}Would you like to proceed? (y/N)${RESET_COLOR}" echo -e "${PRIMARY_COLOR}Would you like to proceed? (y/N)${RESET_COLOR}"
read -t 15 -n 1 -r read -t 15 -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${ACCENT_COLOR}\nNo worries, nothing will be applied - feel free to come back another time." echo -e "${ACCENT_COLOR}\nNo worries, nothing will be applied - feel free to come back another time."
@ -80,8 +81,7 @@ DCONF_SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)/../../config/gnome"
DCONF_BACKUP_PATH="${DCONF_BACKUP_DIR}/${DCONF_BACKUP_FILE}" DCONF_BACKUP_PATH="${DCONF_BACKUP_DIR}/${DCONF_BACKUP_FILE}"
mkdir -p $DCONF_BACKUP_PATH mkdir -p $DCONF_BACKUP_PATH
# For a given dconf key ($1), and specified file ($2) # For a given dconf key ($1), and specified file ($2), check info, make backup, apply settings
# check input info, backup existing config, then apply new settings
apply_dconf () { apply_dconf () {
dconf_key=$1 dconf_key=$1
dconf_name=$2 dconf_name=$2
@ -94,7 +94,8 @@ apply_dconf () {
# Check source file exists # Check source file exists
if [ ! -f "$DCONF_SOURCE_DIR/$dconf_name.toml" ]; then if [ ! -f "$DCONF_SOURCE_DIR/$dconf_name.toml" ]; then
echo -e "${ERROR_COLOR}⚠ Error, the specified config file for ${dconf_name} doesn't exist in ${DCONF_SOURCE_DIR}${RESET}" echo -e "${ERROR_COLOR}⚠ Error, the specified config file for"\
"'${dconf_name}' doesn't exist in ${DCONF_SOURCE_DIR}${RESET}"
return return
fi fi
@ -117,3 +118,5 @@ apply_dconf '/org/gnome/evolution/' 'evolution'
apply_dconf '/org/gnome/gedit/preferences/' 'gedit' apply_dconf '/org/gnome/gedit/preferences/' 'gedit'
apply_dconf '/org/gnome/gthumb/' 'gthumb' apply_dconf '/org/gnome/gthumb/' 'gthumb'
apply_dconf '/org/gnome/todo/' 'todo' apply_dconf '/org/gnome/todo/' 'todo'
# EOF