Merge pull request #18 from Baitinq/master

Added ram percentage module
This commit is contained in:
Baitinq 2020-10-20 11:08:47 +01:00 committed by GitHub
commit 71f3fd8a77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

13
modules/ram_perc Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Prints the total ram and used ram in Mb
PREFIX=' '
get_ram()
{
USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}')
echo "$PREFIX$USED_RAM%"
}
get_ram

13
modules/uptime Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Prints the total ram and used ram in Mb
PREFIX=''
get_uptime()
{
UPTIME=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
echo "$PREFIX$UPTIME"
}
get_uptime