Compare commits
15 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 569a77edf2 | |||
| 91d8185ede | |||
| 18daa41e2a | |||
| 747277b121 | |||
| b8e09e83ce | |||
| e798503f6f | |||
| 063ebc947e | |||
| 5b5c99e6f8 | |||
| c50627867e | |||
| e30e52e880 | |||
| 90f5285067 | |||
| 441a6ad66f | |||
| 87668c6ad0 | |||
| d1af82e114 | |||
| dba39dd9c4 |
19 changed files with 212 additions and 175 deletions
|
|
@ -2,42 +2,10 @@
|
|||
#
|
||||
## Wizard Kit: ddrescue TUI Launcher
|
||||
|
||||
source launch-in-tmux
|
||||
|
||||
SESSION_NAME="ddrescue-tui"
|
||||
WINDOW_NAME="ddrescue TUI"
|
||||
MENU="ddrescue-tui-menu"
|
||||
|
||||
function ask() {
|
||||
while :; do
|
||||
read -p "$1 " -r answer
|
||||
if echo "$answer" | egrep -iq '^(y|yes|sure)$'; then
|
||||
return 0
|
||||
elif echo "$answer" | egrep -iq '^(n|no|nope)$'; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
die () {
|
||||
echo "$0:" "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check for running session
|
||||
if tmux list-session | grep -q "$SESSION_NAME"; then
|
||||
echo "WARNING: tmux session $SESSION_NAME already exists."
|
||||
echo ""
|
||||
if ask "Kill current session?"; then
|
||||
tmux kill-session -t "$SESSION_NAME" || \
|
||||
die "Failed to kill session: $SESSION_NAME"
|
||||
else
|
||||
echo "Aborted."
|
||||
echo ""
|
||||
echo -n "Press Enter to exit... "
|
||||
read -r
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start session
|
||||
tmux new-session -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $*
|
||||
TMUX_CMD="ddrescue-tui-menu"
|
||||
|
||||
launch_in_tmux "$@"
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ if __name__ == '__main__':
|
|||
# Done
|
||||
print_standard('\nDone.')
|
||||
pause("Press Enter to exit...")
|
||||
tmux_switch_client()
|
||||
exit_script()
|
||||
except GenericAbort:
|
||||
abort()
|
||||
|
|
@ -55,6 +56,7 @@ if __name__ == '__main__':
|
|||
print_error(msg)
|
||||
abort()
|
||||
except SystemExit as sys_exit:
|
||||
tmux_switch_client()
|
||||
exit_script(sys_exit.code)
|
||||
except:
|
||||
major_exception()
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ class RecoveryState():
|
|||
raise GenericError('Unsupported mode')
|
||||
self.get_smart_source()
|
||||
self.set_working_dir()
|
||||
os.makedirs(global_vars['LogDir'], exist_ok=True)
|
||||
|
||||
def add_block_pair(self, source, dest):
|
||||
"""Run safety checks and append new BlockPair to internal list."""
|
||||
|
|
@ -850,7 +851,7 @@ def menu_ddrescue(source_path, dest_path, run_mode):
|
|||
menu_main(state)
|
||||
|
||||
# Done
|
||||
run_program(['tmux', 'kill-window'])
|
||||
tmux_kill_all_panes()
|
||||
exit_script()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ class CpuObj():
|
|||
continue
|
||||
self.lscpu[_field] = _data
|
||||
|
||||
# Get RAM details as well
|
||||
ram_details = get_ram_details()
|
||||
self.ram_total = human_readable_size(ram_details.pop('Total', 0)).strip()
|
||||
self.ram_dimms = [
|
||||
'{}x {}'.format(v, k) for k, v in sorted(ram_details.items())]
|
||||
|
||||
def generate_cpu_report(self):
|
||||
"""Generate CPU report with data from all tests."""
|
||||
report = []
|
||||
|
|
@ -59,11 +65,8 @@ class CpuObj():
|
|||
report.append(' {}'.format(self.name))
|
||||
|
||||
# Include RAM details
|
||||
ram_details = get_ram_details()
|
||||
ram_total = human_readable_size(ram_details.pop('Total', 0)).strip()
|
||||
ram_dimms = ['{}x {}'.format(v, k) for k, v in sorted(ram_details.items())]
|
||||
report.append('{BLUE}RAM{CLEAR}'.format(**COLORS))
|
||||
report.append(' {} ({})'.format(ram_total, ', '.join(ram_dimms)))
|
||||
report.append(' {} ({})'.format(self.ram_total, ', '.join(self.ram_dimms)))
|
||||
|
||||
# Tests
|
||||
for test in self.tests.values():
|
||||
|
|
@ -1141,7 +1144,9 @@ def run_hw_tests(state):
|
|||
show_results(state)
|
||||
|
||||
# Upload for review
|
||||
if ENABLED_UPLOAD_DATA and ask('Upload results for review?'):
|
||||
if (ENABLED_UPLOAD_DATA
|
||||
and DEBUG_MODE
|
||||
and ask('Upload results for review?')):
|
||||
try_and_print(
|
||||
message='Saving debug reports...',
|
||||
function=save_debug_reports,
|
||||
|
|
|
|||
|
|
@ -141,6 +141,18 @@ def tmux_split_window(
|
|||
return result.stdout.decode().strip()
|
||||
|
||||
|
||||
def tmux_switch_client(target_session=None):
|
||||
"""Switch to target tmux session, or previous if none specified."""
|
||||
cmd = ['tmux', 'switch-client']
|
||||
if target_session:
|
||||
cmd.extend(['-t', target_session])
|
||||
else:
|
||||
# Switch to previous instead
|
||||
cmd.append('-p')
|
||||
|
||||
run_program(cmd, check=False)
|
||||
|
||||
|
||||
def tmux_update_pane(
|
||||
pane_id, command=None, working_dir=None,
|
||||
text=None, watch=None, watch_cmd='cat'):
|
||||
|
|
|
|||
|
|
@ -1,46 +1,11 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
## Wizard Kit: HW Diagnostics - Menu Launcher
|
||||
## Wizard Kit: HW Diagnostics Launcher
|
||||
|
||||
source launch-in-tmux
|
||||
|
||||
SESSION_NAME="hw-diags"
|
||||
WINDOW_NAME="Hardware Diagnostics"
|
||||
MENU="hw-diags-menu"
|
||||
|
||||
function ask() {
|
||||
while :; do
|
||||
read -p "$1 [Y/N] " -r answer
|
||||
if echo "$answer" | egrep -iq '^(y|yes|sure)$'; then
|
||||
return 0
|
||||
elif echo "$answer" | egrep -iq '^(n|no|nope)$'; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
die () {
|
||||
echo "$0:" "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check for running session
|
||||
if tmux list-session | grep -q "$SESSION_NAME"; then
|
||||
echo "WARNING: tmux session $SESSION_NAME already exists."
|
||||
echo ""
|
||||
if ask "Connect to current session?"; then
|
||||
# Do nothing, the command below will attach/connect
|
||||
echo ""
|
||||
elif ask "Kill current session and start new session?"; then
|
||||
tmux kill-session -t "$SESSION_NAME" || \
|
||||
die "Failed to kill session: $SESSION_NAME"
|
||||
else
|
||||
echo "Aborted."
|
||||
echo ""
|
||||
echo -n "Press Enter to exit... "
|
||||
read -r
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start session
|
||||
tmux new-session -A -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $*
|
||||
TMUX_CMD="hw-diags-menu"
|
||||
|
||||
launch_in_tmux "$@"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ if __name__ == '__main__':
|
|||
sleep(1)
|
||||
pause('Press Enter to exit...')
|
||||
except SystemExit as sys_exit:
|
||||
tmux_switch_client()
|
||||
exit_script(sys_exit.code)
|
||||
except:
|
||||
# Cleanup
|
||||
|
|
@ -59,6 +60,7 @@ if __name__ == '__main__':
|
|||
|
||||
# Done
|
||||
tmux_kill_all_panes()
|
||||
tmux_switch_client()
|
||||
exit_script()
|
||||
|
||||
# vim: sts=2 sw=2 ts=2
|
||||
|
|
|
|||
64
.bin/Scripts/launch-in-tmux
Executable file
64
.bin/Scripts/launch-in-tmux
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
## Wizard Kit: TMUX Launcher
|
||||
|
||||
function ask() {
|
||||
while :; do
|
||||
read -p "$1 [Y/N] " -r answer
|
||||
if echo "$answer" | grep -Eiq '^(y|yes|sure)$'; then
|
||||
return 0
|
||||
elif echo "$answer" | grep -Eiq '^(n|no|nope)$'; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
die () {
|
||||
echo "$0:" "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function launch_in_tmux() {
|
||||
# Check for required vars
|
||||
[[ -n "${SESSION_NAME:-}" ]] || die "Required variable missing (SESSION_NAME)"
|
||||
[[ -n "${WINDOW_NAME:-}" ]] || die "Required variable missing (WINDOW_NAME)"
|
||||
[[ -n "${TMUX_CMD:-}" ]] || die "Required variable missing (TMUX_CMD)"
|
||||
|
||||
# Check for running session
|
||||
if tmux list-session | grep -q "$SESSION_NAME"; then
|
||||
echo "WARNING: tmux session $SESSION_NAME already exists."
|
||||
echo ""
|
||||
if ask "Connect to current session?"; then
|
||||
if [[ -n "${TMUX:-}" ]]; then
|
||||
# Running inside TMUX, switch to session
|
||||
tmux switch-client -t "$SESSION_NAME"
|
||||
else
|
||||
# Running outside TMUX, attach to session
|
||||
tmux attach-session -t "$SESSION_NAME"
|
||||
fi
|
||||
exit 0
|
||||
elif ask "Kill current session and start new session?"; then
|
||||
tmux kill-session -t "$SESSION_NAME" || \
|
||||
die "Failed to kill session: $SESSION_NAME"
|
||||
else
|
||||
echo "Aborted."
|
||||
echo ""
|
||||
echo -n "Press Enter to exit... "
|
||||
read -r
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start/Rename session
|
||||
if [[ -n "${TMUX:-}" ]]; then
|
||||
# Running inside TMUX, rename session/window and open the menu
|
||||
tmux rename-session "$SESSION_NAME"
|
||||
tmux rename-window "$WINDOW_NAME"
|
||||
"$TMUX_CMD" "$@"
|
||||
tmux rename-session "${SESSION_NAME}_DONE"
|
||||
tmux rename-window "${WINDOW_NAME}_DONE"
|
||||
else
|
||||
# Running outside TMUX, start/attach to session
|
||||
tmux new-session -s "$SESSION_NAME" -n "$WINDOW_NAME" "$TMUX_CMD" "$@"
|
||||
fi
|
||||
}
|
||||
|
|
@ -47,73 +47,74 @@ OTHER_RESULTS = {
|
|||
SETUP_ACTIONS = OrderedDict({
|
||||
# Install software
|
||||
'Installing Programs': {'Info': True},
|
||||
'VCR': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_vcredists, 'Just run': True,},
|
||||
'LibreOffice': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_libreoffice,
|
||||
'If answer': 'LibreOffice', 'KWArgs': {'quickstart': False, 'register_mso_types': True, 'use_mso_formats': True, 'vcredist': False},
|
||||
'VCR': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_vcredists, 'Just run': True,},
|
||||
'LibreOffice': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_libreoffice,
|
||||
'If answer': 'LibreOffice', 'KWArgs': {'quickstart': False, 'register_mso_types': True, 'use_mso_formats': False, 'vcredist': False},
|
||||
},
|
||||
'Ninite bundle': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_ninite_bundle, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Ninite bundle': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_ninite_bundle, 'KWArgs': {'cs': 'STARTED'},},
|
||||
|
||||
# Browsers
|
||||
'Scanning for browsers': {'Info': True},
|
||||
'Scan': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': scan_for_browsers, 'Just run': True, 'KWArgs': {'skip_ie': True},},
|
||||
'Scan': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': scan_for_browsers, 'Just run': True, 'KWArgs': {'skip_ie': True},},
|
||||
'Backing up browsers': {'Info': True},
|
||||
'Backup browsers': {'New': False, 'Fab': True, 'Cur': True, 'HW': False, 'Function': backup_browsers, 'Just run': True,},
|
||||
'Backup browsers': {'New': False, 'Dat': True, 'Cur': True, 'HW': False, 'Function': backup_browsers, 'Just run': True,},
|
||||
|
||||
# Install extensions
|
||||
'Installing Extensions': {'Info': True},
|
||||
'Classic Shell skin': {'New': True, 'Fab': True, 'Cur': False, 'HW': False, 'Function': install_classicstart_skin, 'Win10 only': True,},
|
||||
'Chrome extensions': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_chrome_extensions,},
|
||||
'Firefox extensions': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_firefox_extensions,},
|
||||
'Classic Shell skin': {'New': True, 'Dat': True, 'Cur': False, 'HW': False, 'Function': install_classicstart_skin, 'Win10 only': True,},
|
||||
'Chrome extensions': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_chrome_extensions,},
|
||||
'Firefox extensions': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_firefox_extensions,},
|
||||
|
||||
# Configure software'
|
||||
'Configuring Programs': {'Info': True},
|
||||
'Browser add-ons': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': install_adblock, 'Just run': True,
|
||||
'Browser add-ons': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': install_adblock, 'Just run': True,
|
||||
'Pause': 'Please enable uBlock Origin for all browsers',
|
||||
},
|
||||
'Classic Start': {'New': True, 'Fab': True, 'Cur': False, 'HW': False, 'Function': config_classicstart, 'Win10 only': True,},
|
||||
'Config Windows Updates': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': config_windows_updates, 'Win10 only': True,},
|
||||
'Enable Windows Updates': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': enable_windows_updates, 'KWArgs': {'silent': True},},
|
||||
'Explorer (system)': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': config_explorer_system, 'Win10 only': True,},
|
||||
'Explorer (user)': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': config_explorer_user, 'Win10 only': True,},
|
||||
'Restart Explorer': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': restart_explorer,},
|
||||
'Update Clock': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': update_clock,},
|
||||
'Classic Start': {'New': True, 'Dat': True, 'Cur': False, 'HW': False, 'Function': config_classicstart, 'Win10 only': True,},
|
||||
'Config Windows Updates': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': config_windows_updates, 'Win10 only': True,},
|
||||
'Enable Windows Updates': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': enable_windows_updates, 'KWArgs': {'silent': True},},
|
||||
'Explorer (system)': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': config_explorer_system, 'Win10 only': True,},
|
||||
'Explorer (user)': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': config_explorer_user, 'Win10 only': True,},
|
||||
'Restart Explorer': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': restart_explorer,},
|
||||
'Restore default UAC': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': restore_default_uac,},
|
||||
'Update Clock': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': update_clock,},
|
||||
|
||||
# Cleanup
|
||||
'Cleaning up': {'Info': True},
|
||||
'AdwCleaner': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': cleanup_adwcleaner,},
|
||||
'Desktop': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': cleanup_desktop,},
|
||||
'KIT_NAME_FULL': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': delete_empty_folders,},
|
||||
'AdwCleaner': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': cleanup_adwcleaner,},
|
||||
'Desktop': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': cleanup_desktop,},
|
||||
'KIT_NAME_FULL': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': delete_empty_folders,},
|
||||
|
||||
# System Info
|
||||
'Exporting system info': {'Info': True},
|
||||
'AIDA64 Report': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': run_aida64,},
|
||||
'File listing': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': backup_file_list,},
|
||||
'Power plans': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': backup_power_plans,},
|
||||
'Product Keys': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': run_produkey,},
|
||||
'Registry': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': backup_registry,},
|
||||
'AIDA64 Report': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': run_aida64,},
|
||||
'File listing': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': backup_file_list,},
|
||||
'Power plans': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': backup_power_plans,},
|
||||
'Product Keys': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': run_produkey,},
|
||||
'Registry': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': backup_registry,},
|
||||
|
||||
# Show Summary
|
||||
'Summary': {'Info': True},
|
||||
'Operating System': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': show_os_name, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Activation': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': show_os_activation, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'BIOS Activation': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': activate_with_bios, 'If not activated': True,},
|
||||
'Secure Boot': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': check_secure_boot_status, 'KWArgs': {'show_alert': False},},
|
||||
'Installed RAM': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': show_installed_ram, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Temp size': {'New': False, 'Fab': False, 'Cur': True, 'HW': False, 'Function': show_temp_files_size, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Show free space': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': show_free_space, 'Just run': True,},
|
||||
'Installed AV': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': get_installed_antivirus, 'KWArgs': {'ns': 'UNKNOWN', 'print_return': True},},
|
||||
'Installed Office': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': get_installed_office, 'KWArgs': {'ns': 'UNKNOWN', 'print_return': True},},
|
||||
'Partitions 4K aligned': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': check_4k_alignment, 'KWArgs': {'cs': 'TRUE', 'ns': 'FALSE'},},
|
||||
'Operating System': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': show_os_name, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Activation': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': show_os_activation, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'BIOS Activation': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': activate_with_bios, 'If not activated': True,},
|
||||
'Secure Boot': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': check_secure_boot_status, 'KWArgs': {'show_alert': False},},
|
||||
'Installed RAM': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': show_installed_ram, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Temp size': {'New': False, 'Dat': False, 'Cur': True, 'HW': False, 'Function': show_temp_files_size, 'KWArgs': {'ns': 'UNKNOWN', 'silent_function': False},},
|
||||
'Show free space': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': show_free_space, 'Just run': True,},
|
||||
'Installed AV': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': get_installed_antivirus, 'KWArgs': {'ns': 'UNKNOWN', 'print_return': True},},
|
||||
'Installed Office': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': get_installed_office, 'KWArgs': {'ns': 'UNKNOWN', 'print_return': True},},
|
||||
'Partitions 4K aligned': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': check_4k_alignment, 'KWArgs': {'cs': 'TRUE', 'ns': 'FALSE'},},
|
||||
|
||||
# Open things
|
||||
'Opening Programs': {'Info': True},
|
||||
'Device Manager': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': open_device_manager, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'HWiNFO sensors': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': run_hwinfo_sensors, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Speed test': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': open_speedtest, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Windows Updates': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': open_windows_updates, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Windows Activation': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Function': open_windows_activation, 'If not activated': True, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Sleep': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': sleep, 'Just run': True, 'KWArgs': {'seconds': 3},},
|
||||
'XMPlay': {'New': True, 'Fab': True, 'Cur': True, 'HW': True, 'Function': run_xmplay, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Device Manager': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': open_device_manager, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'HWiNFO sensors': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': run_hwinfo_sensors, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Speed test': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': open_speedtest, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Windows Updates': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': open_windows_updates, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Windows Activation': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Function': open_windows_activation, 'If not activated': True, 'KWArgs': {'cs': 'STARTED'},},
|
||||
'Sleep': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': sleep, 'Just run': True, 'KWArgs': {'seconds': 3},},
|
||||
'XMPlay': {'New': True, 'Dat': True, 'Cur': True, 'HW': True, 'Function': run_xmplay, 'KWArgs': {'cs': 'STARTED'},},
|
||||
})
|
||||
SETUP_ACTION_KEYS = (
|
||||
'Function',
|
||||
|
|
@ -125,15 +126,15 @@ SETUP_ACTION_KEYS = (
|
|||
)
|
||||
SETUP_QUESTIONS = {
|
||||
# AV
|
||||
'MSE': {'New': None, 'Fab': None, 'Cur': None, 'HW': False, 'Ninite': True},
|
||||
'MSE': {'New': None, 'Dat': None, 'Cur': None, 'HW': False, 'Ninite': True},
|
||||
|
||||
# LibreOffice
|
||||
'LibreOffice': {'New': None, 'Fab': None, 'Cur': None, 'HW': False, 'Ninite': True},
|
||||
'LibreOffice': {'New': None, 'Dat': None, 'Cur': None, 'HW': False, 'Ninite': True},
|
||||
|
||||
# Ninite
|
||||
'Base': {'New': True, 'Fab': True, 'Cur': True, 'HW': False, 'Ninite': True},
|
||||
'Missing': {'New': False, 'Fab': True, 'Cur': False, 'HW': False, 'Ninite': True},
|
||||
'Standard': {'New': True, 'Fab': True, 'Cur': False, 'HW': False, 'Ninite': True},
|
||||
'Base': {'New': True, 'Dat': True, 'Cur': True, 'HW': False, 'Ninite': True},
|
||||
'Missing': {'New': False, 'Dat': True, 'Cur': False, 'HW': False, 'Ninite': True},
|
||||
'Standard': {'New': True, 'Dat': True, 'Cur': False, 'HW': False, 'Ninite': True},
|
||||
}
|
||||
# pylint: enable=bad-whitespace,line-too-long
|
||||
|
||||
|
|
@ -247,7 +248,7 @@ def get_mode():
|
|||
setup_mode = None
|
||||
mode_options = [
|
||||
{'Name': 'New', 'Display Name': 'New / Clean install (no data)'},
|
||||
{'Name': 'Data', 'Display Name': 'Clean install with data migration'},
|
||||
{'Name': 'Dat', 'Display Name': 'Clean install with data migration'},
|
||||
{'Name': 'Cur', 'Display Name': 'Original OS (post-repair or overinstall)'},
|
||||
{'Name': 'HW', 'Display Name': 'Hardware service (i.e. no software work)'},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,2 @@
|
|||
Welcome to the [32m______[0m
|
||||
|
||||
Some common commands:
|
||||
[34m%[0m hw-diags
|
||||
[34m%[0m hw-info
|
||||
[34m%[0m mount-all-volumes
|
||||
[34m%[0m mount-backup-shares
|
||||
[34m%[0m connect-to-network
|
||||
[2J[HWelcome to the [32m______[0m
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
## Setup network and update hostname
|
||||
|
||||
# Wait for WiFi
|
||||
sleep 1s
|
||||
echo -n "Waiting for network... "
|
||||
sleep 3s
|
||||
echo "Done"
|
||||
|
||||
# Set hostname
|
||||
echo -n "Updating hostname... "
|
||||
IP="$(ip a show scope global \
|
||||
| grep inet \
|
||||
| head -1 \
|
||||
|
|
@ -19,4 +22,5 @@ fi
|
|||
if [[ "${NEW_HOSTNAME:+x}" ]]; then
|
||||
sudo hostnamectl set-hostname "${NEW_HOSTNAME}"
|
||||
fi
|
||||
echo "Done"
|
||||
|
||||
|
|
|
|||
0
.linux_items/include_x/airootfs/etc/skel/.Xauthority
Normal file
0
.linux_items/include_x/airootfs/etc/skel/.Xauthority
Normal file
|
|
@ -73,7 +73,7 @@ bindsym $mod+f exec "thunar ~"
|
|||
bindsym $mod+i exec "hardinfo"
|
||||
bindsym $mod+m exec "urxvt -title 'Mount All Volumes' -e mount-all-volumes gui"
|
||||
bindsym $mod+s exec "urxvt -title 'Hardware Diagnostics' -e hw-diags --quick"
|
||||
bindsym $mod+t exec "urxvt -e zsh -c 'tmux new-session -A -t general; zsh'"
|
||||
bindsym $mod+t exec "urxvt"
|
||||
bindsym $mod+v exec "urxvt -title 'Hardware Sensors' -e watch -c -n1 -t hw-sensors"
|
||||
bindsym $mod+w exec "firefox"
|
||||
|
||||
|
|
@ -320,4 +320,4 @@ bar {
|
|||
height 26
|
||||
}
|
||||
|
||||
exec --no-startup-id /home/tech/.update_x
|
||||
exec urxvt -title "Initializing..." -e /home/tech/.update_x
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#openbox-autostart
|
||||
|
||||
$HOME/.update_x &
|
||||
/usr/bin/urxvt -title "Initializing..." -e "$HOME/.update_x"
|
||||
"$HOME/.start_desktop_apps" &
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@
|
|||
</keybind>
|
||||
<keybind key="W-t">
|
||||
<action name="Execute">
|
||||
<command>urxvt -e zsh -c 'tmux new-session -A -t general; zsh'</command>
|
||||
<command>urxvt</command>
|
||||
</action>
|
||||
</keybind>
|
||||
<keybind key="W-v">
|
||||
|
|
|
|||
24
.linux_items/include_x/airootfs/etc/skel/.start_desktop_apps
Executable file
24
.linux_items/include_x/airootfs/etc/skel/.start_desktop_apps
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/env bash
|
||||
#
|
||||
## Start desktop apps based on WM
|
||||
|
||||
# Start common apps
|
||||
feh --bg-fill "$HOME/.wallpaper"
|
||||
compton --backend xrender --xrender-sync --xrender-sync-fence &
|
||||
sleep 1s
|
||||
x0vncserver -display :0 -passwordfile $HOME/.vnc/passwd -AlwaysShared &
|
||||
conky &
|
||||
nm-applet &
|
||||
volumeicon &
|
||||
|
||||
# Start WM specific apps
|
||||
if fgrep -q "i3" /proc/cmdline; then
|
||||
# i3
|
||||
i3-msg restart
|
||||
else
|
||||
# openbox
|
||||
openbox --restart
|
||||
tint2 &
|
||||
cbatticon --hide-notification &
|
||||
fi
|
||||
|
||||
|
|
@ -5,6 +5,8 @@
|
|||
REGEX_XRANDR='^.* ([0-9]+)x([0-9]+)\+[0-9]+\+[0-9]+.* ([0-9]+)mm x ([0-9]+)mm.*$'
|
||||
REGEX_URXVT='(URxvt.geometry:\s+).*'
|
||||
|
||||
echo -n "Getting display details... "
|
||||
|
||||
# Get screen data
|
||||
xrandr_str="$(xrandr | grep mm | head -1)"
|
||||
width_px="$(echo "${xrandr_str}" | sed -r "s/${REGEX_XRANDR}/\1/")"
|
||||
|
|
@ -29,8 +31,12 @@ width_urxvt="$(echo "${width_px} * 112/1280" | bc)"
|
|||
height_urxvt="$(echo "${height_px} * 33/720" | bc)"
|
||||
offset_urxvt="24"
|
||||
|
||||
echo "Done"
|
||||
|
||||
# Update settings if necessary
|
||||
if [[ "${dpi}" -ge 192 ]]; then
|
||||
echo -n "Updating settings for HiDPI... "
|
||||
|
||||
# Conky
|
||||
sed -i 's/minimum_size 180 0/minimum_size 360 0/' "${HOME}/.conkyrc_base"
|
||||
sed -i 's/maximum_width 180/maximum_width 360/' "${HOME}/.conkyrc_base"
|
||||
|
|
@ -64,6 +70,9 @@ if [[ "${dpi}" -ge 192 ]]; then
|
|||
width_urxvt="$(echo "${width_urxvt} / 2" | bc)"
|
||||
height_urxvt="$(echo "${height_urxvt} / 2" | bc)"
|
||||
offset_urxvt="$(echo "${offset_urxvt} * 2" | bc)"
|
||||
|
||||
# Done
|
||||
echo "Done"
|
||||
fi
|
||||
|
||||
# Update URxvt (Always)
|
||||
|
|
@ -71,33 +80,19 @@ urxvt_geometry="${width_urxvt}x${height_urxvt}+${offset_urxvt}+${offset_urxvt}"
|
|||
sed -i -r "s/${REGEX_URXVT}/\1${urxvt_geometry}/" "${HOME}/.Xresources"
|
||||
|
||||
# Update conky
|
||||
echo -n "Updating conky... "
|
||||
$HOME/.update_conky
|
||||
echo "Done"
|
||||
|
||||
# Update X
|
||||
echo -n "Updating X... "
|
||||
xset s off
|
||||
xset -dpms
|
||||
xrdb -merge $HOME/.Xresources
|
||||
echo "Done"
|
||||
|
||||
# Start common desktop apps
|
||||
feh --bg-fill "$HOME/.wallpaper"
|
||||
compton --backend xrender --xrender-sync --xrender-sync-fence &
|
||||
sleep 1s
|
||||
x0vncserver -display :0 -passwordfile $HOME/.vnc/passwd -AlwaysShared &
|
||||
conky &
|
||||
nm-applet &
|
||||
volumeicon &
|
||||
|
||||
# Start WM specific apps
|
||||
# Start desktop apps for i3
|
||||
if fgrep -q "i3" /proc/cmdline; then
|
||||
# i3
|
||||
i3-msg restart
|
||||
else
|
||||
# openbox
|
||||
openbox --restart
|
||||
tint2 &
|
||||
cbatticon --hide-notification &
|
||||
i3-msg exec $HOME/.start_desktop_apps
|
||||
fi
|
||||
|
||||
# Prevent Xorg from being killed by .zlogin
|
||||
touch "/tmp/x_ok"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@
|
|||
dbus-update-activation-environment --systemd DISPLAY
|
||||
eval $(ssh-agent)
|
||||
export SSH_AUTH_SOCK
|
||||
xrdb -merge $HOME/.Xresources
|
||||
exec openbox-session
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
setterm -blank 0 -powerdown 0 2>/dev/null
|
||||
if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then
|
||||
# Connect to network and update hostname
|
||||
$HOME/.update_network
|
||||
"${HOME}/.update_network"
|
||||
|
||||
# Update settings if using i3
|
||||
if fgrep -q "i3" /proc/cmdline; then
|
||||
|
|
@ -11,18 +11,16 @@ if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then
|
|||
|
||||
# Start X or HW-diags
|
||||
if ! fgrep -q "nox" /proc/cmdline; then
|
||||
# Kill Xorg after 30 seconds if it doesn't fully initialize
|
||||
(sleep 30s; if ! [[ -f "/tmp/x_ok" ]]; then pkill '(Xorg|startx)'; fi) &
|
||||
# Show freeze warning
|
||||
echo ""
|
||||
echo "NOTE: Not all GPUs/displays are supported."
|
||||
echo " If the system is frozen on this screen"
|
||||
echo " please restart and try CLI mode instead"
|
||||
echo ""
|
||||
|
||||
# Try starting X
|
||||
startx >/dev/null
|
||||
|
||||
# Run Hw-Diags CLI if necessary
|
||||
if ! [[ -f "/tmp/x_ok" ]]; then
|
||||
echo "There was an issue starting Xorg, starting CLI interface..."
|
||||
sleep 2s
|
||||
hw-diags --cli
|
||||
fi
|
||||
# Start x
|
||||
echo "Starting X..."
|
||||
startx >/dev/null 2>&1
|
||||
else
|
||||
hw-diags --cli
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue