[PATCH] gnu: Export xorg variables for startx.

  • Open
  • quality assurance status badge
Details
3 participants
  • ???
  • John Soo
  • Maxim Cournoyer
Owner
unassigned
Submitted by
John Soo
Severity
normal
J
J
John Soo wrote on 3 Jan 2021 17:27
(address . guix-patches@gnu.org)
878s9a2dfr.fsf@asu.edu
Hi Guix,

I wanted to try using startx instead of a display manager. I finally
got it to work, but it required at very least these patches. I also had
to create a new service type but I think that it needs more work to be
put in upstream.

Is startx something we want to support? It seems like the user should
be able to construct a system as the they see fit.

What do you think?

- John
From 8ab08a2ca7e29c53468d72577e0b3b8286d652b5 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Mon, 30 Mar 2020 03:33:08 -0700
Subject: [PATCH 1/4] gnu: xinit: Specify xinputs in configure flags.

* gnu/packages/xorg.scm (xinit):[arguments] Specify twm, xauth, xclock,
xorg-server, xrdb, xorg-server, and xterm in configure flags and propagate
them.
---
gnu/packages/xorg.scm | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 42596aa0f1..d7f55394ab 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -5922,7 +5922,33 @@ The XCB util-wm module provides the following libraries:
(native-inputs
`(("pkg-config" ,pkg-config)))
(propagated-inputs
- `(("xauth" ,xauth)))
+ `(("twm" ,twm)
+ ("xauth" ,xauth)
+ ("xclock" ,xclock)
+ ("xorg-server" ,xorg-server)
+ ("xrdb" ,xrdb)
+ ("xterm" ,xterm)))
+ (arguments
+ `(#:configure-flags
+ (list
+ (string-append
+ "--with-twm="
+ (assoc-ref %build-inputs "twm") "/bin/twm")
+ (string-append
+ "--with-xauth="
+ (assoc-ref %build-inputs "xauth") "/bin/xauth")
+ (string-append
+ "--with-xclock="
+ (assoc-ref %build-inputs "xclock") "/bin/xclock")
+ (string-append
+ "--with-xrdb="
+ (assoc-ref %build-inputs "xrdb") "/bin/xrdb")
+ (string-append
+ "--with-xserver="
+ (assoc-ref %build-inputs "xorg-server") "/bin/X")
+ (string-append
+ "--with-xterm="
+ (assoc-ref %build-inputs "xterm") "/bin/xterm"))))
(home-page "https://www.x.org/")
(synopsis "Commands to start the X Window server")
(description
--
2.29.2
From fe434e4d4c53d9d8c27fcd8ab882aa4b027f4e17 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Wed, 1 Apr 2020 08:23:37 -0700
Subject: [PATCH 2/4] gnu: xorg-configuration-directory: Expose the function.

* gnu/services/xorg.scm (xorg-configuration-directory): Expose it.
---
gnu/services/xorg.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 4590709187..1c76049d23 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -65,6 +65,7 @@
xorg-configuration-server
xorg-configuration-server-arguments
+ xorg-configuration-directory
%default-xorg-modules
%default-xorg-fonts
xorg-wrapper
--
2.29.2
From dc7da1094047ebd47c0491f2a3ec0739362e2637 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Wed, 1 Apr 2020 08:34:20 -0700
Subject: [PATCH 3/4] gnu: xorg-configuration->file: Expose the function.

* gnu/services/xorg.scm (xorg-configuration->file): Expose it.
---
gnu/services/xorg.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 1c76049d23..fcd9b4d4f1 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -66,6 +66,8 @@
xorg-configuration-server-arguments
xorg-configuration-directory
+ xorg-configuration->file
+
%default-xorg-modules
%default-xorg-fonts
xorg-wrapper
--
2.29.2
From c217dcdb5a40f6b921541ebda19e78fe400ae27f Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Thu, 2 Apr 2020 03:58:07 -0700
Subject: [PATCH 4/4] gnu: %default-xorg-server-arguments: Expose variable.

* gnu/services/xorg.scm (%default-xorg-server-arguments): Expose it.
---
gnu/services/xorg.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index fcd9b4d4f1..6a1d9e07b6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -68,6 +68,7 @@
xorg-configuration-directory
xorg-configuration->file
+ %default-xorg-server-arguments
%default-xorg-modules
%default-xorg-fonts
xorg-wrapper
--
2.29.2
?
(name . John Soo)(address . jsoo1@asu.edu)(address . 45629@debbugs.gnu.org)
OSZP286MB06641AE69D712FE1C382A4E0A38C9@OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM
John Soo <jsoo1@asu.edu> writes:

Toggle quote (7 lines)
> Hi Guix,
>
> I wanted to try using startx instead of a display manager. I finally
> got it to work, but it required at very least these patches. I also had
> to create a new service type but I think that it needs more work to be
> put in upstream.

Hello, I have added a 'xorg-server-service-type' for this usage.

It can be used with 'sx' (as a normal user), or 'xinit'.

For 'xinit', you need to create a '~/.xserverrc` file with:

tty=$(tty)
tty=${tty#/dev/tty}
X vt${tty}

To use X in PATH and the current tty for rootless X server.


Do thoes patches still needed now?
Thank you!
J
J
John Soo wrote on 22 Feb 2021 04:39
(name . ???)(address . iyzsong@outlook.com)(name . 45629)(address . 45629@debbugs.gnu.org)
c6b34f3e-9722-4bc3-93d5-4f36aa82afed@Johns-iPhone
Hello!

Are the patches merged? I’m not sure I see the service in master. If they are, these patches may not be required.

Thanks!
Attachment: file
?
(name . John Soo)(address . jsoo1@asu.edu)(name . 45629)(address . 45629@debbugs.gnu.org)
OSZP286MB06643ACF2925B367DCF4CA36A39C9@OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM
John Soo <jsoo1@asu.edu> writes:

Toggle quote (2 lines)
> Are the patches merged? I’m not sure I see the service in master. If they are, these patches may not be required.

Yes, it's 'xorg-server-service-type' which will put a configured (by
xorg-configuration) X under /run/current-system/profile/bin.

With it, use 'sx' or 'xinit' as a normal user should works.

I haven't document it in the manual though...
J
J
John Soo wrote on 3 Mar 2021 21:00
(name . ???)(address . iyzsong@outlook.com)(name . 45629)(address . 45629@debbugs.gnu.org)
875z28vwh0.fsf@asu.edu
Hi again,

My setup for startx makes sure X is setgid and sets a few environment
variables for the process. I am not sure symlinking X to the bin
directory is exactly what I need.


The relevant pieces are the chown-program-service-type, and startx
definition.

Thanks again for improving the startx experience on Guix.

Kindly,

John
M
M
Maxim Cournoyer wrote on 7 May 2023 20:31
Re: bug#45629: [PATCH] gnu: Export xorg variables for startx.
(name . John Soo)(address . jsoo1@asu.edu)
87mt2gxab2.fsf_-_@gmail.com
Hi John,

John Soo <jsoo1@asu.edu> writes:

Toggle quote (6 lines)
> Hi again,
>
> My setup for startx makes sure X is setgid and sets a few environment
> variables for the process. I am not sure symlinking X to the bin
> directory is exactly what I need.

Could you please try and report of any success/problems encountered when
using xorg-server-service-type? If it works, we can close this issue.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 45629@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 45629
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch