plugfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 30eee343eb4175f40760d897e9b9896501c463ee
parent 2df357f96cbf797c50239a3125f3afd08f152587
Author: NicholasFarrow <nicholas.w.farrow@gmail.com>
Date:   Fri, 17 May 2019 03:21:53 +1000

Custom i3status bar with bash wrapper; crypto price feed

Diffstat:
M.config/i3/config | 5+++--
A.config/i3/statusbar.sh | 21+++++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/.config/i3/config b/.config/i3/config @@ -6,7 +6,7 @@ # WINDOWS KEY MODIFIER set $mod Mod4 -set $mod2 Mod1 +#set $mod Mod1 # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. @@ -49,7 +49,8 @@ bar { position top height 10 #i3bar_command i3bar -t - status_command i3status + #status_command i3status + status_command ~/.config/i3/statusbar.sh } diff --git a/.config/i3/statusbar.sh b/.config/i3/statusbar.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Nicholas Farrow 2019 + +crypto_rate () { + if [ "$1" == "BTC" ]; then ln=2; else ln=1; fi + echo "$(curl -s rate.sx | grep $1 | sed -n ${ln}p | grep -Eo "[0-9]*\.[0-9]*" | head -1)" +} + +i3status | while : +do + read line + #echo $line + BTC=$(crypto_rate "BTC") + ETH=$(crypto_rate "ETH") + RATIO=$(bc <<< "scale=6;$ETH/$BTC") + + #echo "BTC:$BTC ETH:$ETH ETH/BTC:$RATIO $line" || exit 1 + + #RED='\033[0:31m' + echo -e "${RED}BTC:$BTC ETH:$ETH ETH/BTC:$RATIO $line" || exit 1 +done