diff --git a/motds/Makefile.am b/motds/Makefile.am index a82feb4..5e34b42 100644 --- a/motds/Makefile.am +++ b/motds/Makefile.am @@ -24,9 +24,9 @@ # The motd-playstore is an additional motd that will only be displayed # if the termux-app version is very old (like the version found on playstore) -sysconf_DATA = motd.sh motd-playstore +sysconf_DATA = motd.sh motd motd-playstore -CLEANFILES = motd.sh +CLEANFILES = motd.sh motd do_subst = sed -e "s%[@]TERMUX_PREFIX[@]%$(termux_prefix)%g" @@ -38,3 +38,34 @@ $1: $1.in Makefile endef $(eval $(call process-rule,motd.sh)) + + +motd: + @echo "Creating motd file" + + @echo "Welcome to Termux!" > motd + @echo "" >> motd + @echo "Docs: https://termux.dev/docs" >> motd + @echo "Donate: https://termux.dev/donate" >> motd + @echo "Community: https://termux.dev/community" >> motd + + @echo "" >> motd + @echo "Working with packages:" >> motd + @echo "" >> motd + @echo " - Search: pkg search " >> motd + @echo " - Install: pkg install " >> motd + @echo " - Upgrade: pkg upgrade" >> motd + + ifeq ($(TERMUX_PACKAGE_MANAGER),apt) + @echo "" >> motd + @echo "Subscribing to additional repositories:" >> motd + @echo "" >> motd + @echo " - Root: pkg install root-repo" >> motd + @echo " - X11: pkg install x11-repo" >> motd + @echo "" >> motd + @echo "For fixing any repository issues," >> motd + @echo "try 'termux-change-repo' command." >> motd + endif + + @echo "" >> motd + @echo "Report issues at https://termux.dev/issues" >> motd diff --git a/scripts/login.in b/scripts/login.in index fee5239..393322e 100644 --- a/scripts/login.in +++ b/scripts/login.in @@ -1,9 +1,11 @@ #!/bin/sh if tty >/dev/null 2>&1 && [ $# = 0 ] && [ ! -f ~/.hushlogin ] && [ -z "$TERMUX_HUSHLOGIN" ]; then - if [ -f @TERMUX_PREFIX@/etc/motd.sh ]; then - # Dynamic motd is preferred over plain-text. - bash @TERMUX_PREFIX@/etc/motd.sh + # Use user defined dynamic motd file if it exists + if [ -f ~/.termux/motd.sh ]; then + [ ! -x ~/.termux/motd.sh ] && chmod u+x ~/.termux/motd.sh + ~/.termux/motd.sh + # Default to termux-tools package provided static motd file if it exists elif [ -f @TERMUX_PREFIX@/etc/motd ]; then cat @TERMUX_PREFIX@/etc/motd fi