-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch-arch
More file actions
executable file
·83 lines (76 loc) · 2.91 KB
/
launch-arch
File metadata and controls
executable file
·83 lines (76 loc) · 2.91 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Jared Daniel Carbonell Recomendable.
import sys
import subprocess
def run(flag):
'''Carry out the process of launching the requested application. This is the
first function called when the program is run in the terminal.'''
insertion = {
0 : 'chromium --incognito',
1 : 'pcmanfm /home/username/Dropbox',
2 : 'firefox --private-window',
3 : 'thunderbird',
4 : 'redshift',
5 : 'cd /home/username/bin/tor-browser_en-US && ./start-tor-browser.desktop',
6 : 'cd /home/username/bin/arduino-1.8.7 && ./arduino',
7 : 'cd /home/username/bin/fritzing-0.9.3b.linux.AMD64 && ./Fritzing',
8 : '"/home/username/bin/android-studio/bin/studio.sh" %f',
9 : '"/home/username/Qt/Tools/QtCreator/bin/qtcreator"',
10: 'cd /home/username/bin/etcher-electron-1.4.5-x86_64 && sudo ./etcher-electron-1.4.5-x86_64.AppImage',
11: 'cd /home/username/bin/SynfigStudio-1.2.2-18.09.14-linux64-286f1 && ./SynfigStudio-1.2.2-18.09.14-linux64-286f1.appimage',
12: 'cd /home/username/bin/eagle-9.2.0 && ./run',
13: 'jupyter-notebook --no-browser',
14: 'cd /home/username/Unity-2018.2.7f1/Editor && ./Unity'
}
try:
to_run = insertion[flag]
subprocess.run(['bash', '-c', to_run])
except KeyError:
show_help()
def show_help():
'''Show the help documentation for the program.'''
help_doc = '''Usage: launch [options]
Options:
android-studio launch Android Studio
arduino launch Arduino IDE
chromium launch Chromium in incognito mode
dropbox launch PCManFM with ~/Dropbox open
eagle launch Autodesk Eagle
etcher launch Etcher
firefox launch Firefox in a Private Window
fritzing launch Fritzing
jupyter launch Jupyter Notebook without launching a browser
mail launch Thunderbird
qt-creator launch Qt Creator
redshift launch Redshift
synfig launch Synfig Studio
tor launch Tor Browser
unity launch Unity3D Editor'''
print(help_doc)
if __name__ == '__main__':
if len(sys.argv) == 2:
options = {
'chrome' : 0,
'chromium' : 0,
'dropbox' : 1,
'firefox' : 2,
'mail' : 3,
'redshift' : 4,
'tor' : 5,
'arduino' : 6,
'fritzing' : 7,
'android-studio' : 8,
'qt-creator' : 9,
'etcher' : 10,
'synfig' : 11,
'eagle' : 12,
'jupyter' : 13,
'unity' : 14
}
try:
run(options[sys.argv[1]])
except KeyError:
show_help()
else:
show_help()