This commit is contained in:
Christian Nieves
2022-10-20 12:01:05 -05:00
parent b178f8c58f
commit 10714e9258
56 changed files with 811 additions and 266 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=scripts/helpers.sh
source "$CURRENT_DIR/helpers.sh"
# script global variables
@ -21,13 +22,15 @@ get_icon_settings() {
}
print_icon() {
local ram_percentage=$($CURRENT_DIR/ram_percentage.sh | sed -e 's/%//')
local ram_load_status=$(load_status $ram_percentage)
if [ $ram_load_status == "low" ]; then
local ram_percentage
local ram_load_status
ram_percentage=$("$CURRENT_DIR"/ram_percentage.sh | sed -e 's/%//')
ram_load_status=$(load_status "$ram_percentage" "ram")
if [ "$ram_load_status" == "low" ]; then
echo "$ram_low_icon"
elif [ $ram_load_status == "medium" ]; then
elif [ "$ram_load_status" == "medium" ]; then
echo "$ram_medium_icon"
elif [ $ram_load_status == "high" ]; then
elif [ "$ram_load_status" == "high" ]; then
echo "$ram_high_icon"
fi
}
@ -36,4 +39,4 @@ main() {
get_icon_settings
print_icon "$1"
}
main
main "$@"