From eea141f263f8ebb6c137d4390b977e8a30fbc553 Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Mon, 9 Oct 2023 10:15:30 -0700 Subject: [PATCH] Complete restart queue Restart queue completed, also adjusted dimensions for dialog boxes. Roadmap: Closes #3 Reference: e1c608c --- README.md | 6 ++++-- setup.sh | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6c44c44..e2f2279 100644 --- a/README.md +++ b/README.md @@ -185,10 +185,12 @@ The following options can be appended to the end of the `./setup.sh` command | Option | Name | Desc | | --- | --- | --- | -| `-t [THEME]` | Theme |
Switches the theme that the interface uses.

`Adwaita`, `Adwaita-dark`, `HighContrast`, `HighContrastInverse`, `ZorinBlue-Light` [^3], `ZorinBlue-Dark` [^3]

| -| `-s` | Silent |
All logging will be disabled

| | `-d` | Dev Mode |
Specialized list of apps will appear instead of the installable list.
Also displays debugging prints.

| +| `-h` | Help |
Display command help

| | `-n` | Dev: Null Run |
Any of the installable applications selected will do a "fake" / null install. No actual install will take place.

Only works without `-d`

| +| `-s` | Silent |
All logging will be disabled

| +| `-t [THEME]` | Theme |
Switches the theme that the interface uses.

`Adwaita`, `Adwaita-dark`, `HighContrast`, `HighContrastInverse`, `ZorinBlue-Light` [^3], `ZorinBlue-Dark` [^3]

| +| `-v` | Version |
Version information

|
diff --git a/setup.sh b/setup.sh index 40d07cb..49ccc37 100644 --- a/setup.sh +++ b/setup.sh @@ -71,6 +71,8 @@ app_file_this=$(basename "$0") app_pid_spin=0 app_pid=$BASHPID app_queue_restart=false +app_queue_restart_id="App Manager" +app_queue_restart_delay=1 app_queue_url=() app_i=0 app_cfg_bDev_str=$([ -n "${OPT_DEV_ENABLE}" ] && echo "Enabled" || echo "Disabled" ) @@ -2401,6 +2403,7 @@ function fn_twk_vbox_additions_fix() echo -e "[ ${STATUS_OK} ]" app_queue_restart=true + app_queue_restart_id="${1}" finish } @@ -3195,12 +3198,15 @@ function show_menu() if [ $RET -eq 0 ]; then answer=$( yad \ --window-icon="/usr/share/grub/themes/zorin/icons/zorin.png" \ - --image dialog-question \ + --center \ + --width=240 \ + --height=125 \ + --fixed \ --title "Install ${res}?" \ --borders=10 \ --button="!gtk-yes!yes:0" \ --button="!gtk-close!exit:1" \ - --text "Are you sure you want to install the app\n\n${res}?" ) + --text "Are you sure you want to install the app\n\n${res}?" ) ANSWER=$? if [ $ANSWER -eq 1 ] || [ $ANSWER -eq 252 ]; then @@ -3226,23 +3232,24 @@ function show_menu() if [ "$app_queue_restart" = true ]; then prompt_reboot=$( yad \ --window-icon="/usr/share/grub/themes/zorin/icons/zorin.png" \ - --image dialog-question \ + --center \ + --width=150 \ + --height=125 \ + --fixed \ --margins=15 \ --borders=10 \ - --width="350" \ - --height="100" \ --title "Restart Required" \ - --button="Restart"\!\!"System restarts in 1 minute":1 \ + --button="Restart"\!\!"System restarts in ${app_queue_restart_delay} minute(s)":1 \ --button="Later"\!gtk-quit\!"Restart Later":0 \ - --text "To complete removal of open-vm-tools, reboot your machine." ) + --text "The app ${app_queue_restart_id} has requested a restart.\nYour machine will reboot in ${app_queue_restart_delay} minute(s)." ) RET=$? if [ $RET -eq 1 ]; then sleep 1 if [ -z "${OPT_DEV_NULLRUN}" ]; then - sudo shutdown -r +1 "System will reboot in 1 minute" >> $LOGS_FILE 2>&1 + sudo shutdown -r +${app_queue_restart_delay} "System will reboot in ${app_queue_restart_delay} minute" >> $LOGS_FILE 2>&1 fi - notify-send -u critical "Restart Pending" "A system restart will occur in 1 minute." >> $LOGS_FILE 2>&1 + notify-send -u critical "Restart Pending" "A system restart will occur in ${app_queue_restart_delay} minute." >> $LOGS_FILE 2>&1 sleep 1 finish sleep 1