From c7ee3cac4974d7f0648f95ef426f35be70c2e770 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sun, 1 May 2022 04:17:30 +0530 Subject: removing redundant scripts --- .scripts/price | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100755 .scripts/price (limited to '.scripts/price') diff --git a/.scripts/price b/.scripts/price deleted file mode 100755 index 42c84c1..0000000 --- a/.scripts/price +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# Usage: -# price -# price bat "Basic Attention Token" 🦁 -# When the name of the currency is multi-word, put it in quotes. - -[ -z "$3" ] && exit 1 - -# use $4 as currency, if not passed in use "usd" as default -currency="${4:-usd}" -interval="@14d" # History contained in chart preceded by '@' (7d = 7 days) -dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" -pricefile="$dir/$1-$currency" -chartfile="$dir/$1-$currency-chart" - -updateprice() { temp="$(mktemp)" - curl -s "$currency.rate.sx/1$1" > "$temp" && - mv -f "$temp" "$pricefile" && - curl -s "$currency.rate.sx/$1$interval" > "$temp" && - mv -f "$temp" "$chartfile" ;} - -[ -d "$dir" ] || mkdir -p "$dir" - -[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && - updateprice "$1" - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;; - 2) notify-send -u low "$3 Updating..." "Updating $2 price..." - updateprice "$1" && notify-send "$3 Update complete." "$2 price is now -\$$(cat "$pricefile")" ;; - 3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")" - notify-send "$3 $2 module" "\- Exact price: \$$(cat "$pricefile") -- Left click for chart of changes. -- Middle click to update. -- Shows 🔃 if updating prices. -- Last updated: - $uptime" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -case "$currency" in - usd) symb="$" ;; - gbp) symb="£" ;; - eur) symb="€" ;; - btc) symb="₿" ;; -esac - -printf "$3$symb%0.2f$after" "$(cat "$pricefile")" -- cgit v1.2.3