-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
motds: fix and update dynamic motd.sh
- 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
- Loading branch information
1 parent
8114730
commit 9ae171e
Showing
2 changed files
with
63 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,61 @@ | ||
echo "" | ||
echo -e " \e[47m \e[0m \e[1mWelcome to Termux!\e[0m" | ||
echo -e " \e[47m \e[0m \e[0;37m\e[47m .\e[0m" | ||
echo -e " \e[47m \e[0m \e[47m \e[0m \e[47m \e[0m \e[1mDocs:\e[0m \e[4mtermux.dev/docs\e[0m" | ||
echo -e " \e[47m \e[0m \e[47m \e[0m \e[47m \e[0m \e[1mGitter:\e[0m \e[4mgitter.im/termux/termux\e[0m" | ||
echo -e " \e[47m \e[0m \e[47m \e[0m \e[1mCommunity:\e[0m \e[4mtermux.dev/community\e[0m" | ||
echo -e " \e[47m \e[0m \e[0;37m\e[47m .\e[0m" | ||
echo -e " \e[47m \e[0m \e[1mTermux version:\e[0m ${TERMUX_VERSION-Unknown}" | ||
echo "" | ||
echo -e " \e[1mWorking with packages:\e[0m" | ||
echo -e " \e[1mSearch:\e[0m pkg search <query>" | ||
echo -e " \e[1mInstall:\e[0m pkg install <package>" | ||
echo -e " \e[1mUpdate:\e[0m pkg update" | ||
echo "" | ||
if [ "$TERMUX_MAIN_PACKAGE_FORMAT" = "debian" ]; then | ||
echo -e " \e[1mSubscribing to additional repos:\e[0m" | ||
echo -e " \e[1mRoot:\e[0m pkg install root-repo" | ||
echo -e " \e[1mX11: \e[0m pkg install x11-repo" | ||
echo "" | ||
echo " For fixing any repository issues," | ||
echo " try 'termux-change-repo' command." | ||
echo "" | ||
#!@TERMUX_PREFIX@/bin/bash | ||
|
||
# Setup TERMUX_APP_PACKAGE_MANAGER | ||
source "@TERMUX_PREFIX@/bin/termux-setup-package-manager" || exit 1 | ||
|
||
terminal_width="$(stty size | cut -d" " -f2)" | ||
if [[ "$terminal_width" =~ ^[0-9]+$ ]] && [ "$terminal_width" -gt 60 ]; then | ||
|
||
motd=" | ||
\e[47m \e[0m \e[1mWelcome to Termux!\e[0m | ||
\e[47m \e[0m \e[0;37m\e[47m .\e[0m | ||
\e[47m \e[0m \e[47m \e[0m \e[47m \e[0m \e[1mDocs:\e[0m \e[4mhttps://termux.dev/docs\e[0m | ||
\e[47m \e[0m \e[47m \e[0m \e[47m \e[0m \e[1mDonate:\e[0m \e[4mhttps://termux.dev/donate\e[0m | ||
\e[47m \e[0m \e[47m \e[0m \e[1mCommunity:\e[0m \e[4mhttps://termux.dev/community\e[0m | ||
\e[47m \e[0m \e[0;37m\e[47m .\e[0m | ||
\e[47m \e[0m \e[1mTermux version:\e[0m ${TERMUX_VERSION-Unknown} | ||
" | ||
|
||
motd_indent=" " | ||
|
||
else | ||
|
||
motd=" | ||
\e[1mWelcome to Termux!\e[0m | ||
\e[1mDocs:\e[0m \e[4mhttps://termux.dev/docs\e[0m | ||
\e[1mDonate:\e[0m \e[4mhttps://termux.dev/donate\e[0m | ||
\e[1mCommunity:\e[0m \e[4mhttps://termux.dev/community\e[0m | ||
\e[1mTermux version:\e[0m ${TERMUX_VERSION-Unknown} | ||
" | ||
|
||
motd_indent="" | ||
fi | ||
echo -e " Report issues at \e[4mtermux.dev/issues\e[0m" | ||
echo "" | ||
|
||
motd+=" | ||
${motd_indent}\e[1mWorking with packages:\e[0m | ||
${motd_indent}\e[1mSearch:\e[0m pkg search <query> | ||
${motd_indent}\e[1mInstall:\e[0m pkg install <package> | ||
${motd_indent}\e[1mUpgrade:\e[0m pkg upgrade | ||
" | ||
|
||
|
||
if [ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" ]; then | ||
|
||
motd+=" | ||
${motd_indent}\e[1mSubscribing to additional repos:\e[0m | ||
${motd_indent}\e[1mRoot:\e[0m pkg install root-repo | ||
${motd_indent}\e[1mX11:\e[0m pkg install x11-repo | ||
${motd_indent}For fixing any repository issues, | ||
${motd_indent}try 'termux-change-repo' command. | ||
" | ||
|
||
fi | ||
|
||
motd+=" | ||
${motd_indent}Report issues at \e[4mhttps://termux.dev/issues\e[0m | ||
" | ||
|
||
echo -e "$motd" |