Skip to content

Commit

Permalink
Complete restart queue
Browse files Browse the repository at this point in the history
Restart queue completed, also adjusted dimensions for dialog boxes.

Roadmap: Closes #3
Reference: e1c608c
  • Loading branch information
Aetherinox committed Oct 9, 2023
1 parent e1c608c commit eea141f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ The following options can be appended to the end of the `./setup.sh` command

| Option | Name | Desc |
| --- | --- | --- |
| `-t [THEME]` | Theme | <br /> Switches the theme that the interface uses. <br /><br />`Adwaita`, `Adwaita-dark`, `HighContrast`, `HighContrastInverse`, `ZorinBlue-Light` [^3], `ZorinBlue-Dark` [^3] <br /> <br /> |
| `-s` | Silent | <br /> All logging will be disabled <br /> <br /> |
| `-d` | Dev Mode | <br /> Specialized list of apps will appear instead of the installable list.<br />Also displays debugging prints. <br /> <br /> |
| `-h` | Help | <br /> Display command help <br /> <br /> |
| `-n` | Dev: Null Run | <br /> Any of the installable applications selected will do a "fake" / null install. No actual install will take place. <br /> <br /> Only works without `-d` <br /> <br /> |
| `-s` | Silent | <br /> All logging will be disabled <br /> <br /> |
| `-t [THEME]` | Theme | <br /> Switches the theme that the interface uses. <br /><br />`Adwaita`, `Adwaita-dark`, `HighContrast`, `HighContrastInverse`, `ZorinBlue-Light` [^3], `ZorinBlue-Dark` [^3] <br /> <br /> |
| `-v` | Version | <br /> Version information <br /> <br /> |

<br />

Expand Down
25 changes: 16 additions & 9 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down Expand Up @@ -2401,6 +2403,7 @@ function fn_twk_vbox_additions_fix()
echo -e "[ ${STATUS_OK} ]"

app_queue_restart=true
app_queue_restart_id="${1}"

finish
}
Expand Down Expand Up @@ -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<span color='#3477eb'><b>${res}</b></span>?" )
ANSWER=$?

if [ $ANSWER -eq 1 ] || [ $ANSWER -eq 252 ]; then
Expand All @@ -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 <span color='#3477eb'><b>${app_queue_restart_id}</b></span> has requested a restart.\nYour machine will reboot in <span color='#f41881'><b>${app_queue_restart_delay} minute(s)</b></span>." )
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
Expand Down

0 comments on commit eea141f

Please sign in to comment.