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

Open
wants to merge 2 commits into
base: master
from

Conversation

@adisbladis
Copy link
Member

commented Sep 9, 2019

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 @

adisbladis added 2 commits Sep 9, 2019
nixos/xsession: Add a new `xsession` type that does almost the same t…
…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.
nixos/xterm: Disable by default
And add notice explaining how it's replaced by `xsession`.

@adisbladis adisbladis requested a review from worldofpeace Sep 9, 2019

@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

This comment has been minimized.

Copy link
@worldofpeace

worldofpeace Sep 9, 2019

Member

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

This comment has been minimized.

Copy link
@adisbladis

adisbladis Sep 9, 2019

Author Member

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

This comment has been minimized.

Copy link
@adisbladis

adisbladis Sep 9, 2019

Author Member

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

This comment has been minimized.

Copy link
@worldofpeace

worldofpeace Sep 9, 2019

Member

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

This comment has been minimized.

Copy link
@worldofpeace

worldofpeace Sep 9, 2019

Member

Huh, looks like I commented that before refreshing 🤣

This comment has been minimized.

Copy link
@worldofpeace

worldofpeace Sep 9, 2019

Member

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

This comment has been minimized.

Copy link
@samueldr

samueldr Sep 9, 2019

Member

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

This comment has been minimized.

Copy link
@samueldr

samueldr Sep 9, 2019

Member

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.

This comment has been minimized.

Copy link
@adisbladis

adisbladis Sep 9, 2019

Author Member

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

@samueldr

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

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

This comment has been minimized.

Copy link
Member

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

@lheckemann lheckemann added this to the 20.03 milestone Sep 10, 2019

@worldofpeace worldofpeace referenced this pull request Sep 19, 2019
0 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.