preload-hacks: Some patches to make it work.
[termux-packages] / packages / termux-tools / termux-info
CommitLineData
389d8cdb
OS
1#!/data/data/com.termux/files/usr/bin/sh
2
3
4if [ "$#" != "0" ]; then
52ec48e0
FF
5 echo 'usage: termux-info'
6 echo 'Provides information about Termux, and the current system. Helpful for debugging.'
7 exit
389d8cdb
OS
8fi
9
389d8cdb
OS
10updates() {
11 apt update >/dev/null 2>&1
12 updatable=$(apt list --upgradable 2>/dev/null | tail -n +2)
13 if [ -z "$updatable" ];then
14 echo "All packages up to date"
15 else
16 echo "$updatable"
17 fi
18}
52ec48e0
FF
19
20output="Updatable packages:
389d8cdb
OS
21$(updates)
22System information:
23$(uname -a)
24Termux-packages arch:
25$(dpkg --print-architecture)
26Android version:
27$(getprop ro.build.version.release)
28Device manufacturer:
29$(getprop ro.product.manufacturer)
30Device model:
31$(getprop ro.product.model)"
32echo "$output"
33# Copy to clipboard (requires termux-api)
34# use timeout in case termux-api is installed but the termux:api app is missing
35echo "$output" | busybox timeout -t 3 termux-clipboard-set 2>/dev/null
36busybox timeout -t 3 termux-toast "Information has been copied to the clipboard" 2>/dev/null
37exit 0