Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/xterm: Replace by nixos/xsession #68371

Closed
wants to merge 2 commits into from

Conversation

adisbladis
Copy link
Member

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

…hing as `xterm`

`xterm` is badly named and is confusing users.
`xsession` is a far more descriptive name that will guide the user to
create a working session by themselves.
And add notice explaining how it's replaced by `xsession`.
@adisbladis adisbladis changed the title nixos/xterm: Replace by xsession nixos/xterm: Replace by nixos/xsession Sep 9, 2019
services.xserver.desktopManager.session = singleton
{ name = "xsession";
start = ''
${pkgs.gnome3.zenity}/bin/zenity --error --text 'The user must provide a ~/.xsession file containing session startup commands.' --no-wrap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this program, would it bring in some undesirable deps for certain users?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wanted to use xdialog but that was seemingly not packaged. If you know of another similar package I'm all ears.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use xmessage (though with a far less readable error message).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's xmessage but it's kinda ugly. Looking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, looks like I commented that before refreshing 🤣

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems xdialog also uses gtk so I'm not sure it matters much.

Copy link
Member

@samueldr samueldr Sep 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I was thinking about xmessage when I said xdialog. I do agree this require a change to not bring gnome3 into scope.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, being pretty is not a desired outcome. The outcome is to ensure that people relying on xsession have a solution, while at least showing something to other users explaining what's going on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with zenity then (unless anyone have another good option).
I don't want to sacrifice readability.

@samueldr
Copy link
Member

samueldr commented Sep 9, 2019

Writing user-friendly message is hard, with that said, let's think up better ones.

First of all, there are two situations where the message will be shown

  1. The user wants an xsession-based session, but has no ~/.xsession file.
  2. The session selection somehow selected the xsession-based session in yet undetermined conditions. (Unlikely in the following NixOS releases where this will default to false.)

For the first kind of users, the message explains what to do correctly. Though, the phrasing ("the user") makes for a weirdly disjointed experience. "The user" is likely the one reading the message.

For the second kind of users, it does not help them. They are being asked to create a file they may not want, or know how to use. The message needs to somehow explain that they must choose another session in the display manager. Bonus points for detecting that there are other sessions enabled, when there aren't add that they need to enable other sessions. Additional bonus points to show specific instructions for the enabled display manager.

@samueldr
Copy link
Member

samueldr commented Sep 9, 2019

An action is required

Your session started with the xsession session type without a ~/.xsession file.

You will need to do one of the two following actions, depending.

  1. You know what is an xsession file and want to use the xsession session type. Please add the xsession script at the expected location (~/.xsession) and log back in.

  2. You don't know what is an xsession file and did not expect to see this message. $$$

And for $$$

When there are more sessions enabled:

At the login prompt, select another session type.

When only xsession is enabled:

Configure the desired services.xserver.desktopManager or services.xserver.windowManager in your configuration.nix and rebuild the system. You will be able to select the desired session type at the login prompt.


Does this sound feasible? I'm thinking though that this may be a bit abrupt to only show those messages without giving the ability to act on them within the session... which would only be possible if we launched a terminal for the user, in addition to the prompt. And now I'm thinking we may need to figure out the WM with the smallest closure and somehow shoe-horn it there and I'm not so sure about anything :/.

@worldofpeace
Copy link
Contributor

Suddenly we've created a fallback xterm session for the user with very helpful messages @samueldr
(not that this is a bad thing)
And I'm still not sure the issue with the xterm session being selected as a default was just an issue with upstream xsessions in nixpkgs.

@samueldr
Copy link
Member

samueldr commented Sep 9, 2019

I believe that we'll see some users enable xserver without enabling a particular WM or DM. In those cases the message will help steer those the right way.

Though, I think there's one difference in having a wm+xterm, compared to xterm only: user friendlyness. xterm doesn't allow nicely launching graphical tools, as there is no wm to resize the windows. Additionally, writing in the terminal doesn't work unless your mouse hovers it. Even if the session only starts a fullscreen-type wm, which has some knowledge about managing windows, it ends up being more user friendly than a raw xterm.


~/tmp/nixpkgs/nixpkgs $ nix path-info -hS ./result*
/nix/store/4l1dm6fm5408gzxxd7jjfil5q7dd4853-twm-1.0.10            34.7M
/nix/store/lp9hifv43iic2shsrwvg9j7512m1sdpq-matchbox-1.2          36.9M

@rycee
Copy link
Member

rycee commented Oct 9, 2019

Shouldn't this also include removing the lines

# Allow the user to setup a custom session type.
if test -x ~/.xsession; then
eval exec ~/.xsession "$@"
fi

from display-managers/default.nix? Otherwise it seems to me that the ~/.xsession file would take priority regardless of the choice of desktop manager.

@worldofpeace
Copy link
Contributor

@rycee I think we discussed that this change is just a starting point to eventually do this.
i.e it would be much easier to have this change right away instead of trying to do that all in one go.

@rycee
Copy link
Member

rycee commented Oct 9, 2019

@worldofpeace Fair enough, I haven't followed the discussions and I agree that this change by itself would be very useful for somebody who's not having an ~/.xsession file.

@Ericson2314
Copy link
Member

I'm still down to do this or something similar for 20.03.

@worldofpeace
Copy link
Contributor

worldofpeace commented Dec 4, 2019

Sounds good to me @Ericson2314. I'll add it to the milestone, hopefully we can circle back to get it finished. It was just difficult when it came in when 19.09 was released/releasing.

Edit: already in the milestone.

@xaverdh
Copy link
Contributor

xaverdh commented Dec 17, 2019

Am I correct that this means that to get no desktopManager at all, you will need to explicitly set services.xserver.desktopManager.session.enable to false again?

@disassembler disassembler modified the milestones: 20.03, 20.09 Feb 5, 2020
@stale
Copy link

stale bot commented Aug 3, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 3, 2020
@FRidh FRidh modified the milestones: 20.09, 21.03 Dec 20, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 20, 2020
@stale
Copy link

stale bot commented Jun 18, 2021

I marked this as stale due to inactivity. → More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants