-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsdlSpeedometer-stat
More file actions
executable file
·72 lines (64 loc) · 2.24 KB
/
sdlSpeedometer-stat
File metadata and controls
executable file
·72 lines (64 loc) · 2.24 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#export GDK_DPI_SCALE=2.0
export GDK_DPI_SCALE=1.0
(
tmpfile=/tmp/$(basename $0).tmp
if ! systemctl status bluetooth.service | grep "(dead)"; then
bt="$(hciconfig hci0 | grep Type | awk -F: '{print $1 "\n"}')"
fi
ncores="$(grep processor /proc/cpuinfo | wc -l)"
osrel="$(awk -F= '/VERSION=/{ print $1 " " $2}' /etc/os-release)"
usage="$(df -h -x tmpfs /| awk /dev/'{printf "%s=%s Usage=%s", $1, $2, $5}')"
while true; do
if ! pidof -c yad &>/dev/null; then
break
fi
awk NF "$tmpfile" 2>/dev/null
top -n 2 -b | egrep -v 'top|yad' | grep -A 4 PID | awk '{print $NF "\n" $9 "\t\t" $10}' | awk '/--/{x=NR+20;next}(NR<=x){print}' > "$tmpfile" &
echo -e "-----\n-----"
echo -e "Network I.F\nI.P Address:"
echo "$(ip -o addr show scope global | grep -E -v 'secondary|inet6' | awk '{split($4, a, "/"); printf $2 "\n"a[1] "\t# Connected="}; system("arp -n | grep "$2" | grep ether | wc -l")')"
if [ -n "${bt}" ]; then
echo -e "-----\n-----"
echo -e "Bluetooth\nConnection"
echo "${bt}";
echo "$(bluetoothctl devices | cut -f2 -d' ' | while read uuid; do bluetoothctl info $uuid; done| awk -F: '/Connected|Name/ {print $1 " " $2}' | grep -B 1 yes | awk NF=NF RS= OFS=' ')"
fi
echo -e "-----\n-----"
echo "CPU temp"
echo -n "$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))°C on"
echo "$(grep "Model" /proc/cpuinfo | awk '{print " "$3" "$4" "$5}') with ${ncores} cores"
echo "$(uptime -p | awk '{printf "Uptime\n" $0 }')"
echo -e "OS\n${osrel}"
echo -e "Disk usage\n ${usage}"
sleep 3.4
echo -e '\f'
done
) | yad --title="System Status" \
--borders=8 \
--image="emblem-system" \
--list \
--fullscreen \
--column="PRPOERTY":text \
--column="VALUE":text \
--button="REBOOT":1 \
--button="HALT":2 \
--button="QUIT":0
case $? in
1)
sudo reboot
;;
2)
sudo halt
;;
*)
exit 0
;;
esac
if [ $? -eq 1 ]; then
sudo reboot
fi
if [ $? -eq 2 ]; then
halt
fi
exit 0