diff --git a/packages/termux-tools/build.sh b/packages/termux-tools/build.sh index 39ccb6e15..e38f80d13 100644 --- a/packages/termux-tools/build.sh +++ b/packages/termux-tools/build.sh @@ -1,6 +1,6 @@ TERMUX_PKG_HOMEPAGE=https://termux.com/ TERMUX_PKG_DESCRIPTION="Basic system tools for Termux" -TERMUX_PKG_VERSION=0.41 +TERMUX_PKG_VERSION=0.42 TERMUX_PKG_PLATFORM_INDEPENDENT=yes TERMUX_PKG_CONFFILES="etc/motd" @@ -18,7 +18,7 @@ termux_step_make_install () { chmod +x $TERMUX_PREFIX/bin/$tool done - cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock,login,packages,termux-open} $TERMUX_PREFIX/bin/ + cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock,login,packages,termux-open,termux-info} $TERMUX_PREFIX/bin/ perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd diff --git a/packages/termux-tools/termux-info b/packages/termux-tools/termux-info new file mode 100755 index 000000000..eee919f2b --- /dev/null +++ b/packages/termux-tools/termux-info @@ -0,0 +1,53 @@ +#!/data/data/com.termux/files/usr/bin/sh + + +if [ "$#" != "0" ]; then + echo 'usage: termux-info' + echo 'Provides information about Termux, and the current system. Helpful for debugging.' + exit +fi + + + +version() { + if [ -e "$PREFIX/version" ]; then + cat "$PREFIX/version" + else + #Last version that didn't have a way to detect Termux version + echo '<=0.48' + fi +} +apps() { + pm list packages -i | grep com.termux +} +updates() { + apt update >/dev/null 2>&1 + updatable=$(apt list --upgradable 2>/dev/null | tail -n +2) + if [ -z "$updatable" ];then + echo "All packages up to date" + else + echo "$updatable" + fi +} +output="Termux version: +$(version) +Installed Termux apps: +$(apps) +Updatable packages: +$(updates) +System information: +$(uname -a) +Termux-packages arch: +$(dpkg --print-architecture) +Android version: +$(getprop ro.build.version.release) +Device manufacturer: +$(getprop ro.product.manufacturer) +Device model: +$(getprop ro.product.model)" +echo "$output" +# Copy to clipboard (requires termux-api) +# use timeout in case termux-api is installed but the termux:api app is missing +echo "$output" | busybox timeout -t 3 termux-clipboard-set 2>/dev/null +busybox timeout -t 3 termux-toast "Information has been copied to the clipboard" 2>/dev/null +exit 0