mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
39 lines
596 B
Bash
39 lines
596 B
Bash
#!/usr/bin/env bash
|
|
|
|
print_status() {
|
|
time=$(date +"%H:%M")
|
|
date=$(date +"%d/%m")
|
|
|
|
# tooltip complet
|
|
full_date=$(date +"%A %d %B %Y %H:%M:%S")
|
|
calendar=$(cal -m)
|
|
esc_calendar=$(sed 's/&/&/g; s/</</g; s/>/>/g' <<< "$calendar")
|
|
|
|
text="$time
|
|
$date"
|
|
|
|
tooltip="$full_date
|
|
|
|
$esc_calendar"
|
|
|
|
jq -nc \
|
|
--arg text "$text" \
|
|
--arg tooltip "$tooltip" \
|
|
'{ text: $text, tooltip: $tooltip }'
|
|
}
|
|
|
|
print_status
|
|
|
|
last=""
|
|
|
|
while true; do
|
|
current=$(date +"%H%M%S%Y%m%d")
|
|
|
|
if [[ "$current" != "$last" ]]; then
|
|
print_status
|
|
last="$current"
|
|
fi
|
|
|
|
sleep 1
|
|
done
|