all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#44621] [PATCH] services: Add 'xorg-server-service-type'.
@ 2020-11-13 14:00 iyzsong
  2020-11-14  2:37 ` 宋文武
  0 siblings, 1 reply; 3+ messages in thread
From: iyzsong @ 2020-11-13 14:00 UTC (permalink / raw)
  To: 44621; +Cc: 宋文武

From: 宋文武 <iyzsong@member.fsf.org>

* gnu/services/xorg.scm (xorg-server-service-type): New service type.
(xorg-server-profile-service): New procedure.
---
 gnu/services/xorg.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 4590709187..33c3102514 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -45,6 +45,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages bash)
   #:use-module (gnu system shadow)
+  #:use-module (guix build-system trivial)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix packages)
@@ -70,6 +71,7 @@
             xorg-wrapper
             xorg-start-command
             xinitrc
+            xorg-server-service-type
 
             %default-slim-theme
             %default-slim-theme-name
@@ -483,6 +485,40 @@ a `service-extension', as used by `set-xorg-configuration'."
                       (xorg-configuration xorg-configuration))
                      config)))))))
 
+(define (xorg-server-profile-service config)
+  ;; XXX: profile-service-type only accepts <package> objects.
+  (list
+   (package
+     (name "xorg-wrapper")
+     (version (package-version xorg-server))
+     (source (xorg-wrapper config))
+     (build-system trivial-build-system)
+     (arguments
+      '(#:modules ((guix build utils))
+        #:builder
+        (begin
+          (use-modules (guix build utils))
+          (let* ((source (assoc-ref %build-inputs "source"))
+                 (out (assoc-ref %outputs "out"))
+                 (bin (string-append out "/bin")))
+            (mkdir-p bin)
+            (symlink source (string-append bin "/X"))
+            #t))))
+     (home-page (package-home-page xorg-server))
+     (synopsis (package-synopsis xorg-server))
+     (description (package-description xorg-server))
+     (license (package-license xorg-server)))))
+
+(define xorg-server-service-type
+  (service-type
+   (name 'xorg-server)
+   (extensions
+    (list (service-extension profile-service-type
+                             xorg-server-profile-service)))
+   (default-value (xorg-configuration))
+   (description "Add @command{X} to the system profile, to be used with
+@command{startx}.")))
+
 \f
 ;;;
 ;;; SLiM log-in manager.
-- 
2.29.1





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#44621] [PATCH] services: Add 'xorg-server-service-type'.
  2020-11-13 14:00 [bug#44621] [PATCH] services: Add 'xorg-server-service-type' iyzsong
@ 2020-11-14  2:37 ` 宋文武
  2021-02-11  9:31   ` bug#44621: " 宋文武
  0 siblings, 1 reply; 3+ messages in thread
From: 宋文武 @ 2020-11-14  2:37 UTC (permalink / raw)
  To: 44621; +Cc: 宋文武

[-- Attachment #1: Type: text/plain, Size: 43 bytes --]


Update patch to symlink 'Xorg' for 'sx':


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-Add-xorg-server-service-type.patch --]
[-- Type: text/x-patch, Size: 2616 bytes --]

From 3f15fe4f9e2fbbc48998453708102bb2c9dc8b48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Fri, 13 Nov 2020 21:57:04 +0800
Subject: [PATCH] services: Add 'xorg-server-service-type'.

* gnu/services/xorg.scm (xorg-server-service-type): New service type.
(xorg-server-profile-service): New procedure.
---
 gnu/services/xorg.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 4590709187..60611dc77d 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -45,6 +45,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages bash)
   #:use-module (gnu system shadow)
+  #:use-module (guix build-system trivial)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix packages)
@@ -70,6 +71,7 @@
             xorg-wrapper
             xorg-start-command
             xinitrc
+            xorg-server-service-type
 
             %default-slim-theme
             %default-slim-theme-name
@@ -483,6 +485,41 @@ a `service-extension', as used by `set-xorg-configuration'."
                       (xorg-configuration xorg-configuration))
                      config)))))))
 
+(define (xorg-server-profile-service config)
+  ;; XXX: profile-service-type only accepts <package> objects.
+  (list
+   (package
+     (name "xorg-wrapper")
+     (version (package-version xorg-server))
+     (source (xorg-wrapper config))
+     (build-system trivial-build-system)
+     (arguments
+      '(#:modules ((guix build utils))
+        #:builder
+        (begin
+          (use-modules (guix build utils))
+          (let* ((source (assoc-ref %build-inputs "source"))
+                 (out (assoc-ref %outputs "out"))
+                 (bin (string-append out "/bin")))
+            (mkdir-p bin)
+            (symlink source (string-append bin "/X"))
+            (symlink source (string-append bin "/Xorg"))
+            #t))))
+     (home-page (package-home-page xorg-server))
+     (synopsis (package-synopsis xorg-server))
+     (description (package-description xorg-server))
+     (license (package-license xorg-server)))))
+
+(define xorg-server-service-type
+  (service-type
+   (name 'xorg-server)
+   (extensions
+    (list (service-extension profile-service-type
+                             xorg-server-profile-service)))
+   (default-value (xorg-configuration))
+   (description "Add @command{X} to the system profile, to be used with
+@command{sx} or @command{xinit}.")))
+
 \f
 ;;;
 ;;; SLiM log-in manager.
-- 
2.29.1


[-- Attachment #3: Type: text/plain, Size: 304 bytes --]



With this service, we can run 'sx' from the console as a normal user.


If you want to use 'xinit', put this into ~/.xserverrc:
--8<---------------cut here---------------start------------->8---
tty=$(tty)
tty=${tty#/dev/tty}
X vt${tty}
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#44621: [PATCH] services: Add 'xorg-server-service-type'.
  2020-11-14  2:37 ` 宋文武
@ 2021-02-11  9:31   ` 宋文武
  0 siblings, 0 replies; 3+ messages in thread
From: 宋文武 @ 2021-02-11  9:31 UTC (permalink / raw)
  To: 44621-done


Pushed, close now.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-11  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13 14:00 [bug#44621] [PATCH] services: Add 'xorg-server-service-type' iyzsong
2020-11-14  2:37 ` 宋文武
2021-02-11  9:31   ` bug#44621: " 宋文武

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.