From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sHzzG2jSz2Om6wAAbAwnHQ (envelope-from ) for ; Tue, 24 Jan 2023 13:43:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0J8VG2jSz2OvQwEAG6o9tA (envelope-from ) for ; Tue, 24 Jan 2023 13:43:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E80EB34660 for ; Tue, 24 Jan 2023 13:43:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKId6-000782-4p; Tue, 24 Jan 2023 07:42:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKIbx-0006of-S8 for emacs-orgmode@gnu.org; Tue, 24 Jan 2023 07:41:14 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKIbv-0002sP-6S for emacs-orgmode@gnu.org; Tue, 24 Jan 2023 07:41:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2CD3624081B for ; Tue, 24 Jan 2023 13:41:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674564069; bh=KWs1ouIrL+lnFWbWX3KrCQnCkILHC1OJzCUA/Dr1L3g=; h=From:To:Cc:Subject:Date:From; b=nXDPV6MQqEgAtu3PUYU2uxIcKwIigWVdzBH5TOul4F4fb1FxhwSe0y9m/7J1gpTvL 4xPQCgJoMObOfldVAVvxLYYJ8bspzS00sVNPfloPnETg9Bgsqz/Agof2OJ+nRuFXp+ AFSCHu8z9tgJvldZIC8JZyiWYSgdTHpzq8Wi8D7Bjx6LsKCohfLuCbfq1YKjBhGJMs wzT0LaGkhaIpcw/InXNEqPzx4moLcr2yERV+JYheUk07Ckytn6mju5sK509HOFpbua X/VKeqx6EEI/FvAiryAe1exlH3EgxER1CvVHFvJAB4/4H6gERax3NdcuiDXkSoaPLg 4KINhCr5LgCiA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P1RR556hhz9rxW; Tue, 24 Jan 2023 13:41:05 +0100 (CET) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: [PATCH] Change default value of org-clock-x11-idle-program-name In-Reply-To: <874jvkn1po.fsf@localhost> References: <871qqs6gqs.fsf@free.fr> <87y1t0lgfo.fsf@localhost> <87mt9egknp.fsf@localhost> <874jvkn1po.fsf@localhost> Date: Tue, 24 Jan 2023 12:41:33 +0000 Message-ID: <87zga83y0y.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674564200; a=rsa-sha256; cv=none; b=OC9NGjen0gECdl8GC/PoLihEfFX1eOyL6ce8tLV8fACke6hRRGNavG6IMMqhxUX9mWlXkb pLsj74jLslqFtippPQZkoYX29R3oCgMDdMnQDU5aE6sBbW6WRvFVo4r3kfqp/cGh8oym+L 3XoyXRv80NOdL53h15BBsV4suMdBgFSUW7PaU5VQvxedW2s4CQuyVGNlmy2aSSQk+0ycdJ HV0ab7/dxaR3Br6pXaxukWJ9Xtx5tHekB1R6AuHR8fkjjqhEIQGA9o0PhR0R8wz+PfC95S Lc4VpBCfNXxTY8dmKTMrOgOBkS3llfWFBA4Z1cXMf6yMyVEPSDO7LK/j7+ixpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674564200; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NOsoZvb+tV1aQCGLAHAxYme/kOxXUUEmbEj7JdQ9okc=; b=SyvWB0g3i+XlvXMaqqP0G0THAUjjFqKhLzCtQr5PkzwfSJovO5K9RAJB8gYxfWugfj9Lcs 6sOVfWCZY9Tk3zwCpAtPebbKZlQ6q9aZPVSWPyTKB4cBs9ZSur+Lt+tckc9SWnv/81c7Bj HI+QEK+xJLYrTJoA4nrudm7JxTpwXlMxlChcYROLozmkYpfRTFU9abD0nGOhbjCuJmyfgg tOfj9Br31+ku/uF+zdKx3cturaWQ+mnHWsJgs+QCyuaNlaC4ufENMIjOgrAeCkS0+xAuzg PLCJvVgZEdUeVVJ++L5EPRt676fjtKHl/5MXGq/e72j4d4v51vxxHt9e/ArGog== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nXDPV6MQ; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.55 X-Spam-Score: -4.55 X-Migadu-Queue-Id: E80EB34660 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=nXDPV6MQ; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: SuMEKt/GLTUh --=-=-= Content-Type: text/plain Ihor Radchenko writes: > What we can do is check if xprintidle executable is available and use > it. Otherwise, fall back to x11idle to retain backwards compatibility on > systems that do no have xprintidle installed. See the attached patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-clock-x11idle-program-name-Prefer-xprintidle-whe.patch >From 6fe58852f30b7bd8d217bf228252dc97abd05153 Mon Sep 17 00:00:00 2001 Message-Id: <6fe58852f30b7bd8d217bf228252dc97abd05153.1674564051.git.yantar92@posteo.net> From: Ihor Radchenko Date: Tue, 24 Jan 2023 15:38:26 +0300 Subject: [PATCH] org-clock-x11idle-program-name: Prefer "xprintidle", when available * lisp/org-clock.el (org-clock-x11idle-program-name): Change the default value to "xprintidle" when its executable is available. Fallback to previous default otherwise. Update :package-version and remove :version tags. * etc/ORG-NEWS (New and changed options): (~org-clock-x11idle-program-name~ now defaults to =xprintidle=, when available): Document the change. Link: https://orgmode.org/list/874jvkn1po.fsf@localhost --- etc/ORG-NEWS | 11 ++++++++++- lisp/org-clock.el | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 3ef76ec1a..d65592a2b 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -12,7 +12,16 @@ See the end of the file for license conditions. Please send Org bug reports to mailto:emacs-orgmode@gnu.org. * Version 9.7 (not released yet) -** New options +** New and changed options +*** ~org-clock-x11idle-program-name~ now defaults to =xprintidle=, when available + +When =xprintidle= executable is available at =org-clock= load time, it +is used as the default value for ~org-clock-x11idle-program-name~. +The old =x11idle= default is used as the fallback. + +=xprintidle= is available as system package in most Linux +distributions, unlike ancient =x11idle= that is distributed via WORG. + *** New options for the "csl" citation export processor's LaTeX output The ~org-cite-csl-latex-label-separator~ and diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 0cd473209..ceb1fc833 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -439,7 +439,9 @@ (defcustom org-clock-frame-title-format '(t org-mode-line-string) :group 'org-clock :type 'sexp) -(defcustom org-clock-x11idle-program-name "x11idle" +(defcustom org-clock-x11idle-program-name + (if (executable-find "xprintidle") + "xprintidle" "x11idle") "Name of the program which prints X11 idle time in milliseconds. you can do \"~$ sudo apt-get install xprintidle\" if you are using @@ -448,8 +450,7 @@ (defcustom org-clock-x11idle-program-name "x11idle" Alternatively, can find x11idle.c in https://orgmode.org/worg/code/scripts/x11idle.c" :group 'org-clock - :version "24.4" - :package-version '(Org . "8.0") + :package-version '(Org . "9.7") :type 'string) (defcustom org-clock-goto-before-context 2 -- 2.39.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--