simplelocker
1.0.0
在某些事件上運行命令的小工具(在暫停之前,經過一段時間的閒置等)。最初是為了啟動屏幕儲物櫃(例如i3lock)而設計的,但是可以運行任何內容。
SimpleLocker可以以:
simplelocker -i <x> -c <cmd>
在會話之後運行,閒置了<x>秒。
對於一個更複雜的例子,
simplelocker -i 60 -s -l -c i3lock
將啟動i3lock:
-i 60 60秒後空轉-s在系統暫停/睡覺之前緊接-l響應DBUS方法調用(請參閱控制運行實例) 如果使用-l啟動了SimpleLocker(例如,在i3配置文件中),則可以使用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
選項:
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尚未包裝任何發行版,但它很簡單。
git clone --recurse-submodules https://github.com/jameseh96/simplelocker.git simplelocker
cd ./simplelocker
mkdir ./build
cd !$
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install