Updated mount-all-volumes

* Added gui argument to open Thunar after mounting
This commit is contained in:
2Shirt 2020-01-16 19:18:12 -07:00
parent 45608e8346
commit a01f3d04b6
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 10 additions and 3 deletions

View file

@ -2,6 +2,8 @@
"""Wizard Kit: Mount all volumes""" """Wizard Kit: Mount all volumes"""
# vim: sts=2 sw=2 ts=2 # vim: sts=2 sw=2 ts=2
import sys
import wk import wk
@ -19,6 +21,11 @@ def main():
wk.std.print_info('Results') wk.std.print_info('Results')
wk.std.print_report(report, indent=2) wk.std.print_report(report, indent=2)
# GUI mode
if 'gui' in sys.argv:
wk.std.pause('Press Enter to exit...')
wk.exe.popen_program(['nohup', 'thunar', '/media'])
if __name__ == '__main__': if __name__ == '__main__':
if wk.std.PLATFORM != 'Linux': if wk.std.PLATFORM != 'Linux':

View file

@ -138,9 +138,9 @@ def mount_volumes(device_path=None, read_write=False, scan_corestorage=False):
# Attempt to mount volume # Attempt to mount volume
if not already_mounted: if not already_mounted:
mount(vol.path, read_write=read_write) try:
proc = run_program(cmd, check=False) mount(vol.path, read_write=read_write)
if proc.returncode: except RuntimeError:
result += 'Failed to mount' result += 'Failed to mount'
report.append(std.color_string(result, 'RED')) report.append(std.color_string(result, 'RED'))
continue continue