Open ddrescueview during recovery

Addresses issue #182
This commit is contained in:
2Shirt 2022-02-20 18:10:13 -07:00
parent 0ecb7e2933
commit a35ffdda23
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
3 changed files with 17 additions and 0 deletions

View file

@ -132,6 +132,11 @@ class BlockPair():
'trim': 'Pending',
'scrape': 'Pending',
})
self.view_proc = 'Disabled'
if 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ:
# Enable opening ddrescueview during recovery
self.view_proc = None
# Set map file
# e.g. '(Clone|Image)_Model[_p#]_Size[_Label].map'
@ -2029,6 +2034,16 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True):
exe.stop_process(proc)
std.print_error(warning_message)
break
# Open ddrescueview
## NOTE: This needs to be started a bit into the recovery since it needs
## a non-zero map file to read
if not block_pair.view_proc and _i > 1:
block_pair.view_proc = exe.popen_program(
['ddrescueview', '-r', '5s', block_pair.map_path],
pipe=True,
)
if _i % 60 == 0:
# Clear ddrescue pane
tmux.clear_pane()

View file

@ -1,4 +1,5 @@
aic94xx-firmware
ddrescueview-bin
hfsprogs
iwgtk
memtest86-efi

View file

@ -34,4 +34,5 @@ startup-notification
subversion
syslinux
tigervnc
unzip
wpa_supplicant