emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] org-clock-auto-clockout does not actually use x11idle on X11 [


From: Ihor Radchenko
Subject: Re: [BUG] org-clock-auto-clockout does not actually use x11idle on X11 [9.6.8 (release_9.6.8-3-g21171d @ /usr/share/emacs/30.0.50/lisp/org/)]
Date: Sun, 15 Oct 2023 08:26:29 +0000

Vladimir Nikishkin <lockywolf@gmail.com> writes:

> For some time I have been wondering why auto-clockout does not use
> x11idle on my machine.
> ...
> or, even better:
>
> #+begin_src elisp
> (defun org-clock-auto-clockout-maybe ()
>    (if (< org-clock-auto-clockout-timer (if org-x11idle-exists-p
>                                            (org-x11-idle-seconds)
>                                          (current-idle-time)))))
> (defun org-clock-auto-clockout-insinuate ()
>   "Set up hook for auto clocking out when Emacs is idle.
> See `org-clock-auto-clockout-timer'.
>
> This function is meant to be added to the user configuration."
>   (require 'org-clock)
>   (add-hook 'org-clock-in-hook #'org-clock-auto-clockout-maybe t)
>   (add-hook 'org-clock-out-hook (lambda ()
>        (cancel-function-timers 'org-clock-auto-clockout-maybe))))
> #+end_src

Makes sense.
Would you be interested to submit a patch?
See https://orgmode.org/worg/org-contribute.html

-- 
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]