simplelocker
1.0.0
Ein kleines Werkzeug, um einen Befehl für bestimmte Ereignisse auszuführen (vor einer Zeit des Leerlaufs usw.). Ursprünglich für den Start eines Bildschirmschleifers wie i3lock entwickelt, aber alles kann ausgeführt werden.
SimpleLocker kann als:
simplelocker -i <x> -c <cmd>
Nach der Sitzung war die Sitzung für <x> Sekunden im Leerlauf.
Für ein komplizierteres Beispiel,
simplelocker -i 60 -s -l -c i3lock
Wird i3lock starten:
-i 60 nach 60 Sekunden im Leerlauf-s unmittelbar bevor das System suspendiert/schläft-l als Antwort auf einen DBUS -Methodenaufruf (siehe Steuerung einer laufenden Instanz) Wenn SimpleLocker mit -l (z. B. in einer i3 -Konfigurationsdatei) gestartet wurde, kann es mit simplelocker -r gesteuert werden.
# 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
Optionen:
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 ist (noch) nicht für Distributionen verpackt, aber es ist einfach zu bauen.
git clone --recurse-submodules https://github.com/jameseh96/simplelocker.git simplelocker
cd ./simplelocker
mkdir ./build
cd !$
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install