-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathcopilot.sh
47 lines (25 loc) · 1 KB
/
copilot.sh
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
INPUT_FILE="$1"
OUTPUT_FILE="$2"
code "$INPUT_FILE"
sleep 4
WINDOW="$INPUT_FILE - Visual Studio Code"
WINDOW_ID=$(xdotool search --name "$WINDOW")
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+End key --clearmodifiers ctrl+Return &>/dev/null
sleep 7
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+a &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+c &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+w &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+w &>/dev/null
sleep 1
code "$OUTPUT_FILE"
sleep 4
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+a &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+v &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+s &>/dev/null
sleep 1
xdotool windowactivate --sync $WINDOW_ID key --clearmodifiers ctrl+w &>/dev/null