Shutdown.py is an automated PC shutdown program that monitors user activity and initiates a system shutdown when no movement or keyboard activity is detected for a specified period of time. It helps ensure energy efficiency and provides an additional layer of security for your PC.
- Monitors mouse movement and keyboard activity.
- Starts a countdown and displays a warning before initiating the shutdown.
- Allows cancellation of the countdown if activity is detected.
- Retries the shutdown process in case of errors.
- Logs error messages for troubleshooting.
- Energy Efficiency: Automatically shut down your PC after a period of inactivity to conserve power and reduce electricity consumption.
- Security: Protect your system from unauthorized access by initiating a shutdown when idle.
- Productivity: Encourage regular breaks by setting a time limit for inactivity and prompting users to resume their work.
- Make sure you have Python installed on your system.
- Install the required dependencies by running the following command:
pip install pyautogui keyboard
- Download the
shutdown.py
file from this repository. - Open a terminal or command prompt and navigate to the directory where the
shutdown.py
file is located. - Run the program using the following command:
python shutdown.py
To run the shutdown.py
program automatically on startup, follow these steps:
- Press
Win + R
to open the Run dialog box. - Type
shell:startup
and press Enter. This will open the Startup folder. - Copy the
shutdown.py
file and paste it into the Startup folder. - The program will now run every time you start your computer.
Note: The instructions for running on startup may vary for different operating systems.