Merge kubuntu and ubuntu-i3 configs

This commit is contained in:
2021-12-20 16:49:21 -05:00
parent 4d7aa521dc
commit 574cc7802a
214 changed files with 12317 additions and 517 deletions

View File

@@ -0,0 +1,41 @@
################################
# Calculates a given expression
#
# Dependencies:
# - bc
#
# @param {String} 1: The expression to calculate
# @return {Number}: The result of the expression
################################
calc() {
echo "$1" | bc
}
################################
# Counts lines in text, accounting for empty values
#
# @param {String} 1: The input text
# @return {Number}: The number of lines
################################
numLines() {
if [[ "$1" == "" ]]; then
echo 0
else
echo "$1" | wc -l
fi
}
cacheDir=".cache"
cacheFile="$cacheDir/i3-blocks-contrib-${BLOCK_NAME}"
if [[ -z $cacheDir ]]; then
mkdir $cacheDir
fi
getCache() {
cat $cacheFile || echo $1
}
setCache() {
echo "$1" > $cacheFile
}