diff mbox series

[bug#35493,1/3] gnu: slim: Allow customisation of Xorg display.

Message ID 87zho88yh4.fsf@GlaDOS.home
State Accepted
Headers show
Series Allow multiple SLiM services. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Diego Nicola Barbato April 29, 2019, 6:20 p.m. UTC

Comments

Ludovic Courtès May 6, 2019, 8:35 a.m. UTC | #1
Hi Diego,

Diego Nicola Barbato <dnbarbato@posteo.de> skribis:

>>From 7e7205e0f8d70a89a7ed4fd4844feb9b6a8d8567 Mon Sep 17 00:00:00 2001
> From: Diego Nicola Barbato <dnbarbato@posteo.de>
> Date: Sun, 28 Apr 2019 14:48:47 +0200
> Subject: [PATCH 1/3] gnu: slim: Allow customisation of Xorg display.
>
> Previously SLiM could only start on display :0.0.  This change makes it
> possible to run multiple instances of SLiM at the same time.
>
> * gnu/packages/patches/slim-display.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/display-managers.scm (slim): Use it.

[...]

> +++ b/gnu/packages/patches/slim-display.patch
> @@ -0,0 +1,75 @@
> +Add "display_name" configuration option and use its value instead of
> +the hard coded one.
> +
> +Patch by Diego N. Barbato

The patch LGTM.  Just one question: did you submit it upstream (is there
still an upstream?), and if so, could we add the URL of upstream’s
tracking software or an indication about the submission?

Thanks,
Ludo’.
Diego Nicola Barbato May 6, 2019, 11:31 a.m. UTC | #2
Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Diego,
>
> Diego Nicola Barbato <dnbarbato@posteo.de> skribis:
>
>>>From 7e7205e0f8d70a89a7ed4fd4844feb9b6a8d8567 Mon Sep 17 00:00:00 2001
>> From: Diego Nicola Barbato <dnbarbato@posteo.de>
>> Date: Sun, 28 Apr 2019 14:48:47 +0200
>> Subject: [PATCH 1/3] gnu: slim: Allow customisation of Xorg display.
>>
>> Previously SLiM could only start on display :0.0.  This change makes it
>> possible to run multiple instances of SLiM at the same time.
>>
>> * gnu/packages/patches/slim-display.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Add it.
>> * gnu/packages/display-managers.scm (slim): Use it.
>
> [...]
>
>> +++ b/gnu/packages/patches/slim-display.patch
>> @@ -0,0 +1,75 @@
>> +Add "display_name" configuration option and use its value instead of
>> +the hard coded one.
>> +
>> +Patch by Diego N. Barbato
>
> The patch LGTM.  Just one question: did you submit it upstream (is there
> still an upstream?), and if so, could we add the URL of upstream’s
> tracking software or an indication about the submission?

I did not submit it upstream (the most likely candidate seems to be this
[0] even though it is not mentioned e.g. on the ArchWiki), since the
general consensus seems to be that the project has been abandoned.

Regards,

Diego

[0]: https://github.com/iwamatsu/slim
Ludovic Courtès May 7, 2019, 1:55 p.m. UTC | #3
Hi Diego,

Diego Nicola Barbato <dnbarbato@posteo.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:

[...]

>> The patch LGTM.  Just one question: did you submit it upstream (is there
>> still an upstream?), and if so, could we add the URL of upstream’s
>> tracking software or an indication about the submission?
>
> I did not submit it upstream (the most likely candidate seems to be this
> [0] even though it is not mentioned e.g. on the ArchWiki), since the
> general consensus seems to be that the project has been abandoned.

That makes sense.

I’ve applied the 3 patches and confirmed that
gnu/system/examples/vm-image.tmpl, which uses SLiM, still works
correctly.

However, I’ve noticed that this changes the name of the default Shepherd
service from ‘xorg-server’ to ‘xorg-server-vt7’.

What about generating an ‘xorg-server’ Shepherd service that would
depend on all the ‘xorg-server-vtN’ services?  Hmm that wouldn’t be
entirely equivalent: ‘herd start xorg-server’ would start them all, but
‘herd stop xorg-server’ wouldn’t stop any of them.

Perhaps a simple fix is, when there’s only one server launched, to have
the Shepherd service provide both ‘xorg-server-vtN’ and ‘xorg-server’.
Or to special-case vt7 such that the service for vt7 provides both
‘xorg-server’ and ‘xorg-server-vt7’.

Thoughts?

Thanks,
Ludo’.
diff mbox series

Patch

From 7e7205e0f8d70a89a7ed4fd4844feb9b6a8d8567 Mon Sep 17 00:00:00 2001
From: Diego Nicola Barbato <dnbarbato@posteo.de>
Date: Sun, 28 Apr 2019 14:48:47 +0200
Subject: [PATCH 1/3] gnu: slim: Allow customisation of Xorg display.

Previously SLiM could only start on display :0.0.  This change makes it
possible to run multiple instances of SLiM at the same time.

* gnu/packages/patches/slim-display.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/display-managers.scm (slim): Use it.
---
 gnu/local.mk                            |  1 +
 gnu/packages/display-managers.scm       |  3 +-
 gnu/packages/patches/slim-display.patch | 75 +++++++++++++++++++++++++
 3 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/slim-display.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f79bfd8b93..0b952f6f9f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1267,6 +1267,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/slim-sigusr1.patch			\
   %D%/packages/patches/slim-reset.patch				\
   %D%/packages/patches/slim-login.patch				\
+  %D%/packages/patches/slim-display.patch			\
   %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch	\
   %D%/packages/patches/sooperlooper-build-with-wx-30.patch 	\
   %D%/packages/patches/soundconverter-remove-gconf-dependency.patch	\
diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index afe5cc2b7b..f653bd60c5 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -322,7 +322,8 @@  GTK+, lets you select a desktop session and log in to it.")
                                       "slim-reset.patch"
                                       "slim-login.patch"
                                       "slim-session.patch"
-                                      "slim-sigusr1.patch"))))
+                                      "slim-sigusr1.patch"
+                                      "slim-display.patch"))))
     (build-system cmake-build-system)
     (inputs `(("linux-pam" ,linux-pam)
 	      ("libpng" ,libpng)
diff --git a/gnu/packages/patches/slim-display.patch b/gnu/packages/patches/slim-display.patch
new file mode 100644
index 0000000000..f68604a94b
--- /dev/null
+++ b/gnu/packages/patches/slim-display.patch
@@ -0,0 +1,75 @@ 
+Add "display_name" configuration option and use its value instead of
+the hard coded one.
+
+Patch by Diego N. Barbato
+
+--- a/app.cpp	1970-01-01 01:00:00.000000000 +0100
++++ b/app.cpp	2019-04-27 13:48:23.479133531 +0200
+@@ -190,7 +190,13 @@
+ }
+ 
+ void App::Run() {
+-	DisplayName = DISPLAY;
++	/* Read configuration */
++	cfg = new Cfg;
++	char *cfgfile = getenv("SLIM_CFGFILE");
++	if (!cfgfile) cfgfile = CFGFILE;
++	cfg->readConf(cfgfile);
++
++	DisplayName = cfg->getOption("display_name").c_str();
+ 
+ #ifdef XNEST_DEBUG
+ 	char* p = getenv("DISPLAY");
+@@ -200,11 +206,7 @@
+ 	}
+ #endif
+ 
+-	/* Read configuration and theme */
+-	cfg = new Cfg;
+-	char *cfgfile = getenv("SLIM_CFGFILE");
+-	if (!cfgfile) cfgfile = CFGFILE;
+-	cfg->readConf(cfgfile);
++	/* Read theme */
+ 	string themebase = "";
+ 	string themefile = "";
+ 	string themedir = "";
+@@ -911,9 +913,7 @@
+ 	static const int MAX_XSERVER_ARGS = 256;
+ 	static char* server[MAX_XSERVER_ARGS+2] = { NULL };
+ 	server[0] = (char *)cfg->getOption("default_xserver").c_str();
+-	string argOption = cfg->getOption("xserver_arguments");
+-	/* Add mandatory -xauth option */
+-	argOption = argOption + " -auth " + cfg->getOption("authfile");
++	string argOption = cfg->getOption("display_name") + " " + cfg->getOption("xserver_arguments") + " -auth " + cfg->getOption("authfile");
+ 	char* args = new char[argOption.length()+2]; /* NULL plus vt */
+ 	strcpy(args, argOption.c_str());
+ 
+@@ -1233,7 +1233,7 @@
+ 	authfile = cfg->getOption("authfile");
+ 	remove(authfile.c_str());
+ 	putenv(StrConcat("XAUTHORITY=", authfile.c_str()));
+-	Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
++	Util::add_mcookie(mcookie, cfg->getOption("display_name").c_str(), cfg->getOption("xauth_path"),
+ 	  authfile);
+ }
+ 
+--- a/cfg.cpp	1970-01-01 01:00:00.000000000 +0100
++++ b/cfg.cpp	2019-04-27 13:49:40.511773743 +0200
+@@ -31,6 +31,7 @@
+ 	/* Configuration options */
+ 	options.insert(option("default_path","/bin:/usr/bin:/usr/local/bin"));
+ 	options.insert(option("default_xserver","/usr/bin/X"));
++	options.insert(option("display_name",":0.0"));
+ 	options.insert(option("xserver_arguments",""));
+ 	options.insert(option("numlock",""));
+ 	options.insert(option("daemon",""));
+--- a/switchuser.cpp	1970-01-01 01:00:00.000000000 +0100
++++ b/switchuser.cpp	2019-04-27 13:50:19.380096651 +0200
+@@ -54,6 +54,6 @@
+ 	string home = string(Pw->pw_dir);
+ 	string authfile = home + "/.Xauthority";
+ 	remove(authfile.c_str());
+-	Util::add_mcookie(mcookie, ":0", cfg->getOption("xauth_path"),
++	Util::add_mcookie(mcookie, displayName.c_str(), cfg->getOption("xauth_path"),
+ 	  authfile);
+ }
-- 
2.21.0