https://github.com/epicboi-deepubhai/fingercommander
A Linux utility that uses your webcam to recognize hand gestures and run system commands like opening VS Code, locking the screen, or shutting down β all controlled by your fingers.
https://github.com/epicboi-deepubhai/fingercommander
gesture gesture-recognition mediapipe opencv-python shortcut
Last synced: about 1 month ago
JSON representation
A Linux utility that uses your webcam to recognize hand gestures and run system commands like opening VS Code, locking the screen, or shutting down β all controlled by your fingers.
- Host: GitHub
- URL: https://github.com/epicboi-deepubhai/fingercommander
- Owner: epicboi-deepubhai
- Created: 2025-06-12T06:34:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-12T06:58:23.000Z (about 1 year ago)
- Last Synced: 2025-06-12T07:45:03.848Z (about 1 year ago)
- Topics: gesture, gesture-recognition, mediapipe, opencv-python, shortcut
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FingerCommander
A Linux utility that uses your webcam to recognize hand gestures and run system commands like opening VS Code, locking the screen, or shutting down β all controlled by your fingers.
Powered by **OpenCV** + **MediaPipe**
## π½οΈ How It Works
This app captures live webcam footage, detects your hand using MediaPipe, and matches the finger positions to predefined gestures. If a gesture matches, a mapped system command is executed (with a cooldown to avoid rapid repeats).
## Setup Instructions
Make sure Python 3 is installed (optionally create a venv), then run:
```bash
pip install opencv-python mediapipe
```
### 2. Project Structure
```
FingerCommander/
β
βββ gestures.py # Contains gesture-command mappings
βββ gesture_control.py # Main script
βββ venv/ # (optional) your virtual environment
βββ README.md
```
### Define Your Gestures
Edit the `gestures.py` file like so:
```python
GESTURE_COMMANDS = {
"peace": ("code", [0, 1, 1, 0, 0]), # VS Code
"middle": ("shutdown now", [0, 0, 1, 0, 0]), # Shutdown
"pinky": ("gnome-screensaver-command -l", [0, 0, 0, 0, 1]) # Lock screen
}
```
Each entry is a tuple of:
* Shell command to execute
* Finger pattern list: `[thumb, index, middle, ring, pinky]`
(`1` for raised, `0` for folded)
### Run the App
If youβre using a virtual environment:
```bash
source venv/bin/activate
python gesture_control.py
```
Quit the app by pressing `q`.
## Optional Custom Command Alias
Create a quick command (`camsequence`) to launch it:
```bash
alias camsequence='cd && source venv/bin/activate && python gesture_control.py'
```
Then just type `camsequence` in your terminal.
## π¨βπ» Author
Developed by [epicboi-deepubhai](https://github.com/epicboi-deepubhai)