From e97d5df4d2a2093101bb1ed960d235d84002287d Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 8 Jun 2021 14:39:33 +0200 Subject: [PATCH] module polybar nightscout --- polybar/config | 8 +++++++- polybar/nightscout_cgm.sh | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 polybar/nightscout_cgm.sh diff --git a/polybar/config b/polybar/config index 3ed75d7..549aa71 100644 --- a/polybar/config +++ b/polybar/config @@ -40,7 +40,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 modules-left = i3 modules-center = -modules-right = backlight alsa memory cpu wlan eth_intern eth_dock battery temp_cpu temp_gpu temp_nvme date powermenu +modules-right = nightscout_script backlight alsa memory cpu wlan eth_intern eth_dock battery temp_cpu temp_gpu temp_nvme date powermenu tray-position = right tray-padding = 2 tray-background = #888888 @@ -51,6 +51,12 @@ tray-background = #888888 cursor-click = pointer cursor-scroll = ns-resize +[module/nightscout_script] +type = custom/script +exec = /home/mg/dotfiles/polybar/nightscout_cgm.sh +interval = 120 +format-prefix = "BG" + [module/xwindow] type = internal/xwindow label = %title:0:30:...% diff --git a/polybar/nightscout_cgm.sh b/polybar/nightscout_cgm.sh new file mode 100644 index 0000000..30b0d3a --- /dev/null +++ b/polybar/nightscout_cgm.sh @@ -0,0 +1,2 @@ +#!/bin/bash +curl -s -X GET "https://nightscout.mgrote.net/api/v1/entries/sgv?count=1&token=polybar-2f9359a0c396444a" | awk '{print $3 * 0.055}'