Skip to content

Commit

Permalink
basic structure
Browse files Browse the repository at this point in the history
  • Loading branch information
suvanbanerjee committed Oct 9, 2024
1 parent 6ae940f commit 5a7afae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 37 deletions.
42 changes: 5 additions & 37 deletions tui/autoconfig.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1,14 @@
#!/bin/env bash

##TODO - ask for gender and online prefrence and find regin using tekemetry ip (countryccode-regioncode)

export CONFIG_AUTOCONFIG = "true"
export CONFIG_MODE = "online"
export AUTOCONFIG = "true"

# shellcheck source=locales/en-us/autoconfig.sh
source "tui/locales/$LOCALE/autoconfig.sh"

whiptail --yesno --no-button "$NO_BUTTON" --yes-button "$YES_BUTTON" --title "$TITLE" "$CONTENT" "$TUI_WINDOW_HEIGHT" "$TUI_WINDOW_WIDTH"


export CONFIG_MODE = "online"
export CONFIG_GENDER = "female"

features=("skills" "$SKILL_DESCRIPTION" ON)
features+=("extra-skills" "$EXTRA_SKILL_DESCRIPTION" OFF)
if [[ "$RASPBERRYPI_MODEL" != *"Raspberry Pi 3"* ]] && [[ "$KERNEL" != *"microsoft"* ]] && [ "$PROFILE" != "server" ]; then
features+=("gui" "$GUI_DESCRIPTION" OFF)
fi

OVOS_FEATURES=$(whiptail --separate-output --title "$TITLE" \
--checklist "$CONTENT" --cancel-button "$BACK_BUTTON" --ok-button "$OK_BUTTON" --yes-button "$OK_BUTTON" "$TUI_WINDOW_HEIGHT" "$TUI_WINDOW_WIDTH" "${#features[@]}" "${features[@]}" 3>&1 1>&2 2>&3)
export AUTOCONFIG = "true"
whiptail --yesno --defaultno --no-button "$NO_BUTTON" --yes-button "$YES_BUTTON" --title "$TITLE" "$CONTENT" "$TUI_WINDOW_HEIGHT" "$TUI_WINDOW_WIDTH"

exit_status=$?

if [ "$exit_status" -ne 0 ]; then
source tui/telemetry.sh
if [ "$exit_status" -ne 1 ]; then
source autoconfig/main.sh
fi

for FEATURE in $OVOS_FEATURES; do
case "$FEATURE" in
"gui")
export FEATURE_GUI="true"
;;
"skills")
export FEATURE_SKILLS="true"
;;
"extra-skills")
export FEATURE_EXTRA_SKILLS="true"
;;
esac
done

export AUTOCONFIG = "false"
Empty file added tui/autoconfig/gender.sh
Empty file.
2 changes: 2 additions & 0 deletions tui/autoconfig/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/env bash

Empty file added tui/autoconfig/mode.sh
Empty file.

0 comments on commit 5a7afae

Please sign in to comment.