Entertainment while AI thinks!
Watch YouTube Shorts while waiting for AI responses in Cursor IDE
ThinkTok is a productivity tool that automatically opens YouTube Shorts when you send a prompt to Cursor AI and closes it when the response is complete. No more staring at a loading screen - make the most of your waiting time!
1. You send a prompt to Cursor AI (press Enter)
β
2. ThinkTok detects the prompt submission
β
3. YouTube Shorts widget appears automatically
β
4. AI response completes
β
5. Widget closes automatically - back to coding!
| Feature | Description |
|---|---|
| Auto-Detection | Detects when you send a prompt and opens Shorts |
| Smart Close | Automatically closes when AI response is complete |
| Overlay Widget | Floating window that stays on top |
| Chat Panel Detection | Auto-positions over the Cursor chat panel |
| Keyboard Shortcuts | Manual control with customizable hotkeys |
| Minimal Resource Usage | Lightweight screenshot-based detection |
- macOS (tested on Sonoma 14.0+)
- Hammerspoon installed
- Cursor IDE installed
# 1. Install Hammerspoon
brew install --cask hammerspoon
# 2. Clone this repository
git clone https://github.com/0xhalil/ThinkTok.git
# 3. Copy files to Hammerspoon config
cp ThinkTok/cursor_tiktok.lua ~/.hammerspoon/
cp ThinkTok/init.lua ~/.hammerspoon/
# 4. Reload Hammerspoon config
# Press Cmd + Alt + Ctrl + R or click Hammerspoon menu β Reload Config- Open System Settings β Privacy & Security β Accessibility
- Enable Hammerspoon β
Just use Cursor as normal! ThinkTok will:
- Open Shorts when you press Enter to send a prompt
- Close automatically when the AI finishes responding
| Shortcut | Action |
|---|---|
Cmd + Alt + Ctrl + T |
Toggle Shorts widget |
Cmd + Alt + Ctrl + S |
Show Shorts widget |
Cmd + Alt + Ctrl + H |
Hide Shorts widget |
Cmd + Alt + Ctrl + R |
Reload Hammerspoon config |
Edit ~/.hammerspoon/cursor_tiktok.lua to customize:
M.config = {
-- Widget size (fallback if auto-detect fails)
fallbackWidth = 380, -- pixels
fallbackHeight = 650, -- pixels
-- Video source
videoUrl = "https://www.youtube.com/shorts",
-- Detection sensitivity
checkInterval = 1.5, -- Check every 1.5 seconds
stableChecksRequired = 3, -- 3 stable checks = response complete
-- Debug mode
debug = false, -- Set to true for console logging
}-- TikTok
videoUrl = "https://www.tiktok.com/foryou"
-- Instagram Reels
videoUrl = "https://www.instagram.com/reels/"
-- Reddit Videos
videoUrl = "https://www.reddit.com/r/videos"Widget doesn't appear
- Check Hammerspoon accessibility permissions
- Make sure Cursor is the focused app
- Enable debug mode and check Console.app for logs:
cursorTikTok.config.debug = true
Widget doesn't close automatically
- Increase
stableChecksRequiredfor longer responses - The widget has a 5-minute max timeout as a fallback
- Use
Cmd + Alt + Ctrl + Hto manually hide
Widget position is wrong
- The widget tries to auto-detect the chat panel
- If detection fails, it uses
fallbackWidthandfallbackHeight - Adjust these values in the config file
ThinkTok uses a clever screenshot-based approach:
- Takes small snapshots of the Cursor window (80x80 pixels)
- Generates a hash of each snapshot
- Compares consecutive hashes
- When the hash is stable for N consecutive checks, the response is complete
This method is:
- Lightweight - No need to parse Cursor's UI
- Reliable - Works regardless of response length
- Non-intrusive - No modifications to Cursor needed
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hammerspoon - Powerful macOS automation
- Cursor - The AI-first code editor
- Inspired by the countless seconds spent waiting for AI responses
Made with β€οΈ for developers who value every second
