mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 07:38:50 +01:00
Restored swap data in system stat
This commit is contained in:
parent
7b092ccfb5
commit
bb71969923
@ -40,7 +40,7 @@ while true; do
|
||||
# Compute stats
|
||||
cpu=$(printf "%.0f\n" $(mpstat -P ALL $UPDATE_PERIOD 1 | tail -1 | awk '{print 100-$12}'))
|
||||
ram_mem=$(printf "%.0f\n" $(free | grep Mem | awk '{print $3/$2 * 100.0}'))
|
||||
#ram_swap=$(printf "%.0f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
|
||||
ram_swap=$(printf "%.0f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
|
||||
battery=$(printf "%.0f\n" $(cat /tmp/current_battery_percentage))
|
||||
ip_addr=$(ifconfig usb0 | grep "inet " | awk -F'[: ]+' '{ print $4 }')
|
||||
|
||||
@ -50,9 +50,9 @@ while true; do
|
||||
notif_dirty=0
|
||||
else
|
||||
if [ "x${ip_addr}" != "x" ]; then
|
||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% BATTERY:${battery}%%^IP:${ip_addr}"
|
||||
notif set 0 "CPU:${cpu} RAM:${ram_mem} SWAP:${ram_swap} BAT:${battery}^IP:${ip_addr}"
|
||||
else
|
||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% BATTERY:${battery}%%"
|
||||
notif set 0 "CPU:${cpu} RAM:${ram_mem} SWAP:${ram_swap} BAT:${battery}"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
@ -40,7 +40,7 @@ while true; do
|
||||
# Compute stats
|
||||
cpu=$(printf "%.0f\n" $(mpstat -P ALL $UPDATE_PERIOD 1 | tail -1 | awk '{print 100-$12}'))
|
||||
ram_mem=$(printf "%.0f\n" $(free | grep Mem | awk '{print $3/$2 * 100.0}'))
|
||||
#ram_swap=$(printf "%.0f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
|
||||
ram_swap=$(printf "%.0f\n" $(free | grep Swap | awk '{print $3/$2 * 100.0}'))
|
||||
battery=$(printf "%.0f\n" $(cat /tmp/current_battery_percentage))
|
||||
ip_addr=$(ifconfig usb0 | grep "inet " | awk -F'[: ]+' '{ print $4 }')
|
||||
|
||||
@ -50,9 +50,9 @@ while true; do
|
||||
notif_dirty=0
|
||||
else
|
||||
if [ "x${ip_addr}" != "x" ]; then
|
||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% BATTERY:${battery}%%^IP:${ip_addr}"
|
||||
notif set 0 "CPU:${cpu} RAM:${ram_mem} SWAP:${ram_swap} BAT:${battery}^IP:${ip_addr}"
|
||||
else
|
||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% BATTERY:${battery}%%"
|
||||
notif set 0 "CPU:${cpu} RAM:${ram_mem} SWAP:${ram_swap} BAT:${battery}"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user