Only open ddrescueview if running with a DISPLAY
This commit is contained in:
parent
b82493b12b
commit
b66f25dfea
1 changed files with 7 additions and 10 deletions
|
|
@ -133,11 +133,7 @@ class BlockPair():
|
||||||
'trim': 'Pending',
|
'trim': 'Pending',
|
||||||
'scrape': 'Pending',
|
'scrape': 'Pending',
|
||||||
})
|
})
|
||||||
self.view_proc = 'Disabled'
|
self.view_map = 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ
|
||||||
if 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ:
|
|
||||||
# Enable opening ddrescueview during recovery
|
|
||||||
self.view_proc = None
|
|
||||||
|
|
||||||
|
|
||||||
# Set map path
|
# Set map path
|
||||||
# e.g. '(Clone|Image)_Model[_p#]_Size[_Label].map'
|
# e.g. '(Clone|Image)_Model[_p#]_Size[_Label].map'
|
||||||
|
|
@ -2054,8 +2050,9 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True):
|
||||||
LOG.info('ddrescue cmd: %s', cmd)
|
LOG.info('ddrescue cmd: %s', cmd)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Start ddrescue and ddrescueview
|
# Start ddrescue and ddrescueview (if enabled)
|
||||||
proc = exe.popen_program(cmd)
|
proc = exe.popen_program(cmd)
|
||||||
|
if block_pair.view_map:
|
||||||
exe.popen_program(
|
exe.popen_program(
|
||||||
['ddrescueview', '-r', '5s', block_pair.map_path],
|
['ddrescueview', '-r', '5s', block_pair.map_path],
|
||||||
pipe=True,
|
pipe=True,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue