From 505f63a32da667d2f8a363ff63c776cfd69f0b90 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Mon, 26 Apr 2021 12:43:16 -0400 Subject: [PATCH] Shorten ticker values in i3block --- aliases/key_aliases.tmpl | 6 +++++- dot_config/i3blocks/i3blocks.conf.tmpl | 16 ++++++++++++++++ dot_taskrc | 4 ++-- scripts/executable_ticker | 14 ++++++++------ 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/aliases/key_aliases.tmpl b/aliases/key_aliases.tmpl index d4711a3..3dfff57 100644 --- a/aliases/key_aliases.tmpl +++ b/aliases/key_aliases.tmpl @@ -58,6 +58,7 @@ grep "grep --color=auto -n" grpr "grep -r" rgc "rg -S" rge "rg -t" +xa "xargs" # pk "pkill -f" cld "colordiff -wy --suppress-common-lines" @@ -604,6 +605,7 @@ gl1 "git log --oneline" gl1x "git log --oneline -1 | xclip -selection clipboard" gla "git log" glm "git log master" +glr "git log --reverse" gqs "git-quick-stats -T" # gsl "git shortlog" gsh "git show" @@ -632,7 +634,8 @@ gchh "git checkout HEAD --" # grsh "git reset --hard HEAD" # grsh1 "git reset --hard HEAD~1" grs "git reset --soft" -grsh1 "git reset --soft HEAD~1" +grs1 "git reset --soft HEAD~1" +grs1c "git reset --soft HEAD~1 && git commit --amend --no-edit -S" grso "git reset --soft orig/master" grsh "git reset --hard" grsho "git reset --hard origin/master" @@ -865,6 +868,7 @@ lob "lsd -F --group-dirs first 2020*.mkv" wo "watch -n60 'lsd -lF --group-dirs first --size short 2020*.mkv'" fnp "t timeline FNProgress | sed -n '2p'" +fnu "sxiv ~/Documents/fortnite/pics/maps/upgrade.png &" # ]]] games # diff --git a/dot_config/i3blocks/i3blocks.conf.tmpl b/dot_config/i3blocks/i3blocks.conf.tmpl index 0d78d6f..b38121a 100755 --- a/dot_config/i3blocks/i3blocks.conf.tmpl +++ b/dot_config/i3blocks/i3blocks.conf.tmpl @@ -20,11 +20,27 @@ color=#cbe4ff # TICKER=PEJ # interval=30 +[ticker] +# label=DOGE  +label=🐶  +TICKER=DOGE-USD +interval=30 + [ticker] label=ADA  TICKER=ADA-USD interval=30 +[ticker] +label=ETH  +TICKER=ETH-USD +interval=30 + +[ticker] +label=BTC  +TICKER=BTC-USD +interval=30 + [ticker] label=DAQ  TICKER=^IXIC diff --git a/dot_taskrc b/dot_taskrc index 308309e..bc9578f 100644 --- a/dot_taskrc +++ b/dot_taskrc @@ -80,8 +80,8 @@ context.sch=project:sch # context=home # context=out -# context=pey -context=not-pey +context=pey +# context=not-pey # context=sch # }}} context # diff --git a/scripts/executable_ticker b/scripts/executable_ticker index 2fbca42..de01d10 100755 --- a/scripts/executable_ticker +++ b/scripts/executable_ticker @@ -85,13 +85,15 @@ for symbol in $(IFS=' '; echo "${SYMBOLS[*]}" | tr '[:lower:]' '[:upper:]'); do # echo $price hour=$(date +"%H") if [[ "$symbol" == "USDCAD=X" ]]; then - printf "%0.4f\n" $price - elif [[ "$symbol" == "ADA"* ]]; then - printf "%0.3f\n" $price - elif (( $(echo "$price > 10000" | bc -l) )); then - printf "%'0.0f\n" "$price" + printf "%0.4f\n" "$price" + elif [[ "$symbol" == "BTC-USD" || "$symbol" == "ETH-USD" ]]; then + echo "$price" | cut -c 1-3 + elif (( $(echo "$price > 1000" | bc -l) )); then + printf "%'0.0f\n" "$price" | cut -c 2-5 + # elif (( $(echo "$price < 1" | bc -l) )); then + # printf "%0.3f\n" "$price" else - printf "%0.2f\n" $price + printf "%0.2f\n" "$price" | cut -c 3- fi fi done