Fix system-menu.sh

This commit is contained in:
Alexander Rosenberg 2023-11-27 21:24:02 -08:00
parent 4e733a165b
commit 9388509fe9
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -9,9 +9,11 @@ local entries=('Select system sound output' 'select-sound-output.sh' 'true'
'Power settings (restart and shutdown)' 'system-power-menu.sh' 'true') 'Power settings (restart and shutdown)' 'system-power-menu.sh' 'true')
local entry_array=() local entry_array=()
local enabled_entries=()
for ((i = 1; i <= ${#entries}; i+=3)); do for ((i = 1; i <= ${#entries}; i+=3)); do
if eval "${entries[${i} + 2]}" >/dev/null 2>&1; then if eval "${entries[${i} + 2]}" >/dev/null 2>&1; then
entry_array[$((${i} / 3 + 1))]="${entries[${i}]}" entry_array[$((${i} / 3 + 1))]="${entries[${i}]}"
enabled_entries+=(${entries[@]:${i} - 1:3})
fi fi
done done
@ -20,4 +22,4 @@ choice="$(printf '%s\n' ${entry_array} | fuzzel --index -d)"
(( ${?} != 0 )) && exit (( ${?} != 0 )) && exit
eval "${scripts_dir}/${entries["${choice}" * 3 + 2]}" eval "${scripts_dir}/${enabled_entries["${choice}" * 3 + 2]}"