guix_mirror_bot pushed a commit to branch master
in repository guix.

commit b735a81a9c2218f0c65de35882dfe17b54bca0a3
Author: Sughosha <[email protected]>
AuthorDate: Fri Mar 27 17:38:52 2026 +0530

    gnu: Add nwg-hello.
    
    * gnu/packages/nwg-shell.scm (nwg-hello): New variable.
    
    Relates-to: guix/guix!7644
    Reviewed-by: Maxim Cournoyer <[email protected]>
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/nwg-shell.scm | 99 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 98 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/nwg-shell.scm b/gnu/packages/nwg-shell.scm
index b9262ada55..48eec0ad1d 100644
--- a/gnu/packages/nwg-shell.scm
+++ b/gnu/packages/nwg-shell.scm
@@ -18,11 +18,16 @@
 
 (define-module (gnu packages nwg-shell)
   #:use-module (guix build-system copy)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
-  #:use-module (gnu packages))
+  #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages python-build))
 
 (define-public nwg-shell-wallpapers
   (package
@@ -49,3 +54,95 @@
      "nwg-shell-wallpapers is a selection of wallpapers contributed to the
 nwg-shell project.")
     (license license:cc0)))
+
+(define-public nwg-hello
+  (package
+    (name "nwg-hello")
+    (version "0.4.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/nwg-piotr/nwg-hello";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0di77z7sblphk755x96wrl1khfms57g7kvaqril87nxfwh9595aw"))
+       (modules '((guix build utils)))
+       ;; Replace systemd commands with elogind commands.
+       (snippet
+        '(substitute* '("nwg_hello/main.py"
+                        "nwg-hello-default.json"
+                        "sway-config")
+           (("\"systemctl (-i |)") "\"loginctl ")
+           (("'systemctl (-i |)") "'loginctl ")))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f ;no tests exist in source
+      #:modules '((guix build pyproject-build-system)
+                  (guix build utils)
+                  (srfi srfi-26))                     ;for cute
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'sanity-check)
+          (add-after 'unpack 'patch-paths
+            (lambda _
+              ;; Set file name to the default config and stylesheet.
+              (substitute* "nwg_hello/main.py"
+                (("\\/etc\\/nwg-hello\\/nwg-hello-default\\.(css|json)" all)
+                 (string-append #$output all)))
+              ;; Set file name to the default icons.
+              (substitute* "nwg_hello/ui.py"
+                (("\\/usr(.*\\{icon_name\\}-default\\.svg)" _ suffix)
+                 (string-append #$output suffix)))
+              ;; Look for sessions, icons, backgrounds and commands in the
+              ;; system profile.
+              (substitute* '("nwg_hello/main.py"
+                             "nwg_hello/tools.py"
+                             "nwg_hello/ui.py"
+                             "nwg-hello-default.css"
+                             "nwg-hello-default.json")
+                (("\\/usr") "/run/current-system/profile"))
+              (substitute* '("nwg-hello-default.css"
+                             "nwg-hello-default.json")
+                (("\\/usr") #$output))))
+          (add-after 'install 'install-data
+            (lambda _
+              (mkdir-p (string-append #$output "/share"))
+              (copy-recursively "img"
+                                (string-append #$output "/share/nwg-hello"))
+              (install-file "nwg.jpg"
+                            (string-append #$output "/share/nwg-hello"))
+              (for-each (cute install-file <>
+                              (string-append #$output "/etc/nwg-hello"))
+                        '("nwg-hello-default.json"
+                          "nwg-hello-default.css"
+                          "hyprland.conf"
+                          "sway-config"))
+              (install-file "README.md"
+                            (string-append #$output "/share/doc/nwg-hello"))))
+          (add-after 'create-entrypoints 'wrap-program
+            (lambda _
+              (wrap-program (string-append #$output "/bin/nwg-hello")
+                `("PATH" prefix
+                  (,(dirname (which "getent"))))
+                `("GI_TYPELIB_PATH" =
+                  (,(getenv "GI_TYPELIB_PATH")))))))))
+    (native-inputs
+     (list gobject-introspection
+           python-setuptools))
+    (inputs
+     (list bash-minimal
+           gtk+
+           gtk-layer-shell
+           python-pygobject))
+    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-hello";)
+    (synopsis "GTK3-based greeter for greetd")
+    (description
+     "nwg-hello is a GTK3-based greeter for the @command{greetd} daemon, 
written
+in Python.  It is meant to work under a Wayland compositor, like sway or
+Hyprland.
+
+This application is a part of the nwg-shell project.")
+    (license license:expat)))

Reply via email to