-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlyah.py
More file actions
executable file
·38 lines (30 loc) · 888 Bytes
/
lyah.py
File metadata and controls
executable file
·38 lines (30 loc) · 888 Bytes
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
#!/usr/local/bin/python3
# /usr/local/bin/custom_chrome.sh
# "Profile 14"
# "http://learnyouahaskell.com/making-our-own-types-and-typeclasses#derived-instances"
import os
import sys
chapterArg = sys.argv[1]
sectionArg = sys.argv[2]
urlBase = "http://learnyouahaskell.com/"
chapterPaths = {
"08": {
"path": "making-our-own-types-and-typeclasses",
"sections": {
"04": "derived-instances",
"05": "type-synonyms",
"06": "recursive-data-structures"
}
}
}
GOOGLE_CHROME = "Google\ Chrome.app"
PROFILE = "Profile 14"
chapter = chapterPaths[chapterArg]
chapterPath = chapter["path"]
sectionPath = chapter["sections"][sectionArg]
url = urlBase + chapterPath + "#" + sectionPath
args = "-a " + GOOGLE_CHROME
chrome_args = f"--args --profile-directory='{PROFILE}'"
bashCommand = f"open {url} {args} {chrome_args}"
print(bashCommand)
os.system(bashCommand)