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

enhance(main/termux-tools): new motd design #11250

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

TermuxMonet
Copy link
Contributor

For aesthetic pruposes, changed the motd by adding a small termux icon, termux version display and a hint to fix repo issues related to termux-change repo.
And also, now login executes a dynamic motd.sh, which can expand environment variables and display text formatting.
Common motd support wasn't removed, since now the login just distinguishes between dynamic and common motd (prioritising the dynamic motd)

Preview:
Screenshot_20220710-214038_Termux~01

(Duplicate of #11222. Previous commit got broken)

Co-authored-by: TomJo2000

Copy link
Member

@Maxython Maxython left a comment

Choose a reason for hiding this comment

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

I think that the information about fixing the termux repository will not be relevant for pacman users. Add this message only for the debian package.

@TermuxMonet
Copy link
Contributor Author

I think that the information about fixing the termux repository will not be relevant for pacman users. Add this message only for the debian package.

Done

Added a new termux motd dynamic design.
Closes #11222

Co-authored-by: TomJo2000 <tomjo00@web.de>
@TermuxMonet
Copy link
Contributor Author

Is this PR gonna be merged?

@2096779623
Copy link
Member

Is this PR gonna be merged?

LGTM, of course.

Wait for the github action to finish before merging it.

@2096779623 2096779623 merged commit 4334a09 into termux:master Jul 19, 2022
@ghost
Copy link

ghost commented Jul 20, 2022

I think its better the previous motd design should be used or without the Termux logo. zooming in/out the terminal would mess the logo up and makes the motd unreadable in portrait screens
Screenshot_2022-07-20-14-35-07-33_84d3000e3f4017145260f7618db1d683

@agnostic-apollo
Copy link
Member

This was mentioned to OP but wasn't removed. Text word wrap is fine, icon wrapping is not good and can't be avoided. Other changes are fine, didn't get time to test.

#11222 (comment)

@truboxl
Copy link
Contributor

truboxl commented Jul 20, 2022

Merged too early I guess...

@TermuxMonet
Copy link
Contributor Author

I think its better the previous motd design should be used or without the Termux logo. zooming in/out the terminal would mess the logo up and makes the motd unreadable in portrait screens

Too late for a hotfix? this can be fixed by adding a character (dot) inside the logo squares
and then, the terminal shouldn't delete any empty lines (and the logo isn't destroyed)
Screenshot_20220720-101628_Termux

@gascs
Copy link

gascs commented Aug 3, 2022

I don't think the existence of this micro logo is necessary, after I updated my terminal, he messed up my original layout, and I couldn't modify it at first, and the logo is very unaesthetic, yes it's very lacking aesthetics!

@gascs
Copy link

gascs commented Aug 3, 2022

And this move is superfluous, which makes my original modification method invalid, and I am very distressed

@agnostic-apollo
Copy link
Member

The icon only is planned to be removed from new motd due to word wrap issue, rest will stay, didn't get time to fix. Can provide an env variable for users to have their own as well, so that whoever likes icons and stuff can use one easily without requiring modifications on package updates.

@TomJo2000
Copy link
Member

The icon only is planned to be removed from new motd due to word wrap issue, rest will stay, didn't get time to fix. Can provide an env variable for users to have their own as well, so that whoever likes icons and stuff can use one easily without requiring modifications on package updates.

btw I think I've worked out a solution to the line wrapping issue, I just haven't had the time to fully test it yet.

@agnostic-apollo
Copy link
Member

I see, how are you doing it?

@gascs
Copy link

gascs commented Aug 3, 2022

I see, how are you doing it?

what?

@TomJo2000
Copy link
Member

TomJo2000 commented Aug 3, 2022

I see, how are you doing it?

By checking the $COLUMNS environment variable against the width of the logo.
That itself wouldn't prevent wrapping from zooming in though.

@agnostic-apollo
Copy link
Member

By checking the $COLUMNS environment variable against the width of the logo

Resizing after motd has already been generated will still break it and make it "unreadable".

@TomJo2000
Copy link
Member

Resizing after motd has already been generated will still break it and make it "unreadable".

That's what I'm still working on.

@agnostic-apollo
Copy link
Member

The env variable for custom motd file is a better option for you guys. The defaults should not break. Maybe an additional env variable that decides whether icon should be printed or not could be added too, then custom motd file will not need to be downloaded/created by users.

@TomJo2000
Copy link
Member

TomJo2000 commented Aug 3, 2022

The env variable for custom motd file is a better option for you guys. The defaults should not break. Maybe an additional env variable that decides whether icon should be printed or not could be added too, then custom motd file will not need to be downloaded/created by users.

That's also a good idea, I'll have to see when I have some time to work out the kinks on this.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Aug 3, 2022

Thanks. If you can do it, then good. Note that termux-tools is in the process of being moved to https://github.com/termux/termux-tools

@TomJo2000
Copy link
Member

I'll wanna make sure it's all working as intended before making a Pull Request, so I'll keep it in mind for later.

@TomJo2000
Copy link
Member

TomJo2000 commented Aug 9, 2022

Update on this.
I've just pushed a first draft of a proper fix for the wrapping issue to my fork of termux-tools.
https://github.com/TomJo2000/motd-wrap/commit/10e1af39dd44bf74b745e95c3e502719df6c6536

Hopefully I'll have time to touch this up and make a Pull Request over on termux-tools tomorrow, although I just started a new internship and I've been incredibly busy.
I hope we can get this issue fixed as soon as possible though.

agnostic-apollo added a commit to termux/termux-tools that referenced this pull request Aug 13, 2022
- The logo added in new dynamic motd would break due to word wrap if terminal columns were less than max line length. This fixes the issue by not drawing a logo if terminal columns are too few at draw time. Note that logo will still break if terminal size is changed after drawing.

- Use TERMUX_APP_PACKAGE_MANAGER instead of TERMUX_MAIN_PACKAGE_FORMAT

- Add donate link instead of gitter which should already exist in community link, including matrix rooms link.

Related pull requests termux/termux-packages#11250 and termux/termux-packages#11250
agnostic-apollo added a commit to termux/termux-tools that referenced this pull request Aug 13, 2022
- The logo added in new dynamic motd would break due to word wrap if terminal columns were less than max line length. This fixes the issue by not drawing a logo if terminal columns are too few at draw time. Note that logo will still break if terminal size is changed after drawing.

- Use TERMUX_APP_PACKAGE_MANAGER instead of TERMUX_MAIN_PACKAGE_FORMAT

- Add donate link instead of gitter which should already exist in community link, including matrix rooms link.

Related pull requests termux/termux-packages#11250 and termux/termux-packages#11294
agnostic-apollo added a commit to termux/termux-tools that referenced this pull request Aug 15, 2022
- The logo added in new dynamic motd would break due to word wrap if terminal columns were less than max line length. This fixes the issue by not drawing a logo if terminal columns are too few at draw time. Note that logo will still break if terminal size is changed after drawing.

- Use TERMUX_APP_PACKAGE_MANAGER instead of TERMUX_MAIN_PACKAGE_FORMAT

- Add donate link instead of gitter which should already exist in community link, including matrix rooms link.

Related pull requests termux/termux-packages#11250 and termux/termux-packages#11294
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.

7 participants