forked from SkittleDH/FreeCloudPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sh
32 lines (24 loc) · 973 Bytes
/
script.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
#!/bin/bash
# Directory for temporary project inside Codespaces
PROJECT_DIR="$HOME/wakatime-simulation"
mkdir -p "$PROJECT_DIR"
# Files to create and simulate activity
FILES=("file1.py" "file2.js" "file3.html" "file4.css" "file5.md")
# Create files if they don’t already exist
for file in "${FILES[@]}"; do
touch "$PROJECT_DIR/$file"
done
echo "Files created in $PROJECT_DIR. Open them manually in VS Code once."
echo "Make sure to open one of the files in the VS Code editor for WakaTime to detect activity."
echo "Starting activity simulation. Press Ctrl+C to stop."
# Infinite loop to simulate typing activity
while true; do
for file in "${FILES[@]}"; do
# Append text to the file (simulates editing)
echo "$(date): Editing $file" >> "$PROJECT_DIR/$file"
# Bring the file into focus in VS Code
code "$PROJECT_DIR/$file"
# Pause for a random duration (1-5 seconds)
sleep $((RANDOM % 5 + 1))
done
done