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',
|
||||
'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
|
||||
|
||||
self.view_map = 'DISPLAY' in os.environ or 'WAYLAND_DISPLAY' in os.environ
|
||||
|
||||
# Set map path
|
||||
# e.g. '(Clone|Image)_Model[_p#]_Size[_Label].map'
|
||||
|
|
@ -2054,12 +2050,13 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True):
|
|||
LOG.info('ddrescue cmd: %s', cmd)
|
||||
return
|
||||
|
||||
# Start ddrescue and ddrescueview
|
||||
# Start ddrescue and ddrescueview (if enabled)
|
||||
proc = exe.popen_program(cmd)
|
||||
exe.popen_program(
|
||||
['ddrescueview', '-r', '5s', block_pair.map_path],
|
||||
pipe=True,
|
||||
)
|
||||
if block_pair.view_map:
|
||||
exe.popen_program(
|
||||
['ddrescueview', '-r', '5s', block_pair.map_path],
|
||||
pipe=True,
|
||||
)
|
||||
|
||||
# ddrescue loop
|
||||
_i = 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue