winidle
prints the idle time on Windows(R) and Linux systems in milliseconds.
Requires cmake and a C compiler.
Uses the Xscreensaver library to get the idle time.
mkdir build
cd build
cmake ..
make
Will create the executable src/winidle
.
gcc -o winidle src/winidle.c -lX11 -lXss
mkdir build-w32
cd build-w32
cmake .. -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake
make
Will create the executable src/winidle.exe
.
Use CMake to generate a Visual Studio project, open and build it. This part is currently untested.
(defun org-user-idle-seconds ()
"Return the current Win idle time in seconds."
(/ (string-to-number (shell-command-to-string "winidle.exe")) 1000))