Skip to content

Allow passing a username directly#94

Open
GaetanLepage wants to merge 1 commit into
apognu:masterfrom
GaetanLepage:default-user
Open

Allow passing a username directly#94
GaetanLepage wants to merge 1 commit into
apognu:masterfrom
GaetanLepage:default-user

Conversation

@GaetanLepage

Copy link
Copy Markdown

Hello !
This is a proposal to add a new option --user (or --default-user) which would make possible to call tuigreet with a username to be pre-filled.
Of course, someone could already user the --remember but it could be useful to be able to 'hardcode' directly the desired username in the CLI arguments.

Note: I have almost 0 knowledge in Rust. The provided code has to be taken with care !

@teto

teto commented Oct 16, 2024

Copy link
Copy Markdown

I like the idea as well

@apognu

apognu commented Oct 16, 2024

Copy link
Copy Markdown
Owner

I'm not against adding that in 0.11 (so not the next version, which I would like to be feature-freezed until release). 0.11 will also include a way to configure tuigreet through a configuration file, so this will fit nicely.

Before I look at the code, let's talk about the functional side. How will this cohabit with the remember feature? Because the way I see it, if remember is enabled, the first time you log in with the default user, it will be cached, which will make changing the default user a no-op. On the other hand, whenever another user logs in, the default will be ignored.

Should we forbid using both options at the same time to prevent confusion?

Also (but it can wait until we agree on the point above), the README and the manpage will need to be updated to include the new option, and a test will need to be written / edited to include this option.

Edit: I just saw this is... one year old. Apologies for not seeing it before. I must have missed the notification.

@GaetanLepage

Copy link
Copy Markdown
Author

I'm not against adding that in 0.11 (so not the next version, which I would like to be feature-freezed until release). 0.11 will also include a way to configure tuigreet through a configuration file, so this will fit nicely.

Makes sense ! A config file is a great idea.

Before I look at the code, let's talk about the functional side. How will this cohabit with the remember feature? Because the way I see it, if remember is enabled, the first time you log in with the default user, it will be cached, which will make changing the default user a no-op. On the other hand, whenever another user logs in, the default will be ignored.

Should we forbid using both options at the same time to prevent confusion?

I would say that we either prevent both options to be simultaneously provided or we (silently or not) make the --username take precedence over --remember.

Also (but it can wait until we agree on the point above), the README and the manpage will need to be updated to include the new option, and a test will need to be written / edited to include this option.

Sure, I will do so after we agree on the spec.

Edit: I just saw this is... one year old. Apologies for not seeing it before. I must have missed the notification.

Don't worry ! I had forgotten about it too. Thanks for taking the time to look at it in the end anyway :)

@fxzzi

fxzzi commented Apr 9, 2025

Copy link
Copy Markdown

i would like to see this added as it would be very useful for my nixos single-user setup.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants