From 74170330cd8695a27b6a05f1b444cee27c1b4f86 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:44:39 +0300 Subject: [PATCH] Add weather report to the status bar --- .config/setup/03-install-cron-jobs.sh | 3 +++ .config/setup/crontab | 1 + .local/bin/print-status | 4 +++- .local/bin/update-weather | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 .config/setup/03-install-cron-jobs.sh create mode 100644 .config/setup/crontab create mode 100755 .local/bin/update-weather diff --git a/.config/setup/03-install-cron-jobs.sh b/.config/setup/03-install-cron-jobs.sh new file mode 100755 index 0000000..0635fde --- /dev/null +++ b/.config/setup/03-install-cron-jobs.sh @@ -0,0 +1,3 @@ +#! /usr/bin/sh + +crontab ./crontab diff --git a/.config/setup/crontab b/.config/setup/crontab new file mode 100644 index 0000000..1d20f29 --- /dev/null +++ b/.config/setup/crontab @@ -0,0 +1 @@ +@hourly /home/ohad/.local/bin/update-weather diff --git a/.local/bin/print-status b/.local/bin/print-status index 72c332c..3863501 100755 --- a/.local/bin/print-status +++ b/.local/bin/print-status @@ -27,4 +27,6 @@ elif [ "${battery_state}" = "Discharging" ]; then battery_symbol="🔋" fi -echo 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}% +weather=$(cat /tmp/weather-report.txt) + +echo ${weather} 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}% diff --git a/.local/bin/update-weather b/.local/bin/update-weather new file mode 100755 index 0000000..4e76820 --- /dev/null +++ b/.local/bin/update-weather @@ -0,0 +1,4 @@ +#! /usr/bin/sh + +# Documentation available in https://github.com/chubin/wttr.in +curl -Ss 'https://wttr.in/?0&m&q&T&format=3' > /tmp/weather-report.txt