Add home/bin folder

This commit is contained in:
Ian Keane 2022-06-07 15:44:19 -04:00
parent 9a6bfc1daf
commit 994f3b8320
4 changed files with 81 additions and 0 deletions

1
slackware/bin/jbrowse Executable file
View file

@ -0,0 +1 @@
/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser "https://everblue.atlassian.net/browse/"$1 &

1
slackware/bin/notifyme Executable file
View file

@ -0,0 +1 @@
osascript -e 'display notification "done!" with title "Notification"'

View file

@ -0,0 +1,3 @@
#!/bin/bash
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -r -n 1 git branch -D

76
slackware/bin/sugar Executable file
View file

@ -0,0 +1,76 @@
#!/usr/local/bin/python3
import sys
import requests
import json
from termcolor import colored
# sample request:
# [
# {
# "_id": "629672ecb982f4a1be3a7dd6",
# "device": "xDrip-DexcomG5",
# "date": 1654026986232,
# "dateString": "2022-05-31T19:56:26.232Z",
# "sgv": 185,
# "delta": 0.996,
# "direction": "Flat",
# "type": "sgv",
# "filtered": 0,
# "unfiltered": 0,
# "rssi": 100,
# "noise": 1,
# "sysTime": "2022-05-31T19:56:26.232Z",
# "utcOffset": -240,
# "mills": 1654026986232
# }
# ]
tmux = '--tmux' in sys.argv
down = '\u2193' # ↓
falling = '\u2798' # ➘
flat = '\u2192' # →
rising = '\u279a' # ➚
up = '\u2191' # ↑
url = 'http://blood.dump.town'
options = '/api/v1/entries.json?count=1&token=phone-7631d7eebc79825b'
res = requests.get(url + options)
sugar = res.json()[0]
delta = sugar['delta']
sgv = sugar['sgv']
direction = sugar['direction']
if delta < -10:
arrow = down
if delta >= -10 and delta < -1:
arrow = falling
if delta >= -1 and delta <= 1:
arrow = flat
if delta > 1 and delta <= 10:
arrow = rising
if delta > 10:
arrow = up
if (sgv >= 225 or sgv <= 80):
color = 'red'
elif ((sgv >= 180 and sgv <= 225)
or (sgv <= 100 and sgv >= 80)):
color = 'yellow'
else:
color = 'green'
if not tmux:
print(colored(str(sugar['sgv']) +
' ' + arrow + ' ' +
'(' + str(delta) + ')',
color))
else:
print(f'#[bg={color}] ' +
str(round(sugar['sgv'], 1)) + ' ' +
arrow + ' ' +
'(' + str(delta) + ')'
)