use #2370 height optimization

This commit is contained in:
rootzoll
2021-08-03 15:34:50 +02:00
parent 6254b3f380
commit 949dc19d2c
2 changed files with 5 additions and 52 deletions

View File

@@ -49,9 +49,7 @@ elif [ ${chain} = main ];then
fi fi
# BASIC MENU INFO # BASIC MENU INFO
HEIGHT=19
WIDTH=64 WIDTH=64
CHOICE_HEIGHT=12
BACKTITLE="RaspiBlitz" BACKTITLE="RaspiBlitz"
TITLE="" TITLE=""
MENU="Choose one of the following options:" MENU="Choose one of the following options:"
@@ -72,115 +70,70 @@ fi
# Put Activated Apps on top # Put Activated Apps on top
if [ "${rtlWebinterface}" == "on" ]; then if [ "${rtlWebinterface}" == "on" ]; then
OPTIONS+=(RTL "RTL Web Node Manager") OPTIONS+=(RTL "RTL Web Node Manager")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${BTCPayServer}" == "on" ]; then if [ "${BTCPayServer}" == "on" ]; then
OPTIONS+=(BTCPAY "BTCPay Server Info") OPTIONS+=(BTCPAY "BTCPay Server Info")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${lit}" == "on" ]; then if [ "${lit}" == "on" ]; then
OPTIONS+=(LIT "LIT (loop, pool, faraday)") OPTIONS+=(LIT "LIT (loop, pool, faraday)")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${ElectRS}" == "on" ]; then if [ "${ElectRS}" == "on" ]; then
OPTIONS+=(ELECTRS "Electrum Rust Server") OPTIONS+=(ELECTRS "Electrum Rust Server")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${BTCRPCexplorer}" == "on" ]; then if [ "${BTCRPCexplorer}" == "on" ]; then
OPTIONS+=(EXPLORE "BTC RPC Explorer") OPTIONS+=(EXPLORE "BTC RPC Explorer")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${LNBits}" == "on" ]; then if [ "${LNBits}" == "on" ]; then
OPTIONS+=(LNBITS "LNbits Server") OPTIONS+=(LNBITS "LNbits Server")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${lndmanage}" == "on" ]; then if [ "${lndmanage}" == "on" ]; then
OPTIONS+=(LNDMANAGE "LND Manage Script") OPTIONS+=(LNDMANAGE "LND Manage Script")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${loop}" == "on" ]; then if [ "${loop}" == "on" ]; then
OPTIONS+=(LOOP "Loop In/Out Service") OPTIONS+=(LOOP "Loop In/Out Service")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${mempoolExplorer}" == "on" ]; then if [ "${mempoolExplorer}" == "on" ]; then
OPTIONS+=(MEMPOOL "Mempool Space") OPTIONS+=(MEMPOOL "Mempool Space")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${specter}" == "on" ]; then if [ "${specter}" == "on" ]; then
OPTIONS+=(SPECTER "Cryptoadvance Specter") OPTIONS+=(SPECTER "Cryptoadvance Specter")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${joinmarket}" == "on" ]; then if [ "${joinmarket}" == "on" ]; then
OPTIONS+=(JMARKET "JoinMarket") OPTIONS+=(JMARKET "JoinMarket")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${faraday}" == "on" ]; then if [ "${faraday}" == "on" ]; then
OPTIONS+=(FARADAY "Faraday Channel Management") OPTIONS+=(FARADAY "Faraday Channel Management")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${bos}" == "on" ]; then if [ "${bos}" == "on" ]; then
OPTIONS+=(BOS "Balance of Satoshis") OPTIONS+=(BOS "Balance of Satoshis")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${pyblock}" == "on" ]; then if [ "${pyblock}" == "on" ]; then
OPTIONS+=(PYBLOCK "PyBlock") OPTIONS+=(PYBLOCK "PyBlock")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${thunderhub}" == "on" ]; then if [ "${thunderhub}" == "on" ]; then
OPTIONS+=(THUB "ThunderHub") OPTIONS+=(THUB "ThunderHub")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${zerotier}" == "on" ]; then if [ "${zerotier}" == "on" ]; then
OPTIONS+=(ZEROTIER "ZeroTier") OPTIONS+=(ZEROTIER "ZeroTier")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${pool}" == "on" ]; then if [ "${pool}" == "on" ]; then
OPTIONS+=(POOL "Lightning Pool") OPTIONS+=(POOL "Lightning Pool")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${sphinxrelay}" == "on" ]; then if [ "${sphinxrelay}" == "on" ]; then
OPTIONS+=(SPHINX "Sphinx Chat Relay") OPTIONS+=(SPHINX "Sphinx Chat Relay")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${chantools}" == "on" ]; then if [ "${chantools}" == "on" ]; then
OPTIONS+=(CHANTOOLS "ChannelTools (Fund Rescue)") OPTIONS+=(CHANTOOLS "ChannelTools (Fund Rescue)")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${circuitbreaker}" == "on" ]; then if [ "${circuitbreaker}" == "on" ]; then
OPTIONS+=(CIRCUIT "Circuitbreaker (LND firewall)") OPTIONS+=(CIRCUIT "Circuitbreaker (LND firewall)")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ "${testnet}" == "on" ]&&[ ${chain} != test ];then if [ "${testnet}" == "on" ]&&[ ${chain} != test ]; then
OPTIONS+=(TESTNET "Testnet Service Options") OPTIONS+=(TESTNET "Testnet Service Options")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
if [ ${chain} != main ]; then
if [ ${chain} != main ];then
OPTIONS+=(MAINNET "Mainnet Service Options") OPTIONS+=(MAINNET "Mainnet Service Options")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
# Basic Options # Basic Options
@@ -213,8 +166,6 @@ OPTIONS+=(PASSWORD "Change Passwords")
if [ "${touchscreen}" == "1" ]; then if [ "${touchscreen}" == "1" ]; then
OPTIONS+=(SCREEN "Touchscreen Calibration") OPTIONS+=(SCREEN "Touchscreen Calibration")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi fi
# final Options # final Options
@@ -223,6 +174,8 @@ OPTIONS+=(UPDATE "Check/Prepare RaspiBlitz Update")
OPTIONS+=(REBOOT "Reboot RaspiBlitz") OPTIONS+=(REBOOT "Reboot RaspiBlitz")
OPTIONS+=(OFF "PowerOff RaspiBlitz") OPTIONS+=(OFF "PowerOff RaspiBlitz")
HEIGHT=$(("${#OPTIONS[@]}"))
CHOICE_HEIGHT=$(("${#OPTIONS[@]}" / 2))
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \ --backtitle "$BACKTITLE" \
--title "$TITLE" \ --title "$TITLE" \

View File

@@ -75,7 +75,6 @@ echo "run dialog ..."
# BASIC MENU INFO # BASIC MENU INFO
HEIGHT=19 # add 6 to CHOICE_HEIGHT + MENU lines HEIGHT=19 # add 6 to CHOICE_HEIGHT + MENU lines
WIDTH=45 WIDTH=45
CHOICE_HEIGHT=11 # 1 line / OPTIONS
OPTIONS=() OPTIONS=()
OPTIONS+=(t 'Run behind TOR' ${runBehindTor}) OPTIONS+=(t 'Run behind TOR' ${runBehindTor})
@@ -103,6 +102,7 @@ if [ ${chain} = "main" ];then
fi fi
fi fi
CHOICE_HEIGHT=$(("${#OPTIONS[@]}" / 3))
CHOICES=$(dialog \ CHOICES=$(dialog \
--title ' Node Settings & Options ' \ --title ' Node Settings & Options ' \
--checklist ' use spacebar to activate/de-activate ' \ --checklist ' use spacebar to activate/de-activate ' \