simplelocker
1.0.0
Un petit outil pour exécuter une commande sur certains événements (avant de suspendre, après une période de ralenti, etc.). Conçu à l'origine pour lancer un casier d'écran tel que i3lock, mais tout peut être exécuté.
Simplelocker peut être lancé en tant que:
simplelocker -i <x> -c <cmd>
Exécuter après la session a été inactif pendant <x> secondes.
Pour un exemple plus compliqué,
simplelocker -i 60 -s -l -c i3lock
Lancera i3lock:
-i 60 après 60 secondes au ralenti-s immédiatement avant que le système ne suspend / dorme-l en réponse à un appel de méthode DBUS (voir contrôler une instance en cours d'exécution) Si SimpleLocker a été lancé avec -l (disons, dans un fichier de configuration i3), il peut être contrôlé avec simplelocker -r .
# daemon
simplelocker -l -s -i 60 -c i3lock
...
# remote control
simplelocker -r Lock # launches i3lock
simplelocker -r Disable # disables lock-on-idle BUT will still
# lock on sleep, `-r Lock` etc.
simplelocker -r Enable # (re)enables lock-on-idle. Still
# requires the daemon was launched with -i
Options:
Allowed options:
-s [ --sleep ] Run on sleep
-S [ --shutdown ] Run on shutdown
-i [ --idle ] arg Run on idle
-d [ --dbus ] arg Run on dbus method call
-b [ --dbus-disable ] arg Disable run-on-idle on this dbus method call
-e [ --dbus-enable ] arg Enable run-on-idle on this dbus method call
-c [ --cmd ] arg Command to run
-h [ --help ] produce help message
DBus options:
-l [ --listen ] Register a dbus service to receive method calls
for control
-D [ --dbus-name ] arg Dbus service name to bind
-P [ --dbus-path ] arg Dbus object path to register
-I [ --dbus-interface ] arg Dbus interface to register
Remote call options:
-r [ --remote ] arg Call dbus method (i.e., `-r Lock` to lock a
running instance)
TBC
Simplelocker n'est pas emballé pour aucune distribution (encore), mais il est simple à construire.
git clone --recurse-submodules https://github.com/jameseh96/simplelocker.git simplelocker
cd ./simplelocker
mkdir ./build
cd !$
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install