mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-22 02:22:53 +00:00
17 lines
363 B
Text
17 lines
363 B
Text
|
#!/bin/bash
|
||
|
|
||
|
# Prints out the total disk memory and the availeable memory
|
||
|
|
||
|
PREFIX=' '
|
||
|
|
||
|
get_disk()
|
||
|
{
|
||
|
TOTAL_SIZE=$( df -h --total / | tail -1 | awk {'printf $2'})
|
||
|
USED_SIZE=$(df -h --total / | tail -1 | awk {'printf $3'})
|
||
|
PERCENTAGE=$(df -h --total / | tail -1 | awk {'printf $5'})
|
||
|
|
||
|
echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
|
||
|
}
|
||
|
|
||
|
get_disk
|