From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4KrTCu9l2mOlywAAbAwnHQ (envelope-from ) for ; Wed, 01 Feb 2023 14:15:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KFsOCu9l2mMMTQEAG6o9tA (envelope-from ) for ; Wed, 01 Feb 2023 14:15:27 +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 D1EE0191D4 for ; Wed, 1 Feb 2023 14:15:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNCws-0003ZH-F6; Wed, 01 Feb 2023 08:14:50 -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 1pNCwq-0003Wa-TE for emacs-orgmode@gnu.org; Wed, 01 Feb 2023 08:14:48 -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 1pNCwo-0002f0-Hn for emacs-orgmode@gnu.org; Wed, 01 Feb 2023 08:14:48 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8EFBB240138 for ; Wed, 1 Feb 2023 14:14:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1675257284; bh=pMFdL2NUWMdJXKiXqMHNlIV8eaZf3hfoXewPBg7Npas=; h=From:To:Cc:Subject:Date:From; b=Cnb5eLWVitW9pdrd1Hn9sBUJFjxioYsxs0fdHVyc0JOYVbBG95lyeE+t6FPMsQutk AWqMGwAx98uRvJvRfsaXZLAYd5qG3HxllxYASaM3QZPPivS0IdrabRu4/IYKf32M37 8eKisLd5tEZmE1YLLRJStIFJlF3pTFxkE1vRm2/xxRDErBnCB2MBDxTgxsg4npw0iW Sl6DwzKyVgOX6Mgzbz150H7LRM9xZUEH/B89j/t32vQ9NWHL4QRe0M/OPKKrMiyNN/ D9NkHVqKhkb+xUNKTAqa2zGxV+ulii99bXgfhPsilzNMjlISuyR/sb4MFnHEOjQWi8 XJr3VDoM/BvGQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P6MpC2Lw4z9rxD; Wed, 1 Feb 2023 14:14:43 +0100 (CET) From: Ihor Radchenko To: Julien Cubizolles Cc: emacs-orgmode@gnu.org Subject: Re: org-clock idle time in pgtk Emacs In-Reply-To: <87lelin03e.fsf@free.fr> References: <875ylvnxf9.fsf@free.fr> <87wnea15hy.fsf@localhost> <87lelin03e.fsf@free.fr> Date: Wed, 01 Feb 2023 13:15:19 +0000 Message-ID: <87y1phjzmg.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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=1675257326; a=rsa-sha256; cv=none; b=tn9Mq1qbF90ucBrr9mhOFpJCd/vzCqjgAoRSGxTFXHlYXiuWAdppDhT6zT5gE5ynexRCWl /E/TFdbw+s+EUL5EIlD+SROuQN1lCmcGMPc/A5bp8G2s2CEs5n+U9EmiBoCeKw1Gy3IDaL UcAur4zgPcE9LRwURFpmtctCr5MTkAiV6VKf/ebhxDtDLczPyUaodAD99aBDPox40qp7lZ PbF84uWGf4N+KPW0YrEPNP1JII1eOPaPTN7VpMTsObkBmrGJgwAOePUdm0K98DYZL9kW4K F7/Ik+Ji9eWTpAItm3lnHwVjaOWqO4H2fG1AJOaYFl1qyVX5O/OBODwFkijDtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Cnb5eLWV; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675257326; 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=G7vlXr7PxVb3diYauIkOFuL+xjQ/fgSxEHbgjgcvSU8=; b=OhoN+XPjNVrILNoFBcOVmU2o7uokhLqyTFaDviqGF7Awz1O39EWX5kH2jy7yGvGV5xtaVz H6duxO0SA+jYZaWhavRo6DskLtPEAmAumEELDa/lHVDqlxHIenN43rVLPpzUP8g8i9TkEc a0g+P0mg/hltvSbrlgfnwt5Wkjfym02EcTnREd179KXQA5oPBQx+Y96gNuXNdxVRmMOIFY cXg6Q1zz+1Dku6YOi9FrEO6vdMJkUzwtyAwZBsJCPiiFFFz8Xijnux0w8z6pV8nwCHbwzz Z3RqlNvYJsyiPXZQdMMZnMXeDFLCQ3wPH4aT/fM9NqxmehvAUaifEejRyC915w== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Cnb5eLWV; 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: scn1.migadu.com X-Migadu-Spam-Score: -4.54 X-Spam-Score: -4.54 X-Migadu-Queue-Id: D1EE0191D4 X-TUID: JTvl2j4PQzvl Julien Cubizolles writes: > Ihor Radchenko 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 . Support Org development at , or support my work at