From 0292495bc60b725a9e790ff2fbef2d0cdb0c8671 Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Mon, 28 Oct 2024 06:44:29 +0100 Subject: Add new i3 placeholders; cleanup --- .local/bin/any_position_wrapper.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to '.local/bin/any_position_wrapper.sh') diff --git a/.local/bin/any_position_wrapper.sh b/.local/bin/any_position_wrapper.sh index f821657..242381c 100755 --- a/.local/bin/any_position_wrapper.sh +++ b/.local/bin/any_position_wrapper.sh @@ -47,11 +47,24 @@ function irdate { json_array=$(update_holder holder__jdate "$json") } +function vpn { + local json="{ \"full_text\": \"mullvad: $(mullvad status | head -n1)\", \"color\": \"#FF78D1\" }" + json_array=$(update_holder holder__vpn "$json") +} + +function temp { + local cpu_temp=$(sensors | grep 'CPU Temperature' | awk '{print $3}') + local json="{ \"full_text\": \"$cpu_temp\", \"color\": \"#FF7800\" }" + json_array=$(update_holder holder__temp "$json") +} + i3status > >(read line; echo "$line"; read line ; echo "$line" ; read line ; echo "$line" ; while true do read line json_array="$(echo $line | sed -e 's/^,//')" irdate + vpn + temp echo ",$json_array" done) & PID=$! trap "kill -TERM $PID" 0 1 2 15 -- cgit v1.2.3