Julien Cubizolles <j.cubizol...@free.fr> writes: > Ihor Radchenko <yanta...@gmail.com> writes: > >> >> As Tim pointed out, we cannot guarantee that things working on 'x build >> will also work on 'pgtk. Instead of abusing settings for 'x window >> system, can you please introduce a new function org-pgtk-idle-seconds >> using a new variable org-clock-pgtkidle-program-name, similar to >> org-x11-idle-seconds, and then update org-user-idle-seconds? > > Sorry for the delay, here is a patch to that effect.
Thanks! > +(defcustom org-clock-pgtkidle-program-name > + (if (executable-find "jc-idle-time") > + "jc-idle-time") > + "Name of the program which prints idle time in milliseconds. May I know where "jc-idle-time" is coming from? Is it a built-in command on wayland? > +(defvar org-pgtkidle-exists-p > + ;; Check that org-clock-pgtkidle-program-name exists. But don't do that > on DOS/Windows, > + ;; since the command definitely does NOT exist there, and invoking > + ;; COMMAND.COM on MS-Windows is a bad idea -- it hangs. > + (and (null (memq system-type '(windows-nt ms-dos))) > + (eq 0 (call-process-shell-command > + (format "command -v %s" org-clock-pgtkidle-program-name))) > + ;; Check that x11idle can retrieve the idle time > + ;; FIXME: Why "..-shell-command" rather than just `call-process'? > + (eq 0 (call-process-shell-command org-clock-pgtkidle-program-name)))) We may as well resolve this FIXME since we are at it. Instead of the awkward combination of two `call-process-shell-command' prompts, we can simply use `executable-find' + `call-process'. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>