From ff2d0d699f1993e38e50642c1f4ef65651cb8303 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Sat, 21 Dec 2024 00:07:08 +0530 Subject: [PATCH] feat: ask for donations during december Recently KDE just did a really good fundraiser by asking for donations using a one-time notification which they plan on having once every December. In future this should likely be moved directly to the Termux app. Donation requests can be made during year end and when new major releases are made. Also, we are probably late, but probably not very late :) Currently motd.sh.in has the logic encoded within to only ask for donations in December, but the static motd file can't hold any such logic. So this file needs to be reverted back to it's original form after December. KDE fundraiser: https://kde.org/fundraisers/yearend2024/ --- motds/motd | 15 +++++++++++++++ motds/motd.sh.in | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 motds/motd diff --git a/motds/motd b/motds/motd new file mode 100644 index 0000000..5a412be --- /dev/null +++ b/motds/motd @@ -0,0 +1,15 @@ +Welcome to Termux! + +Docs: https://termux.dev/docs +Donate: https://termux.dev/donate +Community: https://termux.dev/community + +Working with packages: + + - Search: pkg search + - Install: pkg install + - Upgrade: pkg upgrade + +Report issues at https://termux.dev/issues +Termux needs your help! Donations help fund development and infrastructure import for Termux's continued existence +Consider donating at https://termux.dev/en/donate diff --git a/motds/motd.sh.in b/motds/motd.sh.in index 1a76844..89f4839 100644 --- a/motds/motd.sh.in +++ b/motds/motd.sh.in @@ -24,8 +24,12 @@ else \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 +" + if [ "$(date +%m)" != "12" ]; then + motd+="\e[1mDonate:\e[0m \e[4mhttps://termux.dev/donate\e[0m +" + fi + motd+="\e[1mCommunity:\e[0m \e[4mhttps://termux.dev/community\e[0m \e[1mTermux version:\e[0m ${TERMUX_VERSION-Unknown} " @@ -58,4 +62,13 @@ motd+=" ${motd_indent}Report issues at \e[4mhttps://termux.dev/issues\e[0m " +if [ "$(date +%m)" = "12" ]; then + + motd+=" +\e[1m\e[31mTermux needs your help! Donations help fund development and infrastructure import for Termux's continued existence\e[0m +\e[1mConsider donating at \e[34mhttps://termux.dev/en/donate\e[0m +" + +fi + echo -e "$motd"