Bug 236027 - x11/slim: Permit setting a default xsession from .xinitrc
Summary: x11/slim: Permit setting a default xsession from .xinitrc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Xin LI
Keywords: needs-qa
Depends on:
Reported: 2019-02-25 14:24 UTC by Andrew
Modified: 2019-10-02 05:05 UTC (History)
3 users (show)

See Also:
henry.hu.sh: maintainer-feedback+

Applies a patch to permit setting a default xsession from .xinitrc (476 bytes, text/plain)
2019-02-25 14:24 UTC, Andrew
no flags Details
Add the option XDEFAULT to allow setting a default xsession in .xinitrc (3.61 KB, patch)
2019-04-22 10:08 UTC, Andrew
henry.hu.sh: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2019-02-25 14:24:42 UTC
Created attachment 202354 [details]
Applies a patch to permit setting a default xsession from .xinitrc

The attached patch can be added to the "files" port subdir in order to apply the commit referenced by this pull request:

Just tested: it works on both releng/11.2 and releng/12.0.
Comment 1 Henry Hu 2019-03-13 02:10:19 UTC
If I understand correctly, I think that this patch may break slim for some users.
Let's say that a user has only 1 session in the sessions directory, and the .xinitrc only contains "exec $*". It works without the patch. However, if the patch is applied, then the default value passed in would be "default", and executing it would fail.
It should be okay if we make this an option and default to off. What do you think?
Comment 2 Andrew 2019-03-14 18:42:09 UTC
(In reply to Henry Hu from comment #1)

Thank you Henry, I understand your point, and I agree it's better to make it an option (after all, this patch has been committed only in slim's master branch). Let's only take a minute to think about which default value might be more reasonable...

I you install multiple desktop environments via pkg (but consider there are even other packages which install something in the session directory, like net/remmina), you are in an unsolvable trouble, because slim no longer supports even the "session" option in its configuration file, thus you are "condamned" to hit F1 each time you login to your desktop, because there is no way to set a priority among items in the session directory (you'll have the chance to build the custom package yourself, obviously).

On the contrary, if we default the port's option to "on", those who eventually have the "exec $1" in their own ~/.xinitrc must only change a word, which had to be manually written anyway.
And I guess most .xinitrc files out there serve the startx command more often than slim, so it's more likely they contains "exec start-my-xsession-here".

I personally think it's better to privilege "not experienced" users, who will more likely install their DE from pkg repository than build from Ports. Do you think it makes sense?
Comment 3 Henry Hu 2019-04-21 03:28:12 UTC
(In reply to Andrew from comment #2)
I understand that in current situation, you cannot select a default session, which is a huge problem if you have multiple desktop environments installed. However, I think that most people only have one desktop environment installed, so for them, the current approach works well, while the new patch would disrupt them.
Let's say one day you updated your packages, and nothing seemed wrong. Then you reboot your machine, and suddenly you find out that you cannot login to your machine. You need to switch into the console, somehow realize that the behavior of slim has changed, and change their .xinitrc. For single-desktop-environment users, they may well simply change "exec $*" to something such as "exec startkde", but it would still take some time.
I think that if we want to enable the patch by default, we need someway to clearly communicate this behavior change to the users. Maybe an entry in UPDATING would work, but I think that many people do not check what's in UPDATING.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-21 04:59:38 UTC
Comment on attachment 202354 [details]
Applies a patch to permit setting a default xsession from .xinitrc

Pending maintainer decision on how to move forward (or not).
Comment 5 Andrew 2019-04-21 10:47:15 UTC
(In reply to Henry Hu from comment #3)
I guess that a warning about such a change in the default behavior should be exposed in the pkg-message.in file. I happened several times to be informed in that way about disruptive changes in packages (I remember Squid and PostgreSQL for example, when their default directory path changed).
Obviously I think the last decision is up to you. After all it would also be useful to have only the option to compile slim with this patch.

Comment 6 Henry Hu 2019-04-21 15:50:33 UTC
(In reply to Andrew from comment #5)
I think that I'm okay with the patch if we make it an option which defaults to ON, and add a message to pkg-message.
Do you plan to create a new version of the patch? Otherwise I can create it.
Comment 7 Andrew 2019-04-21 15:57:55 UTC
(In reply to Henry Hu from comment #6)
Wonderful. I’ll do it ASAP, but after Monday... I have to celebrate at least two holiday days, if I want to maintain membership in my family! :)
Thanks, and happy Easter!
Comment 8 Henry Hu 2019-04-21 16:02:04 UTC
(In reply to Andrew from comment #7)
Thanks, happy Easter!
Comment 9 Andrew 2019-04-22 10:08:38 UTC
Created attachment 203891 [details]
Add the option XDEFAULT to allow setting a default xsession in .xinitrc

I managed to make it today. Tested on FreeBSD 12.0, with and without the option set.
Comment 10 Henry Hu 2019-05-06 00:28:25 UTC
Comment on attachment 203891 [details]
Add the option XDEFAULT to allow setting a default xsession in .xinitrc

Looks good. I'm curious why you removed some lines in pkg-message. Is there a limit on line count?
Comment 11 Andrew 2019-05-06 14:03:01 UTC
(In reply to Henry Hu from comment #10)
Thanks. No limit about lines in pkg-message as long as I know... I simply thought that it would be more readable if all content can be shown into a standard 80x24 terminal. :)
Comment 12 Andrew 2019-09-28 17:20:42 UTC
Sorry but, almost five months later, I do not see this patch committed yet.
Maybe there is anything I still have to do which you are waiting for?
Comment 13 Henry Hu 2019-09-28 19:13:24 UTC
(In reply to Andrew from comment #12)
I have approved the patch. Typically someone with commit permission will come and commit the patch.
Now no one has shown up. Let me ping someone.
Comment 14 commit-hook freebsd_committer 2019-10-02 05:04:44 UTC
A commit references this bug:

Author: delphij
Date: Wed Oct  2 05:04:15 UTC 2019
New revision: 513545
URL: https://svnweb.freebsd.org/changeset/ports/513545

  x11/slim: Permit setting a default xsession from .xinitrc.

  PR:		236027
  Submitted by:	Andrew Hotlab <andrew.hotlab hotmail com>
  Approved by:	Henry Hu (maintainer)

Comment 15 Xin LI freebsd_committer 2019-10-02 05:05:08 UTC
Committed, thanks!