Skip to main content

Sécurité automatique par détection d'activité clavier/souris

Project description

 _____ _                       _                _    
|  ___(_)_ __   __ _  ___ _ __| |    ___   ___| | __
| |_  | | '_ \ / _` |/ _ \ '__| |   / _ \ / __| |/ /
|  _| | | | | | (_| |  __/ |  | |__| (_) | (__|   < 
|_|   |_|_| |_|\__, |\___|_|  |_____\___/ \___|_|\_\
               |___/                                 

FingerLock 🔒

Sécurité automatique par détection d'activité clavier/souris

FingerLock verrouille automatiquement votre ordinateur après une période d'inactivité, détectée via votre clavier et votre souris. Plus besoin de verrouiller manuellement votre PC quand vous partez !

License: MIT Python 3.8+ Platform: Linux | macOS | Windows


✨ Fonctionnalités

  • ⌨️ Détection clavier — Chaque touche réinitialise le timer
  • 🖱️ Détection souris — Mouvements et clics gardent le système actif
  • 🔒 Verrouillage automatique — Lock après X secondes d'inactivité
  • Ultra-léger — Consommation CPU/RAM minimale
  • 🎯 Multi-plateforme — Linux, macOS, Windows
  • 📊 Logs détaillés — Historique complet des événements
  • ⚙️ Configuration simple — Setup interactif au premier lancement

🚀 Installation Rapide

Prérequis

  • Python 3.8 ou supérieur
  • pip ou pipx

Installation avec pipx (recommandé)

# 1. Installer pipx (si pas déjà fait)
# Ubuntu/Debian
sudo apt install pipx
pipx ensurepath

# macOS
brew install pipx
pipx ensurepath

# Windows
pip install pipx
pipx ensurepath

# 2. Installer FingerLock
pipx install git+https://github.com/REBCDR07/fingerlock.git

# 3. Lancer
fingerlock

Installation avec pip

pip install git+https://github.com/REBCDR07/fingerlock.git
fingerlock

Installation depuis les sources

git clone https://github.com/REBCDR07/fingerlock.git
cd fingerlock
pipx install .
fingerlock

📖 Utilisation

Premier lancement

Au premier démarrage, FingerLock vous demande la configuration :

$ fingerlock

 _____ _                       _                _    
|  ___(_)_ __   __ _  ___ _ __| |    ___   ___| | __
| |_  | | '_ \ / _` |/ _ \ '__| |   / _ \ / __| |/ /
|  _| | | | | | (_| |  __/ |  | |__| (_) | (__|   < 
|_|   |_|_| |_|\__, |\___|_|  |_____\___/ \___|_|\_\
               |___/                                 
        Sécurité par Reconnaissance de Doigts
        ======================================

  🎉 Bienvenue dans FingerLock !

  Configuration initiale :

  ⏱️  Délai d'inactivité avant verrouillage (en secondes) [10] : 15

   Configuration sauvegardée dans : /home/user/.fingerlock/config.yaml
  📝 Délai configuré : 15 secondes

La surveillance démarre automatiquement !

Commandes disponibles

# Démarrer la surveillance (commande par défaut)
fingerlock
fingerlock start

# Avec un délai personnalisé (override la config)
fingerlock start -d 30

# Voir la configuration actuelle
fingerlock config

# Éditer la configuration
fingerlock config --edit

# Afficher l'état du système
fingerlock status

# Voir les logs
fingerlock logs
fingerlock logs -n 50  # 50 dernières lignes

Arrêter la surveillance

Appuyez sur Ctrl+C dans le terminal où tourne FingerLock.


⚙️ Configuration

Le fichier de configuration est situé dans ~/.fingerlock/config.yaml :

# Délai d'inactivité en secondes
lock_delay_seconds: 10

# Plateforme de verrouillage (auto-détection)
platform_lock: auto

# Fichier de logs
log_path: /home/user/.fingerlock/fingerlock.log

Modifier la configuration :

fingerlock config --edit

Ou directement :

nano ~/.fingerlock/config.yaml

🖥️ Compatibilité Plateformes

Linux

Gestionnaires de sessions supportés :

  • GNOME (gnome-screensaver)
  • KDE Plasma
  • XFCE
  • i3wm (i3lock)
  • Sway (swaylock)
  • Xscreensaver

Installation du backend de verrouillage :

# GNOME (Ubuntu standard)
sudo apt install gnome-screensaver

# X11 générique
sudo apt install xscreensaver

# i3wm
sudo apt install i3lock

# Sway (Wayland)
sudo apt install swaylock

macOS

Utilise la commande système native. Aucune configuration requise.

Permissions nécessaires :

  • Accessibilité (pour détecter clavier/souris)

Windows

Utilise rundll32 natif. Aucune configuration requise.


📊 Logs

Les événements sont enregistrés dans ~/.fingerlock/fingerlock.log :

2025-02-16T16:27:00 | INFO     | [16:27:00] ℹ️  SYSTEM     Surveillance inputs démarrée
2025-02-16T16:27:15 | WARNING  | [16:27:15] 🔒 LOCK       Verrouillage après 10s d'inactivité
2025-02-16T16:27:20 | INFO     | [16:27:20] ℹ️  SYSTEM     Système déverrouillé

Catégories d'événements :

  • SYSTEM — Démarrage, arrêt, configuration
  • LOCK — Verrouillages automatiques
  • ERROR — Erreurs techniques

🔧 Développement

Cloner et installer en mode dev

git clone https://github.com/REBCDR07/fingerlock.git
cd fingerlock
python3 -m venv venv
source venv/bin/activate  # Linux/macOS
# venv\Scripts\activate   # Windows
pip install -e .
fingerlock

Structure du projet

fingerlock/
├── fingerlock/
│   ├── __init__.py
│   ├── cli.py           # Point d'entrée CLI
│   ├── core/
│   │   ├── watch.py     # Boucle de surveillance
│   │   └── locker.py    # Verrouillage cross-plateforme
│   ├── utils/
│   │   └── logger.py    # Journalisation
│   └── config/
├── setup.py
├── README.md
└── LICENSE

Tests

# Tester la détection d'activité
fingerlock start -d 5

# Vérifier les logs
fingerlock logs -n 20

🆘 Dépannage

❌ "Commande 'fingerlock' introuvable"

Solution :

# Vérifier que pipx est dans le PATH
pipx ensurepath
source ~/.bashrc

# Réinstaller
pipx reinstall fingerlock

❌ "ModuleNotFoundError: No module named 'fingerlock'"

Solution :

pipx uninstall fingerlock
pipx install git+https://github.com/REBCDR07/fingerlock.git

❌ Verrouillage ne fonctionne pas (Linux)

Solution :

# Tester manuellement
gnome-screensaver-command -l

# Si erreur, installer :
sudo apt install gnome-screensaver

❌ Détection clavier/souris ne fonctionne pas

Linux : Vérifiez que votre utilisateur a les permissions :

# Ajouter au groupe input
sudo usermod -aG input $USER
# Redémarrer la session

macOS : Autorisez l'accès "Accessibilité" dans :

Préférences Système → Sécurité → Confidentialité → Accessibilité

🤝 Contribuer

Les contributions sont les bienvenues !

  1. Fork le projet
  2. Créez une branche (git checkout -b feature/amelioration)
  3. Committez vos changements (git commit -m 'Ajout fonctionnalité X')
  4. Push vers la branche (git push origin feature/amelioration)
  5. Ouvrez une Pull Request

📜 Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.


👤 Auteur

Elton Ronald Bill Hounnou


🙏 Remerciements

  • pynput — Détection clavier/souris
  • opencv-python — Traitement vidéo (versions antérieures)

📝 Changelog

Version 1.0.0 (2026-02-16)

  • 🎉 Release initiale
  • ⌨️ Détection clavier et souris
  • 🔒 Verrouillage automatique multi-plateforme
  • 📊 Système de logs
  • ⚙️ Configuration interactive
  • 📦 Package pip installable

⭐ Si ce projet vous est utile, n'hésitez pas à lui donner une étoile sur GitHub !

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fingerlock-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fingerlock-1.0.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file fingerlock-1.0.0.tar.gz.

File metadata

  • Download URL: fingerlock-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fingerlock-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0287a56f3c09c87c3e94a5e2a7ff089861c526d0a0f11c2124a56056bcc0adb0
MD5 3b26ce5ad70134e0c2562a78bc92581e
BLAKE2b-256 9d0a73e7b1c19f4cdd853e531d577d4cfea91ba886a7fc04e7997c063cc88e08

See more details on using hashes here.

File details

Details for the file fingerlock-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fingerlock-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for fingerlock-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 949c778ba643266c2ddfa8be71ccb1952a0a89a45658a2ddd611b9f074e76559
MD5 b454dea02b9f7211be757c94d609bab5
BLAKE2b-256 f85bc783d3bcc47fddf7440c6c154bf7644468e6c14ecf1f7333074ee70df85f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page