A simple screen locker application for Windows built with PyQt5.
- Lock your screen with a customizable hotkey (default: Ctrl+Alt+L)
- Automatic screen locking after a specified idle time
- Optional password protection
- Customizable appearance:
- Background color or image
- Clock display (12h/24h format)
- Font size and color options
- Multi-monitor support
- System tray integration
- Python 3.6+
- Third-party modules:
- PyQt5: GUI framework
- pywin32: Windows API integration
- keyboard: Hotkey support
- psutil: System monitoring
- pillow: Image processing
- cryptography: Password encryption
- python-dotenv: Configuration management
- pyautogui: Screen control
- Clone this repository or download the source code.
- Install the required dependencies:
pip install PyQt5 pywin32
- Run the application:
python main.py
- Lock Screen: Press the configured hotkey (default: Ctrl+Alt+L) to lock your screen.
- Unlock Screen:
- If password protection is disabled: Press Esc to unlock.
- If password protection is enabled: Enter your password and press Enter or click the Unlock button.
- Settings: Access the settings panel by right-clicking the system tray icon and selecting "Settings".
- Exit: Right-click the system tray icon and select "Exit".
main.py
: Entry point of the applicationscreenlocker.py
: Main screen locker functionalitysettingspanel.py
: Settings panel implementationsettingspanel_ui.py
: UI definition for the settings panelutils.py
: Utility functions for the application
You can customize the following settings:
- Hotkey: Set a custom key combination to lock the screen.
- Auto-lock: Enable/disable automatic screen locking after a period of inactivity.
- Password Protection: Enable/disable password protection and set a password.
- Background: Choose between a solid color or an image background.
- Clock: Enable/disable the clock display, choose the format (12h/24h), and customize the font size and color.
- Some system key combinations like Ctrl+Alt+Del cannot be completely blocked due to Windows security features.
- The application must be run with administrator privileges to block certain system keys.
This project is released under the MIT License.
- No error handling for invalid hotkey combinations
- Password hashing needs additional salt mechanism
- Two-factor authentication not fully implemented
- Face recognition and fingerprint authentication stubs only
- Missing webcam detection implementation
- Missing pattern lock implementation
- Missing secure clipboard handling during lock screen
- No rate limiting for failed password attempts
- Missing secure memory handling for sensitive data
- No periodic password re-entry requirement
-
Security Enhancements
- Secure memory handling for sensitive data
- Smart card/USB key authentication support
- Biometric authentication integration
- Network unlock capability
- Remote lock/unlock via API
- Session management
-
UI Improvements
- Customizable unlock animations
- Touch screen gesture support
- Custom theme support
- Accessibility features
- Multi-language support
- Screen keyboard for touch devices
-
System Integration
- Better Windows security features integration
- Group policy support
- Domain authentication support
- Event logging system
- System notifications
- Power management integration
-
Additional Features
- Scheduled locking/unlocking
- User session statistics
- Network presence detection
- USB device detection
- Screen recording prevention
- Emergency unlock procedure
-
File Operations
- Settings file corruption
- Permission issues
- Disk space issues
- File lock conflicts
-
System Integration
- OS API failures
- Registry access errors
- Group policy conflicts
- Service communication errors
-
Hardware Integration
- Webcam access errors
- Biometric device errors
- Multiple display handling
- Resolution change handling
-
Network Related
- Authentication service timeout
- Network disconnection handling
- API communication errors
- SSL/TLS errors
-
Resource Management
- Memory allocation errors
- Thread synchronization
- Process communication
- Resource cleanup
- Memory usage during extended lock periods
- CPU usage of background monitoring
- Display handling on multi-monitor setups
- Resource cleanup during screen changes
- Impact of background animations
- Settings file I/O optimization
- Password handling procedures
- Memory sanitization
- Screen capture prevention
- Keyboard hook security
- Authentication mechanism review
- Encryption implementation review
- Multi-monitor configurations
- Different Windows versions
- Various hardware configurations
- High-DPI display testing
- Power state transitions
- Memory leak detection
- Long-term stability testing