unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: muradm <mail@muradm.net>
To: 75270@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [bug#75270] [PATCH 3/3] services: greetd: Add new gtkgreet greeter.
Date: Thu,  2 Jan 2025 01:53:15 +0300	[thread overview]
Message-ID: <a9e9abeaba9b341c9656bb1fca649b7a2fefa356.1735771462.git.mail@muradm.net> (raw)
In-Reply-To: <cover.1735771462.git.mail@muradm.net>

* gnu/services/base.scm (<greetd-gtkgreet-sway-session>): New record,
represents `gtkgreet` greeter session configuration.
* doc/guix.texi (Base Services): Document new `gtkgreet` greeter.

Change-Id: I0445eac35aa685d676ab7208a125e46058dc6b1b
---
 doc/guix.texi         | 38 ++++++++++++++++++++++++++++++++++++++
 gnu/services/base.scm | 31 +++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 6d0c349b1a..819d1de79f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20642,6 +20642,44 @@ Base Services
 @end table
 @end deftp
 
+@deftp {Data Type} greetd-gtkgreet-sway-session
+Configuration record for the gtkgreet greetd greeter.  Can be used as
+following:
+
+@lisp
+  (greetd-configuration
+   ;; Graphical greeter require additional group membership.
+   (greeter-supplementary-groups (list "video" "input" "seat"))
+   (terminals
+    (list (greetd-terminal-configuration
+           (terminal-vt "1")
+           (terminal-switch #t)
+           (default-session-command
+            (greetd-gtkgreet-sway-session
+             (command
+              (greetd-user-session
+               ;; signal to our .bashrc that we want wayland compositor
+               (xdg-session-type "wayland")))))))))
+@end lisp
+
+@table @asis
+@item @code{sway} (default: @code{sway})
+The package with @command{/bin/sway} and @command{/bin/swaymsg} commands.
+
+@item @code{sway-config} (default: @code{(plain-file "greetd-wlgreet-sway-config" "")})
+Extra configuration for sway to be included before executing greeter.
+
+@item @code{gtkgreet} (default: @code{gtkgreet})
+The package with @command{/bin/gtkgreet} command.
+
+@item @code{command} (default: @code{(greetd-user-session)})
+Command to be started by @command{/bin/agreety} on successful login.
+Normally should be a variation of @code{greetd-user-session}, but could
+be any @code{gexp->script} like object.
+
+@end table
+@end deftp
+
 @deftp {Data Type} greetd-wlgreet-color
 
 @table @asis
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b12c352954..444b959d2d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -276,6 +276,7 @@ (define-module (gnu services base)
             greetd-terminal-configuration
             greetd-user-session
             greetd-agreety-session
+            greetd-gtkgreet-sway-session
             greetd-wlgreet-color
             greetd-wlgreet-configuration
             greetd-wlgreet-sway-session
@@ -3468,6 +3469,36 @@ (define (make-greetd-sway-greeter-command sway sway-config)
            (dup2 1 2)
            (execl #$sway-bin #$sway-bin "-d" "-c" #$sway-config))))))
 
+(define-record-type* <greetd-gtkgreet-sway-session>
+  greetd-gtkgreet-sway-session make-greetd-gtkgreet-sway-session
+  greetd-gtkgreet-sway-session?
+  (sway greetd-gtkgreet-sway-session-sway (default sway))
+  (sway-config greetd-wlgreet-sway-session-sway-config
+               (default (plain-file "greetd-wlgreet-sway-config" "")))
+  (gtkgreet greetd-gtkgreet-sway-session-gtkgreet (default gtkgreet))
+  (command greetd-gtkgreet-sway-session-command (default (greetd-user-session))))
+
+(define make-greetd-gtkgreet-sway-session-sway-config
+  (match-lambda
+    (($ <greetd-gtkgreet-sway-session> sway sway-config gtkgreet command)
+     (let ((gtkgreet-bin (file-append gtkgreet "/bin/gtkgreet"))
+           (swaymsg-bin (file-append sway "/bin/swaymsg")))
+       (mixed-text-file
+        "gtkgreet-sway-config"
+        "include " sway-config "\n"
+        "xwayland disable\n"
+        "exec \"" gtkgreet-bin " -l -c " command "; " swaymsg-bin " exit\"\n")))))
+
+(define-gexp-compiler (greetd-gtkgreet-sway-session-compiler
+                       (session <greetd-gtkgreet-sway-session>)
+                       system target)
+  (match-record session <greetd-gtkgreet-sway-session>
+    (sway)
+    (lower-object
+     (make-greetd-sway-greeter-command
+      sway
+      (make-greetd-gtkgreet-sway-session-sway-config session)))))
+
 (define-record-type* <greetd-wlgreet-color>
   greetd-wlgreet-color make-greetd-wlgreet-color greetd-wlgreet-color?
   (red greetd-wlgreet-color-red)
-- 
2.47.1





  parent reply	other threads:[~2025-01-01 22:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87jzbar8oa.fsf@muradm.net>
2025-01-01 22:47 ` [bug#75270] [PATCH 0/3] services: greetd: Improve greeter configurations muradm
2025-01-01 22:53   ` [bug#75270] [PATCH 1/3] " muradm
2025-01-03 13:23     ` Nicolas Graves via Guix-patches via
2025-01-03 17:08       ` muradm
2025-01-04 10:57         ` Nicolas Graves via Guix-patches via
2025-01-04 13:36           ` muradm
2025-01-01 22:53   ` [bug#75270] [PATCH 2/3] gnu: Add gtkgreet muradm
2025-01-01 22:53   ` muradm [this message]
2025-01-03 11:34   ` [bug#75270] [PATCH 0/3] services: greetd: Improve greeter configurations muradm
2025-01-04 16:14   ` [bug#75270] Fwd: [bug#75270] [PATCH 1/3] " Nicolas Graves via Guix-patches via
2025-01-04 16:58   ` [bug#75270] [PATCH v2 0/3] " muradm
2025-01-04 16:58     ` [bug#75270] [PATCH v2 1/3] " muradm
2025-01-04 16:58     ` [bug#75270] [PATCH v2 2/3] gnu: Add gtkgreet muradm
2025-01-04 16:58     ` [bug#75270] [PATCH v2 3/3] services: greetd: Add new gtkgreet greeter muradm

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://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9e9abeaba9b341c9656bb1fca649b7a2fefa356.1735771462.git.mail@muradm.net \
    --to=mail@muradm.net \
    --cc=75270@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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/guix.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).