From caebbbbb1a33cb231a4b7799e7181436483862ec Mon Sep 17 00:00:00 2001 From: Maciej Sobkowski Date: Mon, 19 May 2025 20:49:55 +0200 Subject: i3status-rust: add air pollution scraper --- .config/i3status-rust/grandmaster4000.toml | 5 +++++ .config/i3status-rust/speedwagon.toml | 5 +++++ .local/bin/air_quality_poznan.sh | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100755 .local/bin/air_quality_poznan.sh diff --git a/.config/i3status-rust/grandmaster4000.toml b/.config/i3status-rust/grandmaster4000.toml index a45f7ab..c583e64 100644 --- a/.config/i3status-rust/grandmaster4000.toml +++ b/.config/i3status-rust/grandmaster4000.toml @@ -18,6 +18,11 @@ info_bg = "#7aa2f7" [icons] icons = "awesome4" +[[block]] +block = "custom" +command = "echo  $(~/.local/bin/air_quality_poznan.sh)" +interval = 600 + [[block]] block = "weather" format = "$icon $weather $temp" diff --git a/.config/i3status-rust/speedwagon.toml b/.config/i3status-rust/speedwagon.toml index 1a244ef..24fc96d 100644 --- a/.config/i3status-rust/speedwagon.toml +++ b/.config/i3status-rust/speedwagon.toml @@ -18,6 +18,11 @@ info_bg = "#7aa2f7" [icons] icons = "awesome4" +[[block]] +block = "custom" +command = "echo  $(~/.local/bin/air_quality_poznan.sh)" +interval = 600 + [[block]] block = "weather" format = "$icon $weather $temp" diff --git a/.local/bin/air_quality_poznan.sh b/.local/bin/air_quality_poznan.sh new file mode 100755 index 0000000..7bba79d --- /dev/null +++ b/.local/bin/air_quality_poznan.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +ADP_URL="https://www.poznan.pl/mim/wos/atmosfera.html" +PM10_CSS_CLASS=".pm_text" + +curl -sSL "${ADP_URL}" | hq "${PM10_CSS_CLASS}" text | cut -d ':' -f 2 -- cgit v1.2.3-70-g09d2