-
Notifications
You must be signed in to change notification settings - Fork 3
/
termux-information
executable file
·39 lines (33 loc) · 1.08 KB
/
termux-information
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
separator=" // "
battery_capacity=$(cat /sys/class/power_supply/battery/uevent | grep -i 'capacity=' | cut -d '=' -f 2)
battery_health=$(cat /sys/class/power_supply/battery/uevent | grep -i 'health=' | cut -d '=' -f 2)
battery_status=$(cat /sys/class/power_supply/battery/uevent | grep -i 'status=' | cut -d '=' -f 2)
battery_temperature=$(cat /sys/class/power_supply/battery/uevent | grep -i 'temp=' | cut -d '=' -f 2)
date=$(date +"%F")
time=$(date +"%r")
[ "$HOSTNAME" = "localhost" ] && HOSTANME="Android"
[ -z "${USER}" ] && USER="termux"
unset PS1
PS1='\['
PS1+="$(tput sc)"
PS1+="$(tput ed)"
PS1+="$(tput cup 0 0)"
PS1+="$(tput setaf 0)"
PS1+="$(tput setab 7)"
PS1+="$(tput el)"
PS1+=" HOSTNAME: ${HOSTNAME}"
PS1+="${separator}"
PS1+=" USER: ${USER}"
PS1+="${separator}"
PS1+=" DATE: ${date}"
PS1+="${separator}"
PS1+=" BATT. % ${battery_capacity} [ ${battery_status} ]"
PS1+="${separator}"
PS1+=" NET: $(getprop wifi.interface)"
PS1+="${separator}"
PS1+="TERMUX: ${TERMUX_VERSION}"
PS1+="$(tput sgr 0)"
PS1+="$(tput rc)"
PS1+='\]'
PS1+="[ ${USER} ] >_ $ "