diff --git a/lib-flatpak.sh b/lib-flatpak.sh index 1479441..4e49d69 100755 --- a/lib-flatpak.sh +++ b/lib-flatpak.sh @@ -97,6 +97,10 @@ EOF done < <(flatpak list --runtime --columns=arch:f | sort -u) 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 } diff --git a/lib-install.sh b/lib-install.sh index 7e6e635..07c4ea1 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -708,18 +708,13 @@ flatpak_remove() { local theme="$(destify ${4})" 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 - 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 } connect_flatpak() { - if [[ -w "/root" ]]; then - install_target=system - else - install_target=user - fi for opacity in "${opacities[@]}"; do for alt in "${alts[@]}"; do for theme in "${themes[@]}"; do @@ -789,62 +784,62 @@ customize_theme() { # Change gnome-shell panel transparency 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" fi # Change gnome-shell panel height size 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" fi # Change gnome-shell show apps button style 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" fi # Change Nautilus sidarbar size 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" fi # Change Nautilus style 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" fi # Change Nautilus titlebutton placement style 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" fi # Change maximized window radius 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" fi # Change panel font color if [[ "${monterey}" == 'true' ]]; then 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 "/\$panel_opacity/s/0.15/0.5/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" fi # Change panel font color 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" fi 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!) fi } diff --git a/tweaks.sh b/tweaks.sh index f273c09..03876e1 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -166,6 +166,18 @@ finalize_argument_parsing if [[ "${uninstall}" == 'true' ]]; then 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 prompt -i "Removing '${name}' GDM theme... \n" revert_gdm_theme @@ -189,20 +201,25 @@ if [[ "${uninstall}" == 'true' ]]; then remove_firefox_theme prompt -s "Done! '${name}' Firefox theme has been removed."; echo fi +else + show_needed_dialogs; customize_theme 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 + 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 "Disconnecting '${name}' theme from your Flatpak... \n" - disconnect_flatpak - prompt -s "Done! '${name}' theme has been disconnected from your Flatpak."; echo + if [[ -d "${THEME_DIR}/${name}${color}${opacity}" ]]; then + prompt -i "Connecting '${name}' themes to your Flatpak... \n" + 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 -else - show_needed_dialogs; customize_theme if [[ "${gdm}" == 'true' ]]; then 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." echo 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 if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" ]]; then