1
0
Fork 0

feat: migrate to i3blocks and autotiling-rs

This commit is contained in:
Oliver Ladner 2026-03-01 14:11:51 +01:00
commit 487870a473
14 changed files with 512 additions and 7 deletions

View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# Needs a .env.homeassistant with an API token in ~/.config/sway/.env.homeassistant
# TODO:
# - HA optimize API calls: https://community.home-assistant.io/t/get-limited-number-of-states-entities-when-using-api-states/830323
homeassistant_url="http://10.7.1.11:8123/api/states"
. ~/.config/sway/.env.homeassistant
. ~/bin/i3blocks/_utils
ha() {
local power=$(curl -s -H "Authorization: Bearer $ha_token" -H "Content-Type: application/json" $homeassistant_url/sensor.inspelning_oli_power | jq -r '.state')
local stat="PWR ${power}W"
echo "$stat"
}
ha