Kraken ticker i3block

This commit is contained in:
2023-03-30 08:33:32 -04:00
parent e2a9e753ff
commit 1afe9d05a4
15 changed files with 112 additions and 95 deletions

View File

@@ -118,6 +118,7 @@ sfpx "sftp -rP 8022 $PIXEL_IP"
rspx "rsync --ignore-existing -Ptre 'ssh -p 8022' $PIXEL_IP:" rspx "rsync --ignore-existing -Ptre 'ssh -p 8022' $PIXEL_IP:"
# ]]] pixel # # ]]] pixel #
ssl "mosh --ssh='ssh -p 399' kevin@$LAPTOP_IP"
# vultr # vultr
ssa "mosh atxadmin@45.32.87.10" ssa "mosh atxadmin@45.32.87.10"
@@ -198,8 +199,8 @@ uzl "unzip -l"
# power options [[[ # # power options [[[ #
s "systemctl suspend" s "systemctl suspend"
sl "i3lock-fancy && systemctl suspend" # sl "i3lock-fancy && systemctl suspend"
so "xset dpms force off" # so "xset dpms force off"
xx "exit" xx "exit"
sof "xset dpms force off" sof "xset dpms force off"
son "xset s off -dpms" son "xset s off -dpms"
@@ -304,7 +305,8 @@ spipi "sudo pip install"
# internet [[[ # # internet [[[ #
pg "ping -c 2 -W 1 8.8.8.8" pg2 "ping -c 2 -W 1 8.8.8.8"
pgt "ping -c 50 -W 1 8.8.8.8"
wpg "watch ping -c 2 -W 1 8.8.8.8" wpg "watch ping -c 2 -W 1 8.8.8.8"
pgc "ping 8.8.8.8" pgc "ping 8.8.8.8"
dh "sudo dhcpcd" dh "sudo dhcpcd"
@@ -378,7 +380,7 @@ ay "task sync"
# buku [[[ # # buku [[[ #
# b "buku" # b "buku"
bd "buku -a '" # bd "buku -a '"
bdb "sqlitebrowser ~/.local/share/buku/bookmarks.db &" bdb "sqlitebrowser ~/.local/share/buku/bookmarks.db &"
bh "buku -h | bat" bh "buku -h | bat"
bi "buku --immutable 1 -zu" bi "buku --immutable 1 -zu"
@@ -442,6 +444,7 @@ mra "man ranger"
n "nvim" n "nvim"
nl "nload devices wlp4s0 -u M" nl "nload devices wlp4s0 -u M"
nm "nomacs ." nm "nomacs ."
nmd "nomacs ."
np "nvim --" np "nvim --"
ndu "ncdu" ndu "ncdu"
p3 "python3" p3 "python3"
@@ -465,7 +468,7 @@ sn "sudo nvim"
sqlb "sqlitebrowser" sqlb "sqlitebrowser"
# ss "mosh" # ss "mosh"
stp "termdown" stp "termdown"
h "termdown" # h "termdown"
# sw "swex" # sw "swex"
# t "tmux"#[[[ # t "tmux"#[[[
# ta "tmux a -t" # ta "tmux a -t"
@@ -511,7 +514,7 @@ trx "tar xvzf"
# pass [[[ # # pass [[[ #
# p "pass" # p "pass"
pc "pass -c" # pc "pass -c"
pe "pass edit" pe "pass edit"
pi "pass insert -m" pi "pass insert -m"
pg "pass generate -c" pg "pass generate -c"
@@ -581,8 +584,8 @@ tte "timetrace edit record latest"
# ttc "timetrace create" # ttc "timetrace create"
ttc "timetrace create project" ttc "timetrace create project"
ttp "timetrace create project" ttp "timetrace create project"
ttl "timetrace list records today"
ttlp "timetrace list projects" ttlp "timetrace list projects"
ttlr "timetrace list records today"
ttr "timetrace report" ttr "timetrace report"
tts "timetrace stop" tts "timetrace stop"
ttt "timetrace status" ttt "timetrace status"
@@ -942,7 +945,7 @@ ssr "mosh 161.35.107.30"
# ]]] rarity surf # # ]]] rarity surf #
stb "source ~/.venv/twitter-bot/bin/activate.fish" stb "source ~/.venv/twitter-bot/bin/activate.fish"
pr "python retweet.py" # pr "python retweet.py"
prg "python retweet.py --giveaway" prg "python retweet.py --giveaway"
prm "python retweet.py --mentions | bat" prm "python retweet.py --mentions | bat"
@@ -1008,30 +1011,7 @@ umip "fusermount -u /mnt/ipad"
gpa "column -ts',' ~/Documents/gpa.md" gpa "column -ts',' ~/Documents/gpa.md"
ssc "mosh mokkar@teach.cs.utoronto.ca" ssc "mosh mokkar@teach.cs.utoronto.ca"
# 301 [[[ # zs "zathura --fork syllabus.pdf"
spc "source ~/.venv/price-calc/bin/activate.fish"
scv "source ~/.venv/covid-monitor/bin/activate.fish"
fr "flask run"
pmd "python manage.py db"
pmdm "python manage.py db migrate"
pmdu "python manage.py db upgrade"
# pt "pytest --cov"
# ]]] 301 #
# 458 [[[ #
ssm "ssh -p 2222 mininet@localhost"
rs "rsync *.c *.h -Pave 'ssh -p 2222' mininet@127.0.0.1:~/pa1/router/"
rsw "rsync -PavIe 'ssh -p 2222' mininet@127.0.0.1:~/pa1/router/sr-.pcap ."
trm "tar czf pa1.tar.gz *"
# trm "make compress"
trxm "tar xf pa1.tar.gz"
cpt "cp pa1.tar.gz /home/kevin/school/458/a1/router"
xcd "date | xclip -selection clipboard"
# ]]] 458 #
# ]]] school # # ]]] school #
@@ -1200,7 +1180,9 @@ tet "ticker (xclip -o) | xclip -selection clipboard"
eip "curl ifconfig.me" eip "curl ifconfig.me"
fdb "firefox -P discord-" fdb "firefox -P discord-"
sip "curl ifconfig.me" sip "curl ifconfig.me"
vpc "nordvpn connect && curl ifconfig.me" # vpc "nordvpn connect && curl ifconfig.me"
vpc "nordvpn connect"
vpd "nordvpn disconnect" vpd "nordvpn disconnect"
vpt "nordvpn status"
# ]]] vpn # # ]]] vpn #

View File

@@ -71,7 +71,7 @@ hv ~/Documents/hevin
hvs ~/Documents/hevin/shopping hvs ~/Documents/hevin/shopping
j ~/Documents/journal j ~/Documents/journal
jt ~/Documents/journal/todo jt ~/Documents/journal/todo
lh ~/Documents/listening-history # lh ~/Documents/listening-history
mmd ~/coding/move-mouse-with-head mmd ~/coding/move-mouse-with-head
mh ~/coding/mf-site/layouts mh ~/coding/mf-site/layouts
ms ~/coding/mf-site ms ~/coding/mf-site
@@ -83,6 +83,7 @@ pn ~/coding/red-discord-bot
rsf ~/coding/rarity-surf/frontend rsf ~/coding/rarity-surf/frontend
rsc ~/coding/rarity-surf/backend/rarity_check/project/management/commands rsc ~/coding/rarity-surf/backend/rarity_check/project/management/commands
# rsm ~/coding/rarity-surf/backend/rarity_check/project/migrations # rsm ~/coding/rarity-surf/backend/rarity_check/project/migrations
sl ~/Documents/sleep
sv ~/coding/spotify-lib-vis/src sv ~/coding/spotify-lib-vis/src
svg ~/coding/spotify-lib-vis/src/graphs/static/graphs/scripts svg ~/coding/spotify-lib-vis/src/graphs/static/graphs/scripts
swd ~/coding/swex swd ~/coding/swex
@@ -156,6 +157,8 @@ sdv ~/Documents/stardew-valley-aha
wo ~/Documents/workout-logs/7 wo ~/Documents/workout-logs/7
dap /mnt/linux-files-2/Pictures/ipad
# ]]] gaming # # ]]] gaming #
# sch [[[ # # sch [[[ #
@@ -163,26 +166,24 @@ wo ~/Documents/workout-logs/7
sc ~/school sc ~/school
lt ~/school/latex-notes lt ~/school/latex-notes
3 ~/school/318
3a ~/school/318/a3
# 458 [[[ #
4 ~/school/458
4a ~/school/458/a1/router
4a2 ~/school/458/a1-2/router
4a3 ~/school/458/a1-3/router
4as ~/school/458/a1-sol/router
4i ~/school/458/a1-instr
4t ~/school/458/a1-tar/PA1
4p ~/school/latex-notes/458/ps1
4s ~/school/458/slides
# ]]] 458 #
ltc ~/coding/leetcode ltc ~/coding/leetcode
sl ~/
es ~/coding/estuary
esw ~/coding/estuary-www
4 ~/school/494
4d ~/school/494/design
4dp ~/school/494/design/provotu
4p ~/school/494/papers
vt ~/coding/dao-voting
ovn ~/coding/dao-voting/anonymousvoting/contracts
pv ~/coding/dao-voting/provotum-v2
bd ~/coding/dao-voting/besu-deploy
h ~/school/phy
pc ~/school/pcl
# ]]] sch # # ]]] sch #
# pey [[[ # # pey [[[ #

View File

@@ -45,7 +45,7 @@ hh ~/.habitctl/habits
hlg ~/coding/spotify-lib-vis/src/api/management/commands/update-history.log hlg ~/coding/spotify-lib-vis/src/api/management/commands/update-history.log
id ~/Documents/journal/todo/ideas.md id ~/Documents/journal/todo/ideas.md
ig ./.gitignore ig ./.gitignore
jt ~/Documents/journal/todo/22/8.md jt ~/Documents/journal/todo/23/3.md
k ~/linux-config/dot_config/kitty/kitty.conf k ~/linux-config/dot_config/kitty/kitty.conf
lh ~/Documents/listening-history/polarbier.csv lh ~/Documents/listening-history/polarbier.csv
mc ~/coding/mf-site/assets/sass/main.scss mc ~/coding/mf-site/assets/sass/main.scss
@@ -54,6 +54,7 @@ ne ~/linux-config/configs/neofetch/config.conf
re README.md re README.md
rda ~/Documents/red-discord-bot/repos/gobcog-kevin/adventure/adventure.py rda ~/Documents/red-discord-bot/repos/gobcog-kevin/adventure/adventure.py
rdc ~/Documents/red-discord-bot/commands-freq.md rdc ~/Documents/red-discord-bot/commands-freq.md
sl ~/Documents/sleep/sleep.md
td todo.md td todo.md
tg ~/.config/watson/tags_cache tg ~/.config/watson/tags_cache
tt txt/todo.md tt txt/todo.md
@@ -68,7 +69,7 @@ wt ~/.config/watson/state.tmp
# sch [[[ # # sch [[[ #
sr ~/school/458/a1/router/sr_router.c 4d ~/school/494/design/acanet-voting-design.md
# ]]] sch # # ]]] sch #

View File

@@ -27,7 +27,7 @@ abbr hum "cd $mfs_dir && hugo serve -D --disableFastRender"
# system [[[ # system [[[
set -x HASTE_SERVER https://pste.gq set -x HASTE_SERVER https://pste.gq
{{ if eq .chezmoi.hostname "nzxt" }} {{ if eq .chezmoi.hostname "nzxt" }}
set -x CALCURSE_CALDAV_PASSWORD (pass show technology/linux/baikal | head -n1) # set -x CALCURSE_CALDAV_PASSWORD (pass show technology/linux/baikal | head -n1)
{{ end }} {{ end }}
set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64 set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64
set -x GOPATH ~/go set -x GOPATH ~/go
@@ -70,12 +70,15 @@ set -xU XSET_DELAY 200
xset r rate $XSET_DELAY $XSET_RATE xset r rate $XSET_DELAY $XSET_RATE
{{ end }}#]]] {{ end }}#]]]
# [[[ universal var's #
set -xU BROWSER "firefox" set -xU BROWSER "firefox"
# set -U BROWSER "chromium" # set -U BROWSER "chromium"
set -xU FZF_DEFAULT_COMMAND "find ." set -xU FZF_DEFAULT_COMMAND "find ."
set -x PHONE_IP "192.168.0.12" set -x LAPTOP_IP "192.168.0.19"
set -x PHONE_IP "192.168.0.13"
set -x PIXEL_IP "192.168.0.18" set -x PIXEL_IP "192.168.0.18"
set -x WORK_LAPTOP_IP "kmok@192.168.0.11" set -x WORK_LAPTOP_IP "kmok@192.168.0.11"
@@ -92,6 +95,8 @@ set -xU LOCAL_KOGITO_SERVICE_PORT "32000"
set -x FLASK_DEBUG 1 set -x FLASK_DEBUG 1
set -x DB_NAME "covid_monitor" set -x DB_NAME "covid_monitor"
set -x FULLNODE_API_INFO wss://api.chain.love
# ]]] universal var's # # ]]] universal var's #
# fish-specific [[[ # # fish-specific [[[ #
@@ -182,6 +187,7 @@ abbr ff "fzf-cd"
# abbr fr "fzf-ranger" # abbr fr "fzf-ranger"
abbr fv "fzf-vim" abbr fv "fzf-vim"
abbr fvft "find-vim-filetype" abbr fvft "find-vim-filetype"
abbr gif "video-to-gif"
# git [[[ # # git [[[ #
abbr gcamp "git-amend-push" abbr gcamp "git-amend-push"
@@ -239,6 +245,7 @@ abbr wga "wget-all"
abbr wag "watson-add-game" abbr wag "watson-add-game"
abbr waf "watson-add-game fortnite" abbr waf "watson-add-game fortnite"
abbr wap "watson-add-game pokemon-go" abbr wap "watson-add-game pokemon-go"
abbr wgn "wget-name"
abbr xya "export-pkgs" abbr xya "export-pkgs"
# school [[[ # # school [[[ #

View File

@@ -0,0 +1,4 @@
function video-to-gif
# ffmpeg -i $argv[1] -filter_complex "[0:v]setpts=0.5*PTS,fps=24,split [a][b];[a] palettegen [p];[b][p] paletteuse" $argv[2]
ffmpeg -i $argv[1] -filter_complex "[0:v]fps=24,split [a][b];[a] palettegen [p];[b][p] paletteuse" $argv[2]
end

View File

@@ -0,0 +1,3 @@
function wget-name
wget $argv[1] -O $argv[2]
end

View File

@@ -463,7 +463,8 @@ set $ws11 "11 "
workspace $ws11 output $secondary workspace $ws11 output $secondary
# bindsym $mod+F11 workspace $ws11; exec $term -e htop -s PERCENT_CPU # bindsym $mod+F11 workspace $ws11; exec $term -e htop -s PERCENT_CPU
bindsym $mod+F11 workspace $ws11; exec $term -e htop -s PERCENT_MEM bindsym $mod+F11 workspace $ws11; exec $term -e htop -s PERCENT_MEM
bindsym Mod4+$mod+F11 workspace $ws11; exec $term -e fish -c 'tmux-attach obs' # bindsym Mod4+$mod+F11 workspace $ws11; exec $term -e fish -c 'tmux-attach backup'
bindsym Control+Shift+F11 workspace $ws11; exec $term -e fish -c 'tmux-attach backup'
bindsym Mod4+t workspace $ws11; exec nordvpn connect && transmission-gtk bindsym Mod4+t workspace $ws11; exec nordvpn connect && transmission-gtk
# bindsym $mod+F11 workspace $ws11; exec $term -e gotop -m # bindsym $mod+F11 workspace $ws11; exec $term -e gotop -m
# bindsym Mod4+a workspace $ws11; exec antimicro # bindsym Mod4+a workspace $ws11; exec antimicro

View File

@@ -17,21 +17,41 @@ color=#cbe4ff
{{ if eq .chezmoi.hostname "nzxt" }} {{ if eq .chezmoi.hostname "nzxt" }}
# [ticker]
# label=SOL
# TICKER=SOL-USD
# interval=30
[kraken]
label=ARB
TICKER=ARBUSD
interval=30
# [ticker]
# label=ETH
# TICKER=ETH-USD
# interval=30
[kraken]
label=ETH
TICKER=ETHUSDC
interval=30
[kraken]
label=BLUR
TICKER=BLURUSD
interval=30
# [ticker]
# label=SPY
# TICKER=SPY
# interval=30
# [ticker] # [ticker]
# label=BTC # label=BTC
# TICKER=BTC-USD # TICKER=BTC-USD
# interval=30 # interval=30
[ticker]
label=SOL
TICKER=SOL-USD
interval=30
[ticker]
label=ETH
TICKER=ETH-USD
interval=30
# [ticker] # [ticker]
# label=DAQ # label=DAQ
# TICKER=^IXIC # TICKER=^IXIC

View File

@@ -0,0 +1,5 @@
#!/bin/bash
. "/home/kevin/.cache/wal/colors.sh"
ticker=$(~/scripts/kraken $TICKER)
printf "%s\n\n%s\n" "$ticker" "$color7"

View File

@@ -15,12 +15,12 @@ Ctrl+RIGHT no-osd seek 0.2 exact
Ctrl+LEFT no-osd seek -0.2 exact Ctrl+LEFT no-osd seek -0.2 exact
Shift+RIGHT no-osd seek 1 exact Shift+RIGHT no-osd seek 1 exact
Shift+LEFT no-osd seek -1 exact Shift+LEFT no-osd seek -1 exact
RIGHT seek 3 RIGHT seek 3 exact
LEFT seek -3 LEFT seek -3 exact
UP seek 10 UP seek 10 exact
DOWN seek -10 DOWN seek -10 exact
Shift+UP seek 60 Shift+UP seek 60 exact
Shift+DOWN seek -60 Shift+DOWN seek -60 exact
# mark # mark
m revert-seek mark # mark position for revert-seek m revert-seek mark # mark position for revert-seek

View File

@@ -1,16 +0,0 @@
audio.play_bitrate_non_metered_migrated=true
audio.sync_bitrate_enumeration=4
audio.crossfade_v2=true
gaia.attached_device_id="6ca6cdc7bc677d43534460982c3a13959dd1939c"
audio.play_bitrate_enumeration=4
ui.hide_hpto=true
ui.track_notifications_enabled=false
audio.play_bitrate_non_metered_enumeration=4
audio.normalize_v2=false
ui.show_friend_feed=false
app.player.volume=40000
{{ if eq .chezmoi.hostname "x1-carbon" }}
app.browser.zoom-level=300
{{ else }}
app.browser.zoom-level=75
{{ end }}

View File

@@ -1,7 +1,7 @@
[user] [user]
email = kevin.mok@mail.utoronto.ca email = kevin.mok@mail.utoronto.ca
name = Kevin Mok name = Kevin Mok
signingkey = C072BD80DB66DE18 signingkey = 6DEED612B26C08E2
[color] [color]
ui = auto ui = auto
[core] [core]

View File

@@ -76,8 +76,6 @@ autocmd Filetype markdown let g:AutoPairs = {'(':')', '[':']', '{':'}','"':'"',
autocmd Filetype markdown let g:AutoPairs={'(':')', '[':']', '{':'}','"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''","*":"*"} autocmd Filetype markdown let g:AutoPairs={'(':')', '[':']', '{':'}','"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''","*":"*"}
autocmd Filetype markdown map <F8> :InstantMarkdownPreview<CR> autocmd Filetype markdown map <F8> :InstantMarkdownPreview<CR>
autocmd Filetype markdown map <F9> :InstantMarkdownStop<CR>:InstantMarkdownPreview<CR> autocmd Filetype markdown map <F9> :InstantMarkdownStop<CR>:InstantMarkdownPreview<CR>
autocmd Filetype markdown inoremap <Tab> <Esc>>>A
autocmd Filetype markdown inoremap <S-Tab> <Esc><<A
autocmd Filetype markdown inoremap < <Esc><<A autocmd Filetype markdown inoremap < <Esc><<A
autocmd Filetype markdown inoremap << < autocmd Filetype markdown inoremap << <
autocmd Filetype markdown inoremap > <Esc>>>A autocmd Filetype markdown inoremap > <Esc>>>A

8
scripts/executable_kraken Executable file
View File

@@ -0,0 +1,8 @@
price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]")
# echo $price
if (( $(echo "$price < 10" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3-
# printf "%0.3f\n" "$price"
elif (( $(echo "$price < 10000" | bc -l) )); then
printf "%'0.0f\n" "$price" | sed 's/,//'
fi

View File

@@ -86,16 +86,19 @@ for symbol in $(IFS=' '; echo "${SYMBOLS[*]}" | tr '[:lower:]' '[:upper:]'); do
hour=$(date +"%H") hour=$(date +"%H")
if [[ "$symbol" == "USDCAD=X" ]]; then if [[ "$symbol" == "USDCAD=X" ]]; then
printf "%0.4f\n" "$price" printf "%0.4f\n" "$price"
elif [[ "$symbol" == "BTC-USD" || "$symbol" == "ETH-USD" ]]; then elif [[ "$symbol" == "BTC-USD" ]]; then
# echo "$price" | cut -c 2-3 # echo "$price" | cut -c 2-3
echo "$price" | cut -c -3 echo "$price" | cut -c -3
elif [[ "$symbol" == "SOL-USD" ]]; then
# echo "$price" | cut -c -4 # echo "$price" | cut -c -4
echo "$price" | cut -c -5 elif [[ "$symbol" == "SOL-USD" || "$symbol" == "ETH-USD" ]]; then
echo "$price" | cut -c -4
# echo "$price" | cut -c -5
elif (( $(echo "$price > 10000" | bc -l) )); then elif (( $(echo "$price > 10000" | bc -l) )); then
printf "%'0.0f\n" "$price" | cut -c 2-4 printf "%'0.0f\n" "$price" | cut -c 2-4
# elif (( $(echo "$price < 1" | bc -l) )); then # elif (( $(echo "$price < 1" | bc -l) )); then
# printf "%0.3f\n" "$price" # printf "%0.3f\n" "$price"
elif (( $(echo "$price > 100" | bc -l) )); then
printf "%'0.0f\n" "$price" | cut -c 1-3
else else
printf "%0.2f\n" "$price" | cut -c 3- printf "%0.2f\n" "$price" | cut -c 3-
# printf "%0.2f\n" "$price" # printf "%0.2f\n" "$price"