2023-02-11 06:03:29 -06:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2023-04-17 02:26:58 -05:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
|
2023-02-11 06:03:29 -06:00
|
|
|
def get_containers():
|
2023-05-02 13:32:57 -05:00
|
|
|
return subprocess.run(['podman', 'ps', '-a', '--no-trunc', '--sort=created', '--format',
|
2023-02-11 06:03:29 -06:00
|
|
|
'{{.Names}}'], stdout=subprocess.PIPE).stdout.decode('utf-8').strip().split('\n')
|
|
|
|
|
2023-05-02 13:32:57 -05:00
|
|
|
if os.path.isdir(os.path.expanduser('~/.local/bin/blend_bin')) and not os.path.isfile(os.path.expanduser('~/.local/bin/blend_bin/.associations')):
|
|
|
|
subprocess.call(['rm', '-rf', os.path.expanduser('~/.local/bin/blend_bin')], shell=False)
|
|
|
|
subprocess.call(['bash', '-c', 'rm -f "${HOME}/.local/share/applications/blend;"*'], shell=False)
|
2023-02-11 06:03:29 -06:00
|
|
|
|
2023-05-02 13:32:57 -05:00
|
|
|
subprocess.call(['mkdir', '-p', os.path.expanduser('~/.local/bin/blend_bin/')])
|
|
|
|
subprocess.call(['touch', os.path.expanduser('~/.local/bin/blend_bin/.associations')], shell=False)
|
2023-02-11 06:03:29 -06:00
|
|
|
|
|
|
|
for c in get_containers():
|
|
|
|
c = c.strip()
|
|
|
|
subprocess.call(['podman', 'start', c])
|