Initial implementation of optional tweak menu (design-only, non-functional)

Former-commit-id: 389b77adc683227597f2082920ed153d09a6cb94
Former-commit-id: 6a374155f4661d17a1939dd1911618aec76e78cd
This commit is contained in:
2023-05-12 22:16:11 -04:00
parent 7b3270d70f
commit ebf58b7770
2 changed files with 37 additions and 11 deletions
+23 -2
View File
@@ -161,8 +161,7 @@ def quick_unlock_config(_stdscr):
return _enabled
# ARGUMENT-SPECIFIC FUNCTIONS
# runs configuration wizard
# runs initial configuration wizard
def initial_setup():
# config directory creation
Path(f"{home}/.config/sshyp/devices").mkdir(mode=0o700, parents=True, exist_ok=True)
@@ -256,3 +255,25 @@ def initial_setup():
_lines += 1
_config_file.write('n')
print('\nconfiguration complete\n')
# runs secondary configuration menu
def global_menu(_post_setup):
# curses initialization
_stdscr = initscr()
noecho()
cbreak()
_stdscr.keypad(True)
# a client device is assumed, the server should never show this menu
_options = []
if not _post_setup:
_options = ['change device/synchronization types', 'change gpg key', 're-configure ssh', 'change device name']
_message = 'all configuration options'
_options.extend(['[OPTIONAL, RECOMMENDED] set custom text editor',
'[OPTIONAL, RECOMMENDED] enable/disable quick-unlock',
'[OPTIONAL, NOT IMPLEMENTED] su security mode',
'[OPTIONAL, NOT IMPLEMENTED] extensions and updates', 'exit'])
_message = 'additional configuration options'
_choice = settings_radio(_stdscr, _options, _message)