From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yGM6MHpqEGT5ogAASxT56A (envelope-from ) for ; Tue, 14 Mar 2023 13:37:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oFdLMHpqEGR4aAAAauVa8A (envelope-from ) for ; Tue, 14 Mar 2023 13:37:14 +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 5EA5E3B0A9 for ; Tue, 14 Mar 2023 13:37:14 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=conses.eu header.s=gm1 header.b=p5OueSH4; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678797434; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tfztIjPntM+tMT/n9Fofoak0B4v3hkD+d/qhaUEiOOg=; b=d8kv2I1ZhDrdRGtuS4zepXGOGxhO98nEdgRe80A0s1zqzctccjWAMFFPX/l68LIsKcZ9x/ 7WhYRY1StT+72K6NARt0LOvgfdY2rgUwGd0mDHkkSxxlDbKGuOkKKNKiZAYRdXd2DerPXP tVW0UssQEhNwGbo0+m8f8EYne2SnYWsh7U3SM7o0d3E500nDJl4sOe8z9pQ3fTkvfGabkt TMVklrCE7NBSLlMDRoA66AqE8ct9dGtVTEitMwqwqzrN06G6HLDjCy6mF126RTaqOcf9p1 A0AlthxyVg5RFRWZy1AjgxmICYSMzRyKFmEyGH0khb0XjcgwD6KDPcu5ZNDxqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=conses.eu header.s=gm1 header.b=p5OueSH4; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678797434; a=rsa-sha256; cv=none; b=DIteuEmZt6AAumqE7Y1R0ufir5onryt5UxZOXE2WIJyu8phxmO4gziu7TJa7I4PW20+vwJ IfmyckAvpB52/YZ0SrRoSwBUetS5mQl41WrUBB8BCCj6dGpVSWGEirJsU1BMxjq6khkqTp RVhblErsoKP965ZxQhdWzGZ+pZIZ/IFu1P2saN6I8i9M5rVxyNbDsmM0ELFbNPQ+VpjiOf yLIfd1k/L/L5/OEBynw4sdx1L7RRIS9AMn9clyuJoBmu2QTRM2q/SepLZ8VGwOHF2jyrBY LT40q5M5y65NgcieQkNcjl1qbeTB4ZMdFu6ZJUDZQcPsd92wqxyvURN5xa1uRA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pc3tn-0006D6-NV; Tue, 14 Mar 2023 08:37:03 -0400 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 1pc3tm-0006Cu-9C for guix-patches@gnu.org; Tue, 14 Mar 2023 08:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pc3tm-0006cR-13 for guix-patches@gnu.org; Tue, 14 Mar 2023 08:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pc3tl-0002pq-RC for guix-patches@gnu.org; Tue, 14 Mar 2023 08:37:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62107] [PATCH v2] home: services: Add home-unclutter-service-type. References: <86lek41cc6.fsf@conses.eu> In-Reply-To: <86lek41cc6.fsf@conses.eu> Resent-From: conses Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 14 Mar 2023 12:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62107 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62107@debbugs.gnu.org Cc: contact@conses.eu Received: via spool by 62107-submit@debbugs.gnu.org id=B62107.167879740910880 (code B ref 62107); Tue, 14 Mar 2023 12:37:01 +0000 Received: (at 62107) by debbugs.gnu.org; 14 Mar 2023 12:36:49 +0000 Received: from localhost ([127.0.0.1]:36630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pc3tZ-0002pP-1W for submit@debbugs.gnu.org; Tue, 14 Mar 2023 08:36:49 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:35077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pc3tW-0002pB-Qc for 62107@debbugs.gnu.org; Tue, 14 Mar 2023 08:36:47 -0400 Received: (Authenticated sender: contact@conses.eu) by mail.gandi.net (Postfix) with ESMTPSA id B8AB11C0005; Tue, 14 Mar 2023 12:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conses.eu; s=gm1; t=1678797400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tfztIjPntM+tMT/n9Fofoak0B4v3hkD+d/qhaUEiOOg=; b=p5OueSH4CP9ydy4mQ6LRwFD29M1NncvFSeexfCW9nH6YZ02UfCd1MVtV7nxRsaOeDPKODo gX+C84DxTV4j3/BhbGC1odwlDWMLU7CCZPFwh/1fVk9yPrbC6H4lS+PQIyxG6bTAH0MAsv hLoOkXSrem+y/ZLjddHm52H0xrihkvhBnSbhmrc/3tplGQa4ruRkU2whU5swxOEhYIaGve uzG11A/w8pzHvuxy90yliOAP555DqBJJzrg2C6FV09i/QAhgYo2W15Z3uxRkESux01mbVq u3YPvTX/oGskTI91ihdXqyQaMok4BsWYI36LTG1Gc8nzHcJoSz/uywxq3dJF4w== From: conses Date: Tue, 14 Mar 2023 13:36:36 +0100 Message-ID: <86fsa7y0ff.fsf@conses.eu> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 5EA5E3B0A9 X-Spam-Score: -2.62 X-Migadu-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: YLiCseKc4nH/ * gnu/home/services/desktop.scm (home-unclutter-configuration) (home-unclutter-service-type): New variables; (home-unclutter-shepherd-service): New procedure; * doc/guix.texi (Desktop Services): Document it. --- doc/guix.texi | 30 ++++++++++++++++++++ gnu/home/services/desktop.scm | 53 +++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6671ba9305..551e5078f6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -42541,6 +42541,36 @@ Desktop Home Services @end table @end deftp =20 +@defvar home-unclutter-service-type +This is the service type for Unclutter, a program that runs on the +background of an X11 session and detects when the X pointer hasn't moved +for a specified idle timeout, after which it hides the cursor so that +you can focus on the text underneath. Its associated value must be a +@code{home-unclutter-configuration} record, as shown below. + +A typical configuration, where we manually specify the idle timeout (in +seconds), might look like this: + +@lisp +(service home-unclutter-service-type + (home-unclutter-configuration + (idle-timeout 2))) +@end lisp +@end defvar + +@deftp {Data Type} home-unclutter-configuration +The configuration record for @code{home-unclutter-service-type}. + +@table @asis +@item @code{unclutter} (default: @code{unclutter}) (type: file-like) +Unclutter package to use. + +@item @code{idle-timeout} (default: @code{5}) (type: integer) +A timeout in seconds after which to hide cursor. +@end table + +@end deftp + @node Guix Home Services @subsection Guix Home Services =20 diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm index cb25b03b64..ab2b871539 100644 --- a/gnu/home/services/desktop.scm +++ b/gnu/home/services/desktop.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2022 ( +;;; Copyright =C2=A9 2023 conses ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +23,7 @@ (define-module (gnu home services desktop) #:use-module (gnu home services shepherd) #:use-module (gnu services configuration) #:autoload (gnu packages glib) (dbus) - #:autoload (gnu packages xdisorg) (redshift) + #:autoload (gnu packages xdisorg) (redshift unclutter) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -32,7 +33,10 @@ (define-module (gnu home services desktop) home-redshift-service-type =20 home-dbus-configuration - home-dbus-service-type)) + home-dbus-service-type + + home-unclutter-configuration + home-unclutter-service-type)) =20 ;;; @@ -226,3 +230,48 @@ (define home-dbus-service-type (default-value (home-dbus-configuration)) (description "Run the session-specific D-Bus inter-process message bus."))) + + +;;; +;;; Unclutter. +;;; + +(define-configuration/no-serialization home-unclutter-configuration + (unclutter + (file-like unclutter) + "The @code{unclutter} package to use.") + (idle-timeout + (integer 5) + "Timeout in seconds after which to hide the cursor.")) + +(define (home-unclutter-shepherd-service config) + (list + (shepherd-service + (provision '(unclutter)) + (requirement '()) + (one-shot? #t) + (start #~(make-forkexec-constructor + (list + #$(file-append + (home-unclutter-configuration-unclutter config) + "/bin/unclutter") + "-idle" + (number->string + #$(home-unclutter-configuration-idle-timeout config))) + #:log-file (string-append + (or (getenv "XDG_LOG_HOME") + (format #f "~a/.local/var/log" + (getenv "HOME"))) + "/unclutter.log")))))) + +(define home-unclutter-service-type + (service-type + (name 'home-unclutter) + (extensions + (list + (service-extension home-shepherd-service-type + home-unclutter-shepherd-service))) + (default-value (home-unclutter-configuration)) + (description "Run the @code{unclutter} daemon, which, on systems using = the +Xorg graphical display server, automatically hides the cursor after a +user-defined timeout has expired."))) --=20 2.39.1 --=20 Best regards, conses