Skip to content

vedant-kawale-27/AngryPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

😀 AngryPC

Your PC has a breaking point β€” and it's exactly one gesture away. Push it too far and it storms off on the spot. It finally had enough.

Show your webcam "the gesture" and your PC shuts itself down on the spot. No buttons. No menus. Just vibes and consequences.


✨ Features

  • πŸ– Real-time hand tracking via MediaPipe landmarks (high accuracy)
  • 🎨 Contour-based fallback using HSV skin detection β€” works even without MediaPipe
  • ☠️ Instant shutdown trigger β€” no hold time, no second chances
  • πŸͺž Selfie-mode webcam feed with live gesture overlay
  • πŸ§ͺ Test mode β€” shutdown is logged, not executed, so you can safely test
  • πŸ–Ό Visual skeleton rendering β€” draws hand bones and joints on screen

πŸ”§ Requirements

  • Python 3.9-3.12 (MediaPipe-supported)
  • Webcam
Package Version
opencv-python >=4.5.0
mediapipe >=0.10.21
numpy >=1.21.0

MediaPipe is optional but strongly recommended for accurate gesture detection. Without it, the program falls back to skin-color contour detection.


πŸš€ Running the Program

  1. Clone the repository and enter the project folder:
git clone https://github.com/vedant-kawale-27/AngryPC.git
cd AngryPC
  1. Open a terminal in the project folder (AngryPC).
  2. (Recommended) Create a virtual environment:
python -m venv venv

If you have multiple Python versions installed, create it with a specific version:

py -3.xx -m venv venv

eg. python -3.11 -m venv venv "Make sure the version you use is MediaPipe-supported (see Requirements above)."

  1. Activate the virtual environment:

Windows (Command Promt):

.\venv\Scripts\activate.bat

macOS/Linux:

source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the program:
python angrypc.py
  1. Your webcam opens. Show the configured gesture to trigger the action.
  2. To quit safely without triggering shutdown, press Q.

βš™οΈ Configuration

You can tweak behavior inside angrypc.py when creating the detector:

detector = HandGestureShutdown(
    gesture_hold_time=0.0,        # Seconds gesture must be held (0 = instant)
    trigger_gesture="Middle Finger"  # Gesture name that triggers shutdown
)

πŸ§ͺ Test Mode

Shutdown is disabled by default for safe testing. The program prints:

SHUTDOWN INITIATED!
TEST MODE: Shutdown command skipped.

To enable real shutdown, update the shutdown_computer() method in angrypc.py with your OS-specific command:

# Windows
os.system("shutdown /s /t 1")

# macOS
os.system("sudo shutdown -h now")

# Linux
os.system("sudo shutdown -h now")

πŸ€– How It Works

  1. Webcam captures live video frames
  2. MediaPipe detects hand landmarks in real time
  3. Finger states (extended / folded) are computed from landmark positions
  4. If only the middle finger is extended β†’ gesture matches β†’ shutdown triggers
  5. If MediaPipe is unavailable, falls back to HSV skin segmentation + convex hull analysis

πŸ“ File Structure

angrypc/
β”‚
β”œβ”€β”€ angrypc.py          # Main program β€” gesture detection + shutdown logic
β”œβ”€β”€ requirements.txt    # Python dependencies
└── README.md           # You're reading it

⚠️ Disclaimer

This is a fun project. Use responsibly. Save your work before testing. The author is not responsible for unsaved documents, lost progress, or your PC's hurt feelings.


πŸ“„ License

MIT β€” do whatever you want, just don't blame us.

About

😀 Your PC has a breaking point β€” and it's exactly one gesture away. Push it too far and it rage-quits on the spot. It finally had enough.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages