Add previous PR

This commit is contained in:
Dylan Araps 2016-08-28 09:03:40 +10:00
parent 71f0575b2b
commit 12ba2f925a
1 changed files with 10 additions and 3 deletions

View File

@ -237,6 +237,10 @@ getuptime() {
uptime="$(uptime | awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')" uptime="$(uptime | awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')"
;; ;;
"Android"*)
uptime=$(uptime | awk -F ': |, ' '{printf $2}')
;;
*) *)
uptime="$(uptime -p)" uptime="$(uptime -p)"
[ "$uptime" == "up " ] && uptime="up $(awk -F'.' '{print $1}' /proc/uptime) seconds" [ "$uptime" == "up " ] && uptime="up $(awk -F'.' '{print $1}' /proc/uptime) seconds"
@ -407,6 +411,8 @@ getpackages() {
packages="$(pkg list | wc -l)" packages="$(pkg list | wc -l)"
;; ;;
esac esac
[ "$packages" == 0 ] && unset packages
} }
# }}} # }}}
@ -1554,6 +1560,7 @@ getdisk() {
case "$distro" in case "$distro" in
"OpenWRT"*) df_flags="-h"; df_dir="rootfs" ;; "OpenWRT"*) df_flags="-h"; df_dir="rootfs" ;;
"Android"*) return ;;
esac esac
;; ;;
@ -1619,8 +1626,8 @@ getbattery() {
*) index="$battery_num" ;; *) index="$battery_num" ;;
esac esac
batteries=($(cat "/sys/class/power_supply/BAT$battery_num/capacity")) batteries=($(cat /sys/class/power_supply/battery/capacity /sys/class/power_supply/BAT${battery_num}/capacity))
battery_state=($(cat "/sys/class/power_supply/BAT${battery_num}/status")) battery_state=($(cat /sys/class/power_supply/battery/status /sys/class/power_supply/BAT${battery_num}/status))
# Get the subtitle and reassign it so it doesn't change. # Get the subtitle and reassign it so it doesn't change.
title="$subtitle" title="$subtitle"
@ -2411,7 +2418,7 @@ colors() {
ascii_distro="mint" ascii_distro="mint"
;; ;;
"LMDE"* | "Chapeau"*) "LMDE"* | "Chapeau"* | "Android"*)
setcolors 2 7 setcolors 2 7
;; ;;