From: Ihor Radchenko <yantar92@posteo.net>
To: Julien Cubizolles <j.cubizolles@free.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-clock idle time in pgtk Emacs
Date: Wed, 01 Feb 2023 13:15:19 +0000 [thread overview]
Message-ID: <87y1phjzmg.fsf@localhost> (raw)
In-Reply-To: <87lelin03e.fsf@free.fr>
Julien Cubizolles <j.cubizolles@free.fr> writes:
> Ihor Radchenko <yantar92@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>
next prev parent reply other threads:[~2023-02-01 13:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 8:32 org-clock idle time in pgtk Emacs Julien Cubizolles
2022-05-24 10:27 ` Tim Cross
2022-05-25 6:38 ` Ihor Radchenko
2023-01-31 16:24 ` Julien Cubizolles
2023-02-01 13:15 ` Ihor Radchenko [this message]
2023-02-01 15:45 ` Max Nikulin
2023-02-02 9:17 ` Ihor Radchenko
2023-02-03 5:55 ` Julien Cubizolles
2023-02-03 12:17 ` Ihor Radchenko
2023-02-03 15:07 ` Max Nikulin
2023-02-04 11:04 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1phjzmg.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=j.cubizolles@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).