Update system info script
This commit is contained in:
parent
72a59e91ce
commit
8e5ad6f070
1 changed files with 13 additions and 6 deletions
|
@ -1,5 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
display() {
|
||||
tput setaf 3
|
||||
echo -n $1
|
||||
echo -n " "
|
||||
tput setaf 5
|
||||
echo $2
|
||||
}
|
||||
|
||||
field() {
|
||||
num=$1
|
||||
shift
|
||||
|
@ -16,22 +24,21 @@ show_colors() {
|
|||
echo
|
||||
}
|
||||
|
||||
tput setaf 5
|
||||
echo " $HOSTNAME"
|
||||
echo " $(uname -sr)"
|
||||
echo " $(yay -Qq | wc -l)"
|
||||
display " " "$HOSTNAME"
|
||||
display " " "$(uname -sr)"
|
||||
display " " "$(yay -Qq | wc -l)"
|
||||
|
||||
diskinfo=$(df -h / | tail -n 1)
|
||||
useddisk=$(field 3 $diskinfo)
|
||||
totaldisk=$(field 2 $diskinfo)
|
||||
|
||||
echo " ${useddisk::-1}/${totaldisk::-1} GB ($(field 5 $diskinfo))"
|
||||
display " " "${useddisk::-1}/${totaldisk::-1} GB ($(field 5 $diskinfo))"
|
||||
|
||||
raminfo=$(free --mega | head -n 2 | tail -n 1)
|
||||
usedram=$(field 3 $raminfo)
|
||||
totalram=$(field 2 $raminfo)
|
||||
|
||||
echo " $usedram/$totalram MB ($(($usedram*100/$totalram))%)"
|
||||
display " " "$usedram/$totalram MB ($(($usedram*100/$totalram))%)"
|
||||
|
||||
tput setaf reset
|
||||
|
||||
|
|
Loading…
Reference in a new issue