aboutsummaryrefslogtreecommitdiff
path: root/home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu
diff options
context:
space:
mode:
authorNatasha Moongrave <natasha@256phi.eu>2026-04-10 19:20:58 +0200
committerNatasha Moongrave <natasha@256phi.eu>2026-04-10 19:20:58 +0200
commitadcc6ca839c4780a8adb82de712ec3c9e4da33f3 (patch)
treecafb7b744316ad79aef2bb2c899f920c4ae2cc83 /home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu
parenta414126dbda913dcc33d5f9546a9f99859d1557f (diff)
parent84d39cf904e7008434c1e5ed8257cf09b1875bea (diff)
Merge branch 'schrott-extract-rice'
Diffstat (limited to 'home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu')
-rwxr-xr-xhome/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu38
1 files changed, 38 insertions, 0 deletions
diff --git a/home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu b/home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu
new file mode 100755
index 0000000..5225dc2
--- /dev/null
+++ b/home/rices/schrottkatze/eww/configDir/scripts/iceTacho.nu
@@ -0,0 +1,38 @@
+#!/usr/bin/env nu
+
+const TABLE = {
+ 401: 280
+ 402: 280
+ 403: 330
+ 406: 330
+ 407: 320
+ 408: 320
+ 411: 230
+ 415: 230
+ 412: 265
+ 605: 200
+};
+
+def main [ ] {
+ loop {
+ if ((iw dev wlp4s0 link | lines | filter {|it| $it =~ "WIFIonICE" } | length) == 1) {
+ let iceData = http get https://iceportal.de/api1/rs/status;
+ let tzn = $iceData.tzn;
+ let br = $iceData.series;
+ let speed = $iceData.speed;
+ let speedfrac = $speed / ($TABLE | get $br);
+
+ print ({
+ tzn: $tzn,
+ br: $br,
+ speed: $speed,
+ frac: $speedfrac
+ } | to json -r);
+
+ sleep 2sec;
+ } else {
+ print "null";
+ sleep 5sec;
+ }
+ }
+}