Added secret menu options in hw-diags
This commit is contained in:
parent
964885d63c
commit
0b6cd1cb6c
2 changed files with 47 additions and 0 deletions
|
|
@ -37,6 +37,10 @@ MENU_ACTIONS = (
|
||||||
'Network Test',
|
'Network Test',
|
||||||
'Start',
|
'Start',
|
||||||
'Quit')
|
'Quit')
|
||||||
|
MENU_ACTIONS_SECRET = (
|
||||||
|
'Matrix',
|
||||||
|
'Tubes',
|
||||||
|
)
|
||||||
MENU_OPTIONS = (
|
MENU_OPTIONS = (
|
||||||
'CPU & Cooling',
|
'CPU & Cooling',
|
||||||
'Disk Attributes',
|
'Disk Attributes',
|
||||||
|
|
@ -161,6 +165,8 @@ def build_menu(quick_mode=False):
|
||||||
# Add actions, options, etc
|
# Add actions, options, etc
|
||||||
for action in MENU_ACTIONS:
|
for action in MENU_ACTIONS:
|
||||||
menu.add_action(action)
|
menu.add_action(action)
|
||||||
|
for action in MENU_ACTIONS_SECRET:
|
||||||
|
menu.add_action(action, {'Hidden': True})
|
||||||
for option in MENU_OPTIONS:
|
for option in MENU_OPTIONS:
|
||||||
menu.add_option(option, {'Selected': True})
|
menu.add_option(option, {'Selected': True})
|
||||||
for toggle in MENU_TOGGLES:
|
for toggle in MENU_TOGGLES:
|
||||||
|
|
@ -179,6 +185,9 @@ def build_menu(quick_mode=False):
|
||||||
if platform.system() != 'Linux':
|
if platform.system() != 'Linux':
|
||||||
for name in ('Audio Test', 'Keyboard Test', 'Network Test'):
|
for name in ('Audio Test', 'Keyboard Test', 'Network Test'):
|
||||||
menu.actions[name]['Disabled'] = True
|
menu.actions[name]['Disabled'] = True
|
||||||
|
if platform.system() not in ('Darwin', 'Linux'):
|
||||||
|
for name in ('Matrix', 'Tubes'):
|
||||||
|
menu.actions[name]['Disabled'] = True
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
return menu
|
return menu
|
||||||
|
|
@ -250,6 +259,13 @@ def main():
|
||||||
std.print_standard('')
|
std.print_standard('')
|
||||||
std.pause('Press Enter to return to main menu...')
|
std.pause('Press Enter to return to main menu...')
|
||||||
|
|
||||||
|
# Secrets
|
||||||
|
if 'Matrix' in selection:
|
||||||
|
screensaver('matrix')
|
||||||
|
elif 'Tubes' in selection:
|
||||||
|
# Tubes ≈≈ Pipes?
|
||||||
|
screensaver('pipes')
|
||||||
|
|
||||||
# Quit
|
# Quit
|
||||||
if 'Quit' in selection:
|
if 'Quit' in selection:
|
||||||
break
|
break
|
||||||
|
|
@ -293,5 +309,26 @@ def network_test():
|
||||||
std.pause('Press Enter to return to main menu...')
|
std.pause('Press Enter to return to main menu...')
|
||||||
|
|
||||||
|
|
||||||
|
def screensaver(name):
|
||||||
|
"""Show screensaver"""
|
||||||
|
if name == 'matrix':
|
||||||
|
cmd = ['cmatrix', '-abs']
|
||||||
|
elif name == 'pipes':
|
||||||
|
cmd = [
|
||||||
|
'pipes' if platform.system() == 'Linux' else 'pipes.sh',
|
||||||
|
'-t', '0',
|
||||||
|
'-t', '1',
|
||||||
|
'-t', '2',
|
||||||
|
'-t', '3',
|
||||||
|
'-t', '5',
|
||||||
|
'-R', '-r', '4000',
|
||||||
|
]
|
||||||
|
|
||||||
|
# Switch pane to fullscreen and start screensaver
|
||||||
|
tmux.zoom_pane()
|
||||||
|
exe.run_program(cmd, check=False, pipe=False)
|
||||||
|
tmux.zoom_pane()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print("This file is not meant to be called directly.")
|
print("This file is not meant to be called directly.")
|
||||||
|
|
|
||||||
|
|
@ -197,5 +197,15 @@ def respawn_pane(pane_id, **action):
|
||||||
run_program(cmd, check=False)
|
run_program(cmd, check=False)
|
||||||
|
|
||||||
|
|
||||||
|
def zoom_pane(pane_id=None):
|
||||||
|
"""Toggle zoom status for current or target pane."""
|
||||||
|
cmd = ['tmux', 'resize-pane', '-Z']
|
||||||
|
if pane_id:
|
||||||
|
cmd.extend(['-t', pane_id])
|
||||||
|
|
||||||
|
# Toggle
|
||||||
|
run_program(cmd, check=False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print("This file is not meant to be called directly.")
|
print("This file is not meant to be called directly.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue