This commit is contained in:
Vince 2021-08-23 16:00:41 +08:00
parent c6b450bdd0
commit eb30f9078e
3 changed files with 42 additions and 38 deletions

View file

@ -97,6 +97,10 @@ EOF
done < <(flatpak list --runtime --columns=arch:f | sort -u) done < <(flatpak list --runtime --columns=arch:f | sort -u)
for bundle in "${bundles[@]}"; do for bundle in "${bundles[@]}"; do
flatpak install -y --$install_target "${bundle}" if [[ -w "/root" ]]; then
sudo flatpak install -y --system "${bundle}"
else
udo flatpak install -y --user "${bundle}"
fi
done done
} }

View file

@ -708,18 +708,13 @@ flatpak_remove() {
local theme="$(destify ${4})" local theme="$(destify ${4})"
if [[ -w "/root" ]]; then if [[ -w "/root" ]]; then
flatpak remove -y --system org.gtk.Gtk3theme.${THEME_NAME}${color}${opacity}${alt}${theme} sudo flatpak remove -y --system org.gtk.Gtk3theme.${name}${color}${opacity}${alt}${theme}
else else
flatpak remove -y --user org.gtk.Gtk3theme.${THEME_NAME}${color}${opacity}${alt}${theme} udo flatpak remove -y --user org.gtk.Gtk3theme.${name}${color}${opacity}${alt}${theme}
fi fi
} }
connect_flatpak() { connect_flatpak() {
if [[ -w "/root" ]]; then
install_target=system
else
install_target=user
fi
for opacity in "${opacities[@]}"; do for opacity in "${opacities[@]}"; do
for alt in "${alts[@]}"; do for alt in "${alts[@]}"; do
for theme in "${themes[@]}"; do for theme in "${themes[@]}"; do
@ -789,62 +784,62 @@ customize_theme() {
# Change gnome-shell panel transparency # Change gnome-shell panel transparency
if [[ "${panel_opacity}" != 'default' ]]; then if [[ "${panel_opacity}" != 'default' ]]; then
prompt -s "Changing panel transparency ..." prompt -s "Changing panel transparency ... \n"
sed $SED_OPT "/\$panel_opacity/s/0.15/0.${panel_opacity}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$panel_opacity/s/0.15/0.${panel_opacity}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change gnome-shell panel height size # Change gnome-shell panel height size
if [[ "${panel_size}" != 'default' ]]; then if [[ "${panel_size}" != 'default' ]]; then
prompt -s "Changing panel height size to '${panel_size}'..." prompt -s "Changing panel height size to '${panel_size}'... \n"
sed $SED_OPT "/\$panel_size/s/default/${panel_size}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$panel_size/s/default/${panel_size}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change gnome-shell show apps button style # Change gnome-shell show apps button style
if [[ "${showapps_normal}" == 'true' ]]; then if [[ "${showapps_normal}" == 'true' ]]; then
prompt -s "Changing gnome-shell show apps button style ..." prompt -s "Changing gnome-shell show apps button style ... \n"
sed $SED_OPT "/\$showapps_button/s/bigsur/normal/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$showapps_button/s/bigsur/normal/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change Nautilus sidarbar size # Change Nautilus sidarbar size
if [[ "${sidebar_size}" != 'default' ]]; then if [[ "${sidebar_size}" != 'default' ]]; then
prompt -s "Changing Nautilus sidebar size ..." prompt -s "Changing Nautilus sidebar size ... \n"
sed $SED_OPT "/\$sidebar_size/s/200px/${sidebar_size}px/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$sidebar_size/s/200px/${sidebar_size}px/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change Nautilus style # Change Nautilus style
if [[ "${nautilus_style}" != 'stable' ]]; then if [[ "${nautilus_style}" != 'stable' ]]; then
prompt -s "Changing Nautilus style ..." prompt -s "Changing Nautilus style ... \n"
sed $SED_OPT "/\$nautilus_style/s/stable/${nautilus_style}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$nautilus_style/s/stable/${nautilus_style}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change Nautilus titlebutton placement style # Change Nautilus titlebutton placement style
if [[ "${right_placement}" == 'true' ]]; then if [[ "${right_placement}" == 'true' ]]; then
prompt -s "Changing Nautilus titlebutton placement style ..." prompt -s "Changing Nautilus titlebutton placement style ... \n"
sed $SED_OPT "/\$placement/s/left/right/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$placement/s/left/right/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change maximized window radius # Change maximized window radius
if [[ "${max_round}" == 'true' ]]; then if [[ "${max_round}" == 'true' ]]; then
prompt -s "Changing maximized window style ..." prompt -s "Changing maximized window style ... \n"
sed $SED_OPT "/\$max_window_style/s/square/round/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$max_window_style/s/square/round/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change panel font color # Change panel font color
if [[ "${monterey}" == 'true' ]]; then if [[ "${monterey}" == 'true' ]]; then
black_font="true" black_font="true"
prompt -s "Changing to Monterey style ..." prompt -s "Changing to Monterey style ... \n"
sed $SED_OPT "/\$monterey/s/false/true/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$monterey/s/false/true/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
sed $SED_OPT "/\$panel_opacity/s/0.15/0.5/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$panel_opacity/s/0.15/0.5/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
# Change panel font color # Change panel font color
if [[ "${black_font}" == 'true' ]]; then if [[ "${black_font}" == 'true' ]]; then
prompt -s "Changing panel font color ..." prompt -s "Changing panel font color ... \n"
sed $SED_OPT "/\$panel_font/s/white/black/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" sed $SED_OPT "/\$panel_font/s/white/black/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi fi
if [[ "${compact}" == 'false' ]]; then if [[ "${compact}" == 'false' ]]; then
prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ..." prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ... \n"
#FIXME: @vince is it not implemented yet? (Only Gnome-shell and Gtk theme finished!) #FIXME: @vince is it not implemented yet? (Only Gnome-shell and Gtk theme finished!)
fi fi
} }

View file

@ -166,6 +166,18 @@ finalize_argument_parsing
if [[ "${uninstall}" == 'true' ]]; then if [[ "${uninstall}" == 'true' ]]; then
prompt -w "REMOVAL: Non file-related parameters will be ignored." prompt -w "REMOVAL: Non file-related parameters will be ignored."
if [[ "${snap}" == 'true' ]]; then
prompt -i "Disconnecting '${name}' theme from your installed snap apps... \n"
disconnect_snap
prompt -s "Done! '${name}' theme has been disconnected from your snap apps."; echo
fi
if [[ "${flatpak}" == 'true' ]]; then
prompt -i "Disconnecting '${name}' theme from your Flatpak... \n"
disconnect_flatpak
prompt -s "Done! '${name}' theme has been disconnected from your Flatpak."; echo
fi
if [[ "${gdm}" == 'true' ]]; then if [[ "${gdm}" == 'true' ]]; then
prompt -i "Removing '${name}' GDM theme... \n" prompt -i "Removing '${name}' GDM theme... \n"
revert_gdm_theme revert_gdm_theme
@ -189,20 +201,25 @@ if [[ "${uninstall}" == 'true' ]]; then
remove_firefox_theme remove_firefox_theme
prompt -s "Done! '${name}' Firefox theme has been removed."; echo prompt -s "Done! '${name}' Firefox theme has been removed."; echo
fi fi
else
show_needed_dialogs; customize_theme
if [[ "${snap}" == 'true' ]]; then if [[ "${snap}" == 'true' ]]; then
prompt -i "Disconnecting '${name}' theme from your installed snap apps... \n" prompt -i "Connecting '${name}' theme to your installed snap apps... \n"
disconnect_snap connect_snap
prompt -s "Done! '${name}' theme has been disconnected from your snap apps."; echo prompt -s "Done! '${name}' theme has been connected to your snap apps."; echo
fi fi
if [[ "${flatpak}" == 'true' ]]; then if [[ "${flatpak}" == 'true' ]]; then
prompt -i "Disconnecting '${name}' theme from your Flatpak... \n" if [[ -d "${THEME_DIR}/${name}${color}${opacity}" ]]; then
disconnect_flatpak prompt -i "Connecting '${name}' themes to your Flatpak... \n"
prompt -s "Done! '${name}' theme has been disconnected from your Flatpak."; echo connect_flatpak
prompt -s "Done! '${name}' theme has been connected to your Flatpak."; echo
else
prompt -e "ERROR: Befaore you run '-F' you need install this theme first... \n"
exit 0
fi
fi fi
else
show_needed_dialogs; customize_theme
if [[ "${gdm}" == 'true' ]]; then if [[ "${gdm}" == 'true' ]]; then
prompt -i "Installing '${name}' GDM theme... \n" prompt -i "Installing '${name}' GDM theme... \n"
@ -241,18 +258,6 @@ else
prompt -i "FIREFOX: Anyways, you can also edit 'userChrome.css' and 'customChrome.css' later in your Firefox profile directory." prompt -i "FIREFOX: Anyways, you can also edit 'userChrome.css' and 'customChrome.css' later in your Firefox profile directory."
echo echo
fi fi
if [[ "${snap}" == 'true' ]]; then
prompt -i "Connecting '${name}' theme to your installed snap apps... \n"
connect_snap
prompt -s "Done! '${name}' theme has been connected to your snap apps."; echo
fi
if [[ "${flatpak}" == 'true' ]]; then
prompt -i "Connecting '${name}' themes to your Flatpak... \n"
connect_flatpak
prompt -s "Done! '${name}' theme has been connected to your Flatpak."; echo
fi
fi fi
if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" ]]; then if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" ]]; then