-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.ahk
56 lines (48 loc) · 1.39 KB
/
code.ahk
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
#Include config.ahk
; Runs Windows Terminal project inside WSL profile
RunWTWsl(projectName) {
global WindowsTerminalWsl, WslHomeFullPath
Run wt -p "%WindowsTerminalWsl%" --title "%projectName%" -d "%WslHomeFullPath%\%projectName%",,hide
}
; Runs Windows Terminal project inside PowerShell profile
RunWTWindows(projectName) {
global WindowsTerminalWindows, WindowsWorkspace
Run wt -p "%WindowsTerminalWindows%" --title "%projectName%" -d "%WindowsWorkspace%\%projectName%",,hide
}
; Runs VS Code inside WSL
RunCodeWsl(projectName) {
global WslWorkspace
Run wsl code %WslWorkspace%/%projectName%,,hide
}
; Runs VS Code through PS
; Running through cmd fails for some reason
RunCodeWindows(projectName) {
global WindowsWorkspace
Run %ComSpec% /c "code "%WindowsWorkspace%\%projectName%"",,hide
}
; Runs scripts depending on selected project type
RunCode(projectType, projectName) {
Switch projectType
{
Case "WSL":
RunCodeWsl(projectName)
RunWTWsl(projectName)
Case "Windows":
RunCodeWindows(projectName)
RunWTWindows(projectName)
Default:
MsgBox "No such type as %projectType%"
}
}
Gui, Add, DropDownList, w250 vProjectType, WSL||Windows
Gui, Add, Edit, w250 vProjectName
Gui, Add, Button, w50 default, OK
Gui, Show
return
ButtonOK:
Gui, Submit
RunCode(ProjectType, ProjectName)
ExitApp
GuiClose:
GuiEscape:
ExitApp