-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
34 lines (25 loc) · 794 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import subprocess
import sys
import os
import yaml
with open('config.yaml') as file:
windows = yaml.safe_load(file)
shellPath = os.path.dirname(os.path.abspath(__file__)) + '/openNewWindow.sh'
baseScript = ['sh', shellPath]
def partialSetup():
processQueue = []
for key in windows:
userInput = input('Open ' + key + '(y/N)')
if(userInput.lower() == 'y'): processQueue.append(key)
processQueue.reverse()
for page in processQueue:
cliCommand = baseScript.copy()
cliCommand.extend(windows[page])
subprocess.call(cliCommand)
def fullSetup():
for page in windows:
cliCommand = baseScript.copy()
cliCommand.extend(windows[page])
subprocess.call(cliCommand)
if(len(sys.argv) > 1 and sys.argv[1] == '--select'): partialSetup()
else: fullSetup()