refactor: cleanup scripts

This commit is contained in:
Abhishek Keshri 2024-03-17 04:00:27 +05:30 committed by Abhishek Keshri
parent 15b06d5196
commit d2e517d76a
9 changed files with 60 additions and 160 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@ -11,14 +11,8 @@ get_platform() {
gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}')
echo "$gpu"
;;
Darwin)
# TODO - Darwin/Mac compatability
;;
CYGWIN* | MINGW32* | MSYS* | MINGW*)
# TODO - windows compatability
;;
Darwin) ;; # TODO - Darwin/Mac compatibility
CYGWIN* | MINGW32* | MSYS* | MINGW*) ;; # TODO - windows compatibility
esac
}
@ -29,11 +23,10 @@ get_gpu() {
else
usage='unknown'
fi
normalize_percent_len $usage
normalize_padding "$usage"
}
main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@tmux2k-refresh-rate" 5)
gpu_label=$(get_tmux_option "@tmux2k-gpu-usage-label" "GPU")
gpu_usage=$(get_gpu)
@ -41,5 +34,4 @@ main() {
sleep "$RATE"
}
# run the main driver
main