Added temp and date to taskbar
This commit is contained in:
parent
818089e853
commit
8433a923ba
1 changed files with 22 additions and 2 deletions
|
@ -5,7 +5,7 @@ NOW=$(date +%s)
|
|||
debounce () {
|
||||
local -n VAR_REFERENCE=$1 # Funky Bash Pass-by-reference here!
|
||||
VAR_NAME="$1"
|
||||
DEBOUNCE_TIME="$2"
|
||||
DEBOUNCE_TIME="$2" # In Seconds
|
||||
FUNCTION=$3
|
||||
FALLBACK=$4
|
||||
|
||||
|
@ -56,6 +56,18 @@ get_monero_text () {
|
|||
cat /tmp/last-monero-value
|
||||
}
|
||||
|
||||
get_date () {
|
||||
date +%a" "%d" "%b" "%I:%M" "%P > /tmp/last-date
|
||||
cat /tmp/last-date
|
||||
}
|
||||
|
||||
get_temps () {
|
||||
TEMP=$(sensors | grep Tctl | cut -d"+" -f 2 | cut -d"." -f 1)
|
||||
|
||||
echo "$TEMP°C" > /tmp/last-temp
|
||||
cat /tmp/last-temp
|
||||
}
|
||||
|
||||
debounce MOUSE_STRING 3600 \
|
||||
"$(get_mouse_text)" \
|
||||
"$(cat /tmp/last-mouse-level || get_mouse_text)";
|
||||
|
@ -64,4 +76,12 @@ debounce MONERO_STRING 60 \
|
|||
"$(get_monero_text)" \
|
||||
"$(cat /tmp/last-monero-value || get_monero_text)";
|
||||
|
||||
echo "| $MOUSE_STRING | $MONERO_STRING |"
|
||||
debounce DATE_STRING 5 \
|
||||
"$(get_date)" \
|
||||
"$(cat /tmp/last-date || get_date)";
|
||||
|
||||
debounce TEMP_STRING 5 \
|
||||
"$(get_temps)" \
|
||||
"$(cat /tmp/last-temp || get_temps)"
|
||||
|
||||
echo " $TEMP_STRING | $MOUSE_STRING | $MONERO_STRING | $DATE_STRING"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue