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