Ticker i3block, reminder fish script
kubectl completion.
This commit is contained in:
@@ -49,9 +49,10 @@ ngb "sudo nvim /etc/default/grub"
|
||||
mgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
|
||||
|
||||
# a "bat"
|
||||
ba "bat"
|
||||
b "bat"
|
||||
# ba "bat *"
|
||||
awkp "awk -F',' '{print \$0}'"
|
||||
cpr "cp -r"
|
||||
fde "fd -e"
|
||||
grep "grep --color=auto -n"
|
||||
grpr "grep -r"
|
||||
@@ -131,7 +132,9 @@ vd "vidir --verbose"
|
||||
{{ if not (eq .linux_os "termux") }}
|
||||
l "lsd -F --group-dirs first"
|
||||
la "lsd -AF --group-dirs first"
|
||||
ld "lsd -F --group-dirs first -d */"
|
||||
ll "lsd -lF --group-dirs first --size short"
|
||||
lld "lsd -lF --group-dirs first --size short -d */"
|
||||
llr "lsd -lF --group-dirs first --size short -tr"
|
||||
lla "lsd -AlF --group-dirs first --size short"
|
||||
{{ else }}
|
||||
@@ -305,8 +308,8 @@ a "task"
|
||||
aa "task add"
|
||||
aab "task add proj:pey +bot"
|
||||
aal "task add proj:lnx"
|
||||
aam "task add proj:ms"
|
||||
aamy "task add proj:mny"
|
||||
# aam "task add proj:ms"
|
||||
aam "task add proj:mny"
|
||||
aap "task add proj:"
|
||||
# aacm "task add proj:codm"
|
||||
aacr "task add proj:crim"
|
||||
@@ -330,6 +333,7 @@ aj "task +jira"
|
||||
apl "task completed"
|
||||
al "task limit:15"
|
||||
alg "task log"
|
||||
algy "task log proj:pey"
|
||||
ans "task +next"
|
||||
ao "taskopen -A"
|
||||
asm "task summary"
|
||||
@@ -362,6 +366,7 @@ ccc "calcurse -D ~/.calcurse/alt-cals/class"
|
||||
cci "calcurse -i"
|
||||
ccs "calcurse-caldav"
|
||||
chr "google-chrome"
|
||||
cht "chatterino"
|
||||
clc "cloc ."
|
||||
cv "cava"
|
||||
dg "dragon-drag-and-drop -x"
|
||||
@@ -387,14 +392,15 @@ kf "killall firefox"
|
||||
kag "killall gopls"
|
||||
kai "killall imwheel && imwheel"
|
||||
kt "killall thunderbird"
|
||||
lo "libreoffice"
|
||||
# mpv "mpv --volume=50"
|
||||
# lo "libreoffice"
|
||||
m "mpv"
|
||||
mpvv "mpv --volume=50"
|
||||
mpl "mpv --loop"
|
||||
msf "mpv --sub-file="
|
||||
mra "man ranger"
|
||||
# mt "minetest"
|
||||
n "nvim"
|
||||
nl "nload devices wlp4s0 -u M"
|
||||
nm "nomacs ."
|
||||
np "nvim --"
|
||||
ndu "ncdu"
|
||||
@@ -405,6 +411,7 @@ pcp "pycp"
|
||||
pmv "pymv"
|
||||
py "python"
|
||||
q "qalc '"
|
||||
qe "qalc -e '1USD to CAD'"
|
||||
qg "qalculate-gtk"
|
||||
r "ranger"
|
||||
rbg "ranger --selectfile (grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2)"
|
||||
@@ -418,7 +425,7 @@ sqlb "sqlitebrowser"
|
||||
# ss "mosh"
|
||||
stp "termdown"
|
||||
# sw "swex"
|
||||
t "tmux"#[[[
|
||||
# t "tmux"#[[[
|
||||
# ta "tmux a -t"
|
||||
tabu "tmux a -t backup || tmux new -s backup"
|
||||
tacf "tmux a -t config || tmux new -s config"
|
||||
@@ -534,6 +541,7 @@ gba "git branch --no-merged && echo '' && git branch --merged"
|
||||
gbu "git branch --no-merged"
|
||||
gbm "git branch --merged"
|
||||
gbr "git branch -m"
|
||||
gbu "git branch --set-upstream-to="
|
||||
|
||||
gsm "git submodule"
|
||||
gsma "git submodule add"
|
||||
@@ -567,8 +575,9 @@ gal "git lfs track"
|
||||
gacu "git add -A && git commit"
|
||||
|
||||
glf "git lfs"
|
||||
glfi "git lfs install"
|
||||
glfp "git lfs pull"
|
||||
# glfi "git lfs install"
|
||||
# glfp "git lfs pull"
|
||||
glfp "git lfs install && git lfs pull"
|
||||
glft "git lfs track *"
|
||||
|
||||
gm "git mv"
|
||||
@@ -586,9 +595,8 @@ grmor "rm (fd -e orig --no-ignore -H)"
|
||||
gd "git diff -w"
|
||||
gdc "git diff --cached -w"
|
||||
gdh "git diff --cached -w HEAD~1"
|
||||
# gds "git diff --stat"
|
||||
# gdsc "git diff --stat --cached -w"
|
||||
gds "git diff --stat --cached -w"
|
||||
gds "git diff --stat"
|
||||
gdsc "git diff --stat --cached -w"
|
||||
gdt "git difftool -w --tool=vimdiff"
|
||||
gdtc "git difftool -w --cached --tool=vimdiff"
|
||||
gl "git log -5"
|
||||
@@ -724,7 +732,7 @@ upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xa
|
||||
ureq "pip freeze > requirements.txt"
|
||||
|
||||
# show last history scan
|
||||
hlg "psql -U postgres -d spotifyvis -a -f /home/kevin/coding/spotify-lib-vis/src/scripts/queries/history.sql | rg 2020 | tac"
|
||||
hlg "psql -U postgres -d spotifyvis -a -f /home/kevin/coding/spotify-lib-vis/src/scripts/queries/history.sql | rg 2021 | tac"
|
||||
slg "tail -n 5 $spv_dir/src/api/management/commands/update-history.log"
|
||||
# scan history
|
||||
# hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
|
||||
@@ -798,7 +806,8 @@ mm "printf '\033c' && bear make clean move_mouse_with_head && ./move_mouse_with_
|
||||
med "printf '\033c' && bear make clean eye_detector && ./eye_detector"
|
||||
mft "printf '\033c' && bear make clean face_detector && ./face_detector"
|
||||
rft "~/coding/face-tracker/face_detector > /tmp/move_mouse_with_head.out"
|
||||
gpsb "git push bitbucket"
|
||||
# gpsb "git push bitbucket"
|
||||
gpsb "git push bot"
|
||||
|
||||
# ]]] ada-mario #
|
||||
|
||||
@@ -832,13 +841,16 @@ mtsv "minetestserver --gameid minimal --worldname Test --terminal"
|
||||
|
||||
# ]]] minetest #
|
||||
|
||||
tet "pandoc -f markdown -t html twitch-emote-conversion.md | xclip -selection clipboard"
|
||||
# tet "pandoc -f markdown -t html twitch-emote-conversion.md | xclip -selection clipboard"
|
||||
shrg "printf '¯\\\\\\\\\\_(ツ)_/¯' | xclip -selection clipboard"
|
||||
|
||||
dcec "mono DiscordChatExporter.Cli.exe"
|
||||
dcec "mono DiscordChatExporter.Cli.exe export -t $DISCORD_TOKEN -c"
|
||||
|
||||
ifm "sxiv ~/Documents/fortnite/maps/boat-campfire-slurp.png"
|
||||
|
||||
# twitchy [[[ #
|
||||
|
||||
tw "twitchy"
|
||||
twa "twitchy -a"
|
||||
twd "twitchy -d"
|
||||
@@ -847,9 +859,13 @@ twf "watch -n300 'twitchy-game Fortnite'"
|
||||
# mp "mpv --video-zoom=1.5"
|
||||
# ufn "source trn-api-key.fish && curl --request GET --url https://api.fortnitetracker.com/v1/profile/pc/Vole%20on%20Mobile --header 'trn-api-key: 584d8eca-30d9-4119-92d8-5067dd301118' --cookie __cfduid=d4f0daac7eee3687b481bd55dcf00f3581581900091 > stats.json"
|
||||
|
||||
# ]]] twitchy #
|
||||
|
||||
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'"
|
||||
|
||||
# ]]] games #
|
||||
|
||||
# school [[[ #
|
||||
@@ -870,11 +886,12 @@ vpd "nmcli con down id '1 - Red Hat Global VPN'"
|
||||
# laptop
|
||||
# gcfr "git config user.email 'kmok@redhat.com' && git config user.signingkey 10B001347552F396"
|
||||
gchk "git checkout KOGITO-"
|
||||
gch2 "git checkout KOGITO-2113"
|
||||
gch3 "git checkout KOGITO-1031-diff-3"
|
||||
|
||||
loe "libreoffice ~/Documents/expenses/2020.ods &"
|
||||
loe "libreoffice ~/Documents/expenses/2021.ods &"
|
||||
loi "libreoffice ~/Documents/expenses/investments.ods &"
|
||||
ssw "mosh $WORK_LAPTOP_IP tmux a"
|
||||
ssw2 "mosh $WORK_LAPTOP_IP -- tmux a -t nzxt-2"
|
||||
ssi "mosh $WORK_LAPTOP_IP -- tmux a -t weechat"
|
||||
scw "scp $WORK_LAPTOP_IP:"
|
||||
sfw "sftp $WORK_LAPTOP_IP"
|
||||
@@ -884,15 +901,32 @@ ghr "github-release"
|
||||
|
||||
# oc [[[ #
|
||||
|
||||
o "oc"
|
||||
odc "oc describe pod"
|
||||
odl "oc delete project"
|
||||
og "oc get pods -w"
|
||||
ol "oc logs"
|
||||
on "oc new-project"
|
||||
op "oc project"
|
||||
opd "oc project default"
|
||||
ot "oc status"
|
||||
o "kubectl"
|
||||
oa "kubectl apply -f"
|
||||
od "kubectl describe"
|
||||
odp "kubectl describe pod"
|
||||
odi "kubectl describe kogitoinfra"
|
||||
odr "kubectl describe kogitoruntime"
|
||||
odl "kubectl delete"
|
||||
odlb "kubectl delete kogitobuild"
|
||||
odlc "kubectl delete configmap"
|
||||
odlp "kubectl delete pod"
|
||||
odlpj "kubectl delete project"
|
||||
odlr "kubectl delete kogitoruntime"
|
||||
og "kubectl get pods"
|
||||
ogw "kubectl get pods -w"
|
||||
ogb "kubectl get kogitobuild"
|
||||
ogc "kubectl get configmap"
|
||||
ogi "kubectl get imagestream"
|
||||
ogn "kubectl get"
|
||||
ogr "kubectl get kogitoruntime"
|
||||
ol "kubectl logs -f"
|
||||
oli "kubectl login -u kubeadmin -p"
|
||||
on "kubectl new-project"
|
||||
op "kubectl project"
|
||||
opa "kubectl projects | rg kogito"
|
||||
opd "kubectl project default"
|
||||
ot "kubectl status"
|
||||
|
||||
# ]]] oc #
|
||||
|
||||
@@ -907,20 +941,28 @@ jkc "java -jar ~/java/jenkins-cli.jar -s http://localhost:8090 -auth kevin:$JENK
|
||||
# maven [[[ #
|
||||
|
||||
mvc "mvn clean"
|
||||
mvci "mvn clean install -Dfull"
|
||||
mvi "mvn install -Dfull"
|
||||
# mvps "mvn package -DskipTests"
|
||||
mvp "mvn package -DskipTests"
|
||||
mvp "mvn clean package -DskipTests"
|
||||
mvpr "mvn clean package -DskipTests && ./server-control.sh start"
|
||||
mvt "mvn test"
|
||||
mvct "mvn clean test"
|
||||
# mvt "mvn test"
|
||||
# mvct "mvn clean test"
|
||||
|
||||
# ]]] maven #
|
||||
|
||||
mk "make -j8"
|
||||
mc "make clean"
|
||||
mct "make clean test"
|
||||
ml "make lint"
|
||||
mt "make test"
|
||||
# mvet "make vet"
|
||||
# mvett "make vet test"
|
||||
mvt "make vet"
|
||||
mvtt "make vet test"
|
||||
|
||||
kg "kogito"
|
||||
mk "minikube"
|
||||
# mk "minikube"
|
||||
|
||||
gor "go run"
|
||||
got "go test"
|
||||
@@ -932,3 +974,6 @@ dki "docker image"
|
||||
dkis "docker images"
|
||||
|
||||
# ]]] red-hat #
|
||||
|
||||
# tet "ticker (cat ~/Documents/expenses/etf.md) | xclip -selection clipboard"
|
||||
tet "ticker (xclip -o) | xclip -selection clipboard"
|
||||
|
||||
@@ -15,6 +15,7 @@ lc ~/linux-config
|
||||
lf /mnt/linux-files
|
||||
lfp /mnt/linux-files/Pictures
|
||||
lfv /mnt/linux-files/Videos
|
||||
lfy /mnt/linux-files/Videos/yt
|
||||
me /run/media/kevin
|
||||
o /
|
||||
pd ~/.password-store
|
||||
@@ -57,6 +58,7 @@ b1 ~/coding/mf-site/themes/base16
|
||||
2d ~/coding/godot-demos/2d-plat
|
||||
ada ~/coding/ada-mario
|
||||
ft ~/coding/face-tracker
|
||||
hv ~/Documents/hevin
|
||||
j ~/Documents/journal
|
||||
lh ~/Documents/listening-history
|
||||
mmd ~/coding/move-mouse-with-head
|
||||
@@ -101,11 +103,15 @@ adP ~/Pictures/ada-mario
|
||||
lfo /mnt/linux-files/Videos/obs
|
||||
pxv /mnt/linux-files/Videos/pixel
|
||||
|
||||
# codm [[[ #
|
||||
|
||||
cm ~/Documents/codm
|
||||
cs ~/Documents/codm/site
|
||||
csi ~/Documents/codm/site/static/images
|
||||
Css ~/Pictures/screenshots/mobile/codm
|
||||
|
||||
# ]]] codm #
|
||||
|
||||
# fortnite [[[ #
|
||||
|
||||
fn ~/Documents/fortnite
|
||||
@@ -120,6 +126,7 @@ tcd /mnt/linux-files/Videos/yt/fortnite/clips/twitch-clip-downloader
|
||||
# ]]] fortnite #
|
||||
|
||||
pgv /mnt/linux-files/Videos/pokemon-go
|
||||
tr ~/.local/share/Terraria
|
||||
|
||||
# ]]] gaming #
|
||||
|
||||
@@ -142,25 +149,31 @@ ep ~/Documents/expenses
|
||||
k ~/coding/kogito
|
||||
kap ~/coding/kogito/kogito-apps
|
||||
kdo ~/coding/kogito/kie-docs
|
||||
kdoa ~/coding/kogito/kie-docs/doc-content/kogito-docs/src/main/asciidoc
|
||||
kex ~/coding/kogito/kogito-examples
|
||||
keh ~/coding/kogito/kogito-examples/process-scripts-quarkus/target
|
||||
kfl ~/coding/kogito/kogito-apps
|
||||
ki ~/coding/kogito/kogito-images
|
||||
kj ~/coding/kogito/jenkins-test
|
||||
kjb ~/coding/kogito/jenkins-test-bot
|
||||
kjf ~/coding/kogito/jenkins-test/full
|
||||
kl ~/coding/kogito/shared-libraries
|
||||
# operator [[[ #
|
||||
|
||||
ko ~/go/src/github.com/kiegroup/kogito-cloud-operator
|
||||
koc ~/go/src/github.com/kiegroup/kogito-cloud-operator/cmd/kogito/command
|
||||
kor ~/go/src/github.com/kiegroup/rhpam-kogito-operator
|
||||
# koc ~/go/src/github.com/kiegroup/kogito-cloud-operator/cmd/kogito/command
|
||||
koc ~/coding/kogito/kogito-cloud-operator
|
||||
kod ~/go/src/github.com/kiegroup/kogito-cloud-operator/cmd/kogito/command/deploy
|
||||
kof ~/go/src/github.com/kiegroup/kogito-cloud-operator/cmd/kogito/command/flag
|
||||
kor ~/go/src/github.com/kiegroup/kogito-cloud-operator/pkg/controller/kogitoruntime
|
||||
# kor ~/go/src/github.com/kiegroup/kogito-cloud-operator/pkg/controller/kogitoruntime
|
||||
kou ~/go/src/github.com/kiegroup/kogito-cloud-operator/cmd/kogito/command/util
|
||||
ko2 ~/coding/kogito/kogito-cloud-operator-2
|
||||
|
||||
# ]]] operator #
|
||||
kot ~/coding/kogito/optaplanner
|
||||
kp ~/coding/kogito/kogito-pipelines
|
||||
kp2 ~/coding/kogito/kogito-pipelines-2
|
||||
kpr ~/coding/pull-requests/red-hat
|
||||
kr ~/coding/kogito/kogito-runtimes
|
||||
krj ~/coding/kogito/kogito-runtimes/jenkins-spock-tests
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# sys [[[ #
|
||||
|
||||
3 ~/linux-config/dot_config/i3/config.tmpl
|
||||
3b ~/linux-config/dot_config/i3blocks/i3blocks.conf.tmpl
|
||||
a ~/linux-config/aliases/key_aliases.tmpl
|
||||
ak ~/linux-config/dot_ssh/authorized_keys-all
|
||||
d ~/linux-config/aliases/key_dirs.tmpl
|
||||
@@ -95,14 +96,17 @@ fv ~/Documents/fortnite/notes/vods.md
|
||||
mta ~/.minetest/clientmods/custom_aliases/init.lua
|
||||
pk ~/Downloads/pokecord/pokecord2.md
|
||||
tc /mnt/linux-files/Videos/yt/fortnite/clips/twitch-clip-downloader/clips.txt
|
||||
tdb ~/Documents/journal/todo/b.md
|
||||
|
||||
# ]]] gaming #
|
||||
|
||||
# pey [[[ #
|
||||
|
||||
j Jenkinsfile
|
||||
j Jenkinsfile.
|
||||
jd Jenkinsfile.deploy
|
||||
klg ~/coding/kogito/shared-libraries/vars/githubscm.groovy
|
||||
klm ~/coding/kogito/shared-libraries/vars/maven.groovy
|
||||
kpr ~/coding/kogito/kogito-pipelines/Jenkinsfile.pr-bdd-tests
|
||||
krt /home/kevin/coding/kogito/kogito-runtimes/jenkins-spock-tests/src/test/vars/JenkinsfilePromote.groovy
|
||||
rd ~/Documents/red-hat/dates.md
|
||||
rm ~/Documents/red-hat/meeting.md
|
||||
|
||||
@@ -4,4 +4,6 @@ keycode 9 = Caps_Lock
|
||||
keycode 22 = BackSpace
|
||||
keycode 66 = Escape
|
||||
|
||||
pointer = 1 10 3 6 7 4 5 2 11 12 8 9
|
||||
pointer = 1 2 3 6 7 4 5 10 11 12 8 9
|
||||
! side thumb button as middle click
|
||||
! pointer = 1 10 3 6 7 4 5 2 11 12 8 9
|
||||
|
||||
1654
dot_config/fish/completions/kubectl.fish
Normal file
1654
dot_config/fish/completions/kubectl.fish
Normal file
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ set -x HASTE_SERVER https://pste.gq
|
||||
set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64
|
||||
set -x GOPATH ~/go
|
||||
# set -x PATH $GRAALVM_BIN $PATH ~/.local/bin ~/scripts ~/scripts/colors ~/go/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin
|
||||
set -x PATH $PATH ~/.local/bin ~/scripts ~/scripts/colors $GOPATH/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin
|
||||
set -x PATH $PATH ~/.local/bin ~/scripts ~/scripts/colors $GOPATH/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin ~/.gem/ruby/2.7.0/bin
|
||||
set -x PKG_CONFIG_PATH $PKG_CONFIG_PATH /usr/lib/pkgconfig
|
||||
|
||||
# Java [[[ #
|
||||
@@ -39,9 +39,8 @@ set -x PKG_CONFIG_PATH $PKG_CONFIG_PATH /usr/lib/pkgconfig
|
||||
# set -x GRAALVM_BIN $GRAALVM_HOME/bin
|
||||
# set -x JAVA_HOME $GRAALVM_HOME
|
||||
|
||||
# for shared libs
|
||||
set -x JAVA_HOME /usr/lib/jvm/java-11-openjdk
|
||||
# set -x JAVA_HOME /usr/lib/jvm/java-8-openjdk
|
||||
# set -x JAVA_HOME /usr/lib/jvm/java-8-openjdk # for shared libs
|
||||
|
||||
set -x PATH $JAVA_HOME/bin $PATH
|
||||
|
||||
@@ -74,10 +73,8 @@ set -xU BROWSER "firefox"
|
||||
|
||||
set -xU FZF_DEFAULT_COMMAND "find ."
|
||||
|
||||
# set -xU PHONE_IP "192.168.0.10"
|
||||
# set -xU WORK_LAPTOP_IP "kmok@192.168.0.12"
|
||||
set -x PHONE_IP "192.168.0.12"
|
||||
set -x WORK_LAPTOP_IP "kmok@192.168.0.13"
|
||||
set -x PHONE_IP "192.168.0.11"
|
||||
set -x WORK_LAPTOP_IP "kmok@192.168.0.12"
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
set -x CALCURSE_CALDAV_PASSWORD (pass show technology/linux/baikal | head -n1)
|
||||
@@ -152,11 +149,12 @@ abbr ax "task-context"
|
||||
|
||||
# ]]] task #
|
||||
abbr ag "grep-aliases"
|
||||
abbr b "buku-fzf"
|
||||
abbr bf "buku-fzf fq"
|
||||
abbr bk "buku-fzf"
|
||||
abbr bkf "buku-fzf fq"
|
||||
abbr bq "benq-brightness"
|
||||
abbr bun "backup nzxt"
|
||||
abbr bupp "backup-phone-pics"
|
||||
abbr ca "cad-to-us"
|
||||
abbr cccs "sync-alt-cal class"
|
||||
abbr cl "clip"
|
||||
abbr cpc "copy cat"
|
||||
@@ -188,6 +186,7 @@ abbr gsmb "git-submodule-branch"
|
||||
|
||||
# ]]] git #
|
||||
abbr i "sxiv-silent"
|
||||
abbr lo "libreoffice-silent"
|
||||
# abbr m "man-vim"
|
||||
abbr mn "man-vim"
|
||||
abbr ma "man-vim task"
|
||||
@@ -198,6 +197,7 @@ abbr pgr "grep-pdf"
|
||||
abbr pgrf "grep-pdf-file"
|
||||
abbr pst "pastebin"
|
||||
abbr qh "qalc-history"
|
||||
abbr re "reminder ''"
|
||||
abbr rf "refresh-config"
|
||||
abbr rl "readlink-cp"
|
||||
abbr rs "redshift-set"
|
||||
@@ -211,7 +211,8 @@ abbr svp "server-pages"
|
||||
abbr ta "tmux-attach"
|
||||
abbr tao "tmux-attach obs"
|
||||
abbr thes "thesaurus"
|
||||
abbr usc "us-to-cad"
|
||||
# abbr usc "us-to-cad"
|
||||
abbr us "us-to-cad"
|
||||
abbr ut "unix-timestamp"
|
||||
abbr uzr "unzip-rm"
|
||||
abbr vsnp "vim-snippet"
|
||||
|
||||
3
dot_config/fish/functions/cad-to-us.fish
Normal file
3
dot_config/fish/functions/cad-to-us.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function cad-to-us
|
||||
qalc "$argv[1]CAD to \$"
|
||||
end
|
||||
3
dot_config/fish/functions/libreoffice-silent.fish
Normal file
3
dot_config/fish/functions/libreoffice-silent.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function libreoffice-silent
|
||||
libreoffice $argv[1] &
|
||||
end
|
||||
3
dot_config/fish/functions/reminder.fish
Normal file
3
dot_config/fish/functions/reminder.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function reminder
|
||||
termdown $argv[2] && notify-send $argv[1]
|
||||
end
|
||||
@@ -2,6 +2,7 @@ function scan-history
|
||||
sudo systemctl start postgresql.service
|
||||
# and systemctl status postgresql.service
|
||||
and source $spv_dir/src/scripts/api-keys.sh
|
||||
and $spv_dir/src/scripts/update-history-2.sh
|
||||
# and $spv_dir/src/scripts/update-history-2.sh
|
||||
and $spv_dir/src/scripts/update-history.sh
|
||||
and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
function us-to-cad
|
||||
# qalc -e "$argv[1]\$ to CAD"
|
||||
qalc "$argv[1]\$ to CAD"
|
||||
end
|
||||
|
||||
@@ -48,10 +48,13 @@ bindsym Mod4+Return exec /home/kevin/scripts/dmenu-history -nb "$fg" -nf "$bg" -
|
||||
# installed.
|
||||
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
|
||||
# bindsym Mod4+b layout tabbed; exec zathura
|
||||
bindsym Mod4+c exec $browser
|
||||
# bindsym Mod4+c exec $browser
|
||||
# bindsym Mod4+$mod+c exec chatterino
|
||||
bindsym Mod4+c exec chatterino
|
||||
bindsym Mod4+$mod+c exec $browser
|
||||
# bindsym Mod4+e exec notify-send "HPS Word Count" "$(pdftotext /home/kevin/school/latex-notes/hps/essay.pdf - | wc -w)"
|
||||
# bindsym Mod4+e exec emacs
|
||||
bindsym Mod4+e exec ~/scripts/twem
|
||||
# bindsym Mod4+e exec ~/scripts/twem
|
||||
# bindsym Mod4+f exec firefox
|
||||
# bindsym Mod4+f exec firefox --private-window
|
||||
bindsym Mod4+f exec firefox --private-window google.ca
|
||||
@@ -68,7 +71,7 @@ bindsym Mod4+m exec $type_delay_cmd && xdotool type 'me@kevin-mok.com'
|
||||
bindsym Mod4+n exec $term -e nvim
|
||||
# bindsym Mod4+$mod+o exec xset dpms force off
|
||||
# bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail && $type_delay_cmd && xdotool key 'Control_L+v'
|
||||
bindsym Mod4+o exec obs
|
||||
bindsym Mod4+o workspace $ws11; exec obs
|
||||
bindSym $mod+Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail && $type_delay_cmd && xdotool key 'Control_L+v'
|
||||
# bindsym Mod4+p workspace $ws4; exec pgadmin3
|
||||
# bindsym Mod4+p exec pycharm
|
||||
@@ -79,7 +82,8 @@ bindsym Mod4+p exec passmenu
|
||||
# bindsym Mod4+q exec qdirstat
|
||||
bindsym Mod4+q exec printf 'emad1 ' | xclip -selection clipboard && $type_delay_cmd && xdotool key 'Control_L+v'
|
||||
bindsym Mod4+r exec $type_delay_cmd && xdotool type 'kmok@redhat.com'
|
||||
bindsym Mod4+$mod+r exec $term -e ranger
|
||||
bindsym Mod4+$mod+r exec pass show -c career/redhat && $type_delay_cmd && xdotool key 'Control_L+v'
|
||||
# bindsym Mod4+$mod+r exec $term -e ranger
|
||||
# bindsym Mod4+$mod+r exec notify-send "watson restart" "$(watson restart)"
|
||||
bindsym Mod4+$mod+s exec $type_delay_cmd && xdotool type 'https://smol.gq/'
|
||||
bindsym Mod4+t exec xclip -selection clipboard ~/.password-store/social/trapbot && $type_delay_cmd && xdotool key 'Control_L+v'
|
||||
@@ -91,6 +95,7 @@ bindsym Control+Mod4+w exec $term -e nvim /home/kevin/.config/watson/state.tmp
|
||||
# bindsym Mod4+x exec $swex
|
||||
bindsym Control+$mod+x exec $type_delay_cmd && xdotool type 'http://codm.ataraxy.tk/'
|
||||
bindsym Mod4+z exec cliqz
|
||||
bindsym Pause exec ~/scripts/twem
|
||||
|
||||
# screenshot [[[ #
|
||||
|
||||
@@ -147,6 +152,7 @@ bindsym Control+$mod+q exec sudo systemctl stop netctl-auto@wlp3s0.service
|
||||
|
||||
# ]]] backlight #
|
||||
|
||||
for_window [class="chatterino"] floating enable
|
||||
for_window [class="Peek"] floating enable
|
||||
for_window [title="Qalculate!"] floating enable
|
||||
|
||||
@@ -322,16 +328,17 @@ set $main "HDMI-0"
|
||||
# workspace $ws1 output $main
|
||||
workspace $ws1 output $secondary
|
||||
bindsym $mod+F1 workspace $ws1; exec $term
|
||||
bindsym Mod4+$mod+F1 workspace $ws1; exec chatterino
|
||||
bindsym Control+Shift+F1 workspace $ws1; exec $term -e fish -c 'tmux-attach red-hat'
|
||||
|
||||
set $ws2 "2 "
|
||||
set $wl_ip_nast_num "3"
|
||||
set $work_laptop_ip "192.168.0.16"
|
||||
workspace $ws2 output $secondary
|
||||
bindsym $mod+F2 workspace $ws2; exec $term
|
||||
# bindsym Control+Shift+F2 workspace $ws2; exec $term -e mosh kmok@192.168.0.1$wl_ip_nast_num -- tmux a -t nzxt
|
||||
# bindsym Control+Shift+F2 workspace $ws2; exec $term -e mosh kmok@$work_laptop_ip -- tmux a -t nzxt
|
||||
# bindsym Control+Shift+F2 workspace $ws2; exec $term -e fish -c 'tmux-attach fortnite'
|
||||
bindsym Control+Shift+F2 workspace $ws2; exec $term -e fish -c 'tmux-attach red-hat-2'
|
||||
bindsym $mod+Shift+F2 workspace $ws2; exec $term -e mosh kmok@192.168.0.1$wl_ip_nast_num -- tmux a -t nzxt-2
|
||||
bindsym $mod+Shift+F2 workspace $ws2; exec $term -e mosh kmok@$work_laptop_ip -- tmux a -t nzxt-2
|
||||
|
||||
# ws3 [[[ #
|
||||
|
||||
@@ -356,6 +363,7 @@ set $ws4 "4 "
|
||||
workspace $ws4 output $secondary
|
||||
bindsym $mod+F4 workspace $ws4; exec $term
|
||||
bindsym Mod4+$mod+F4 workspace $ws4; exec urxvt -e ranger $screenshot_folder
|
||||
bindsym Mod4+e workspace $ws4; exec libreoffice ~/Documents/expenses/investments.ods
|
||||
|
||||
# ws5 [[[ #
|
||||
|
||||
@@ -399,8 +407,8 @@ bindsym Mod4+$mod+d workspace $ws6; exec discord
|
||||
# bindsym Mod4+d workspace $ws6; exec firefox --new-window https://discordapp.com/channels/430798446723727367/443950744996020228
|
||||
# bindsym Mod4+i workspace $ws6; exec firefox -new-window https://riot.im/app
|
||||
bindsym Mod4+k workspace $ws6; exec slack
|
||||
# bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'mosh kmok@192.168.0.1$wl_ip_nast_num -- tmux a -t weechat'
|
||||
bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'mosh kmok@192.168.0.1$wl_ip_nast_num -- tmux a -t weechat'
|
||||
# bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'mosh kmok@$work_laptop_ip -- tmux a -t weechat'
|
||||
bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'mosh kmok@$work_laptop_ip -- tmux a -t weechat'
|
||||
# bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'tmux-attach weechat'
|
||||
|
||||
# ]]] ws6 #
|
||||
@@ -408,7 +416,7 @@ bindsym Mod4+i workspace $ws6; exec $term -e fish -c 'mosh kmok@192.168.0.1$wl_i
|
||||
set $ws7 "7 "
|
||||
workspace $ws7 output $secondary
|
||||
# bindsym $mod+F7 workspace $ws7; exec $term
|
||||
bindsym $mod+F7 workspace $ws7; exec $term -e mosh kmok@192.168.0.1$wl_ip_nast_num -- tmux a -t nzxt
|
||||
bindsym $mod+F7 workspace $ws7; exec $term -e mosh kmok@$work_laptop_ip -- tmux a -t nzxt
|
||||
bindsym Mod4+$mod+F7 workspace $ws7; exec $term -e mosh --ssh='ssh -p 399' kevin@165.22.239.234 tmux a
|
||||
bindsym Mod4+a workspace $ws7; exec android-file-transfer
|
||||
# bindsym Mod4+v workspace $ws7; exec VBoxManage startvm "369-a1"
|
||||
@@ -419,7 +427,8 @@ workspace $ws8 output $secondary
|
||||
# bindsym $mod+F8 workspace $ws8; exec $term
|
||||
# bindsym $mod+F8 workspace $ws8; exec $term -e tmux a -t journal
|
||||
bindsym $mod+F8 workspace $ws8; exec $term -e fish -c 'tmux-attach journal'
|
||||
bindsym Mod4+$mod+F8 workspace $ws8; exec libreoffice ~/Documents/red-hat/workday.ods
|
||||
bindsym Mod4+$mod+F8 workspace $ws8; exec libreoffice ~/Documents/sit-stand/sit-stand.ods
|
||||
bindsym $mod+Shift+F8 workspace $ws8; exec libreoffice ~/Documents/red-hat/workday.ods
|
||||
|
||||
set $ws9 "9 "
|
||||
workspace $ws9 output $secondary
|
||||
@@ -436,13 +445,15 @@ set $hp 2
|
||||
bindsym Mod4+v workspace $ws10; exec $term -e alsamixer -c 1
|
||||
# bindsym Mod4+$mod+c workspace $ws10; exec $term -e cava
|
||||
# bindsym Mod4+h workspace $ws10; exec $term -e alsamixer -c $hp
|
||||
bindsym Mod4+s workspace $ws10; exec spotify
|
||||
bindsym Mod4+s workspace $ws10; exec ~/scripts/spotify-clean
|
||||
|
||||
set $ws11 "11 "
|
||||
# set $ws11 "11 📊"
|
||||
# assign [class="Summoners War Exporter"] $ws11
|
||||
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 Mod4+$mod+F11 workspace $ws11; exec $term -e fish -c 'tmux-attach obs'
|
||||
# bindsym $mod+F11 workspace $ws11; exec $term -e gotop -m
|
||||
# bindsym Mod4+a workspace $ws11; exec antimicro
|
||||
|
||||
|
||||
@@ -11,17 +11,48 @@ markup=pango
|
||||
color=#cbe4ff
|
||||
# ]]] Global properties #
|
||||
|
||||
# [ticker]
|
||||
# label=$
|
||||
# TICKER=GME
|
||||
# interval=30
|
||||
# # interval=10
|
||||
|
||||
# sys.monitoring [[[ #
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
[cpu_usage]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
[memory]
|
||||
label=
|
||||
# color=#3da061
|
||||
interval=5
|
||||
{{ end }}
|
||||
|
||||
# ]]] sys.monitoring #
|
||||
|
||||
# volume/spotify [[[ #
|
||||
|
||||
# [spotify]
|
||||
# # command=python ~/linux-config/configs/i3blocks-scripts/spotify.py
|
||||
# # label=
|
||||
# label=
|
||||
# # label=🎧
|
||||
# # green
|
||||
# # color=#198c19
|
||||
# # aqua
|
||||
# # color=#2d7272
|
||||
# interval=5
|
||||
|
||||
[spotify]
|
||||
# command=python ~/linux-config/configs/i3blocks-scripts/spotify.py
|
||||
# label=
|
||||
label=
|
||||
# label=🎧
|
||||
# green
|
||||
# color=#198c19
|
||||
# aqua
|
||||
# color=#2d7272
|
||||
LONG_NAME=
|
||||
SHORT_NAME=
|
||||
interval=5
|
||||
|
||||
[volume]
|
||||
@@ -36,11 +67,12 @@ interval=60
|
||||
[calendar]
|
||||
interval=30
|
||||
label=
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
DATEFMT=+%H:%M.%a-%m-%d
|
||||
{{ else }}
|
||||
# {{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
# DATEFMT=+%H:%M.%a-%m-%d
|
||||
# {{ else }}
|
||||
# DATEFMT=+%H:%M
|
||||
# {{ end }}
|
||||
DATEFMT=+%H:%M
|
||||
{{ end }}
|
||||
# SHORTFMT=+%H:%M:%S
|
||||
SHORTFMT=+%H:%M.%a-%m-%d
|
||||
HEIGHT=180
|
||||
@@ -49,9 +81,9 @@ WIDTH=220
|
||||
# ]]] time #
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
# [temperature]
|
||||
# label=
|
||||
# interval=5
|
||||
|
||||
[name]
|
||||
label=
|
||||
|
||||
@@ -13,6 +13,25 @@ color=#cbe4ff
|
||||
|
||||
# ]]] global #
|
||||
|
||||
# ticker [[[ #
|
||||
|
||||
# [ticker]
|
||||
# label=PEJ
|
||||
# TICKER=PEJ
|
||||
# interval=30
|
||||
|
||||
[ticker]
|
||||
label=ADA
|
||||
TICKER=ADA-USD
|
||||
interval=30
|
||||
|
||||
[ticker]
|
||||
label=DAQ
|
||||
TICKER=^IXIC
|
||||
interval=30
|
||||
|
||||
# ]]] ticker #
|
||||
|
||||
# volume/spotify [[[ #
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
@@ -21,10 +40,21 @@ interval=once
|
||||
signal=1
|
||||
interval=60
|
||||
|
||||
# [spotify]
|
||||
# label=
|
||||
# LONG_NAME=
|
||||
# SHORT_NAME=
|
||||
# interval=5
|
||||
|
||||
[spotify]
|
||||
# command=python ~/linux-config/configs/i3blocks-scripts/spotify.py
|
||||
# label=
|
||||
label=
|
||||
LONG_NAME=
|
||||
SHORT_NAME=
|
||||
# label=🎧
|
||||
# green
|
||||
# color=#198c19
|
||||
# aqua
|
||||
# color=#2d7272
|
||||
interval=5
|
||||
{{ end }}
|
||||
|
||||
@@ -47,6 +77,13 @@ label=
|
||||
interval=5
|
||||
{{ end }}
|
||||
|
||||
# {{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
# [wifi]
|
||||
# label=
|
||||
# instance=wlp4s0
|
||||
# interval=10
|
||||
# {{ end }}
|
||||
|
||||
# ]]] laptop #
|
||||
|
||||
# time [[[ #
|
||||
@@ -54,11 +91,12 @@ interval=5
|
||||
[calendar]
|
||||
interval=30
|
||||
label=
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
DATEFMT=+%H:%M
|
||||
{{ else }}
|
||||
# {{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
# DATEFMT=+%H:%M
|
||||
# {{ else }}
|
||||
# DATEFMT=+%H:%M.%a-%m-%d
|
||||
# {{ end }}
|
||||
DATEFMT=+%H:%M.%a-%m-%d
|
||||
{{ end }}
|
||||
# SHORTFMT=+%H:%M:%S
|
||||
HEIGHT=180
|
||||
WIDTH=220
|
||||
@@ -68,31 +106,19 @@ WIDTH=220
|
||||
# sys.monitoring [[[ #
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
# [wifi]
|
||||
# label=
|
||||
# instance=wlp4s0
|
||||
# interval=10
|
||||
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
# unbold this?
|
||||
# [load_average]
|
||||
# label=
|
||||
# [temperature]
|
||||
# label=
|
||||
# interval=5
|
||||
# color=#990000
|
||||
{{ end }}
|
||||
|
||||
[cpu_usage]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
[memory]
|
||||
label=
|
||||
# color=#3da061
|
||||
interval=5
|
||||
# [cpu_usage]
|
||||
# label=
|
||||
# interval=5
|
||||
|
||||
# [memory]
|
||||
# label=
|
||||
# # color=#3da061
|
||||
# interval=5
|
||||
|
||||
# ]]] sys.monitoring #
|
||||
|
||||
|
||||
5
dot_config/i3blocks/scripts/executable_ticker
Executable file
5
dot_config/i3blocks/scripts/executable_ticker
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
ticker=$(~/scripts/ticker $TICKER)
|
||||
printf "%s\n\n%s\n" "$ticker" "$color7"
|
||||
@@ -32,7 +32,8 @@ SCONTROL=${SCONTROL:-""}
|
||||
|
||||
# }}} default vars #
|
||||
|
||||
AUDIO_DELTA=${AUDIO_DELTA:-5}
|
||||
AUDIO_DELTA=${AUDIO_DELTA:-3}
|
||||
# AUDIO_DELTA=${AUDIO_DELTA:-2}
|
||||
# AUDIO_DELTA=${AUDIO_DELTA:-1}
|
||||
|
||||
# LONG_FORMAT=${LONG_FORMAT:-'${SYMB} ${VOL}% [${INDEX}:${NAME}]'}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||
# echo $INTERFACE
|
||||
# INTERFACE="${INSTANCE}"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
@@ -29,7 +28,7 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||
QUALITY=$(sudo grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||
# echo $QUALITY
|
||||
W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':')
|
||||
W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')
|
||||
|
||||
@@ -53,7 +53,7 @@ urgency.due.coefficient=18
|
||||
urgency.user.project.codm.coefficient=2
|
||||
urgency.user.project.crim.coefficient=1
|
||||
urgency.user.project.fn.coefficient=5
|
||||
urgency.user.project.mny.coefficient=7
|
||||
urgency.user.project.mny.coefficient=10
|
||||
urgency.user.project.ms.coefficient=3
|
||||
urgency.user.project.pey.coefficient=10
|
||||
urgency.user.project.pogo.coefficient=7
|
||||
@@ -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 #
|
||||
|
||||
@@ -389,7 +389,8 @@ nnoremap <leader>dg ggdG
|
||||
" delete entire line
|
||||
nnoremap <leader>dl 0d$
|
||||
" delete lines matching pattern
|
||||
nnoremap <leader>dls :g//d<left><left>
|
||||
" nnoremap <leader>dls :g//d<left><left>
|
||||
nnoremap <leader>dls q:ig//d<left><left>
|
||||
" show docstring for cur word
|
||||
nnoremap <leader>do :YcmCompleter GetDoc<CR>
|
||||
" delete line into system clipboard
|
||||
@@ -417,6 +418,7 @@ nnoremap <leader>gb :Git blame<CR>
|
||||
nnoremap <leader>gd :Gvdiff
|
||||
nnoremap <leader>gdh :Gvdiff HEAD^
|
||||
nnoremap <leader>gdm :Gvdiff master<CR>
|
||||
nnoremap <leader>gdo :Gvdiff orig/master<CR>
|
||||
" toggle search highlighting
|
||||
nnoremap <leader>h :set hlsearch! hlsearch?<CR>
|
||||
" help
|
||||
@@ -424,9 +426,13 @@ nnoremap <leader>he :vert help
|
||||
nnoremap <leader>ht :set tabstop=2 shiftwidth=2 expandtab<CR>
|
||||
nnoremap <leader>vhe :vert help
|
||||
" don't add space when joining lines "
|
||||
nnoremap <leader>j gJ
|
||||
" nnoremap <leader>j gJ
|
||||
" jump forward
|
||||
nnoremap <leader>j <C-I>
|
||||
" join all paragraphs into single line "
|
||||
nnoremap <leader>jl :set tw=9999999<CR>gggqG
|
||||
" jump back
|
||||
nnoremap <leader>k <C-O>
|
||||
" format current line
|
||||
nnoremap <leader>l Vgq
|
||||
" format this and next line
|
||||
@@ -605,6 +611,7 @@ autocmd Filetype markdown nnoremap <localleader>x 0f[lrx
|
||||
autocmd Filetype go nnoremap <localleader>f :GoTestFunc<CR>
|
||||
autocmd Filetype go nnoremap <localleader>l :GoLint<CR>
|
||||
autocmd Filetype go nnoremap <localleader>m :GoTests<CR>
|
||||
autocmd Filetype go nnoremap <localleader>r yawq:iGoRename <Esc>p
|
||||
autocmd Filetype go nnoremap <localleader>t :GoTest<CR>
|
||||
|
||||
autocmd Filetype go-template inoremap <localleader>e {{"{{ else }}"}}
|
||||
|
||||
3
scripts/executable_spotify-clean
Normal file
3
scripts/executable_spotify-clean
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/dash
|
||||
|
||||
sqlite3 ~/.cache/spotify/mercury.db 'VACUUM;' && spotify
|
||||
97
scripts/executable_ticker
Executable file
97
scripts/executable_ticker
Executable file
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
LANG=C
|
||||
LC_NUMERIC=C
|
||||
|
||||
SYMBOLS=("$@")
|
||||
|
||||
if ! $(type jq > /dev/null 2>&1); then
|
||||
echo "'jq' is not in the PATH. (See: https://stedolan.github.io/jq/)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$SYMBOLS" ]; then
|
||||
echo "Usage: ./ticker.sh AAPL MSFT GOOG BTC-USD"
|
||||
exit
|
||||
fi
|
||||
|
||||
FIELDS=(symbol marketState regularMarketPrice regularMarketChange regularMarketChangePercent \
|
||||
preMarketPrice preMarketChange preMarketChangePercent postMarketPrice postMarketChange postMarketChangePercent)
|
||||
API_ENDPOINT="https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US®ion=US&corsDomain=finance.yahoo.com"
|
||||
|
||||
if [ -z "$NO_COLOR" ]; then
|
||||
: "${COLOR_BOLD:=\e[1;37m}"
|
||||
: "${COLOR_GREEN:=\e[32m}"
|
||||
: "${COLOR_RED:=\e[31m}"
|
||||
: "${COLOR_RESET:=\e[00m}"
|
||||
fi
|
||||
|
||||
symbols=$(IFS=,; echo "${SYMBOLS[*]}")
|
||||
fields=$(IFS=,; echo "${FIELDS[*]}")
|
||||
|
||||
results=$(curl --silent "$API_ENDPOINT&fields=$fields&symbols=$symbols" \
|
||||
| jq '.quoteResponse .result')
|
||||
|
||||
query () {
|
||||
echo $results | jq -r ".[] | select(.symbol == \"$1\") | .$2"
|
||||
}
|
||||
|
||||
for symbol in $(IFS=' '; echo "${SYMBOLS[*]}" | tr '[:lower:]' '[:upper:]'); do
|
||||
marketState="$(query $symbol 'marketState')"
|
||||
|
||||
if [ -z $marketState ]; then
|
||||
printf 'No results for symbol "%s"\n' $symbol
|
||||
continue
|
||||
fi
|
||||
|
||||
preMarketChange="$(query $symbol 'preMarketChange')"
|
||||
postMarketChange="$(query $symbol 'postMarketChange')"
|
||||
|
||||
if [ $marketState == "PRE" ] \
|
||||
&& [ $preMarketChange != "0" ] \
|
||||
&& [ $preMarketChange != "null" ]; then
|
||||
nonRegularMarketSign='*'
|
||||
price=$(query $symbol 'preMarketPrice')
|
||||
diff=$preMarketChange
|
||||
percent=$(query $symbol 'preMarketChangePercent')
|
||||
elif [ $marketState != "REGULAR" ] \
|
||||
&& [ $postMarketChange != "0" ] \
|
||||
&& [ $postMarketChange != "null" ]; then
|
||||
nonRegularMarketSign='*'
|
||||
price=$(query $symbol 'postMarketPrice')
|
||||
diff=$postMarketChange
|
||||
percent=$(query $symbol 'postMarketChangePercent')
|
||||
else
|
||||
nonRegularMarketSign=''
|
||||
price=$(query $symbol 'regularMarketPrice')
|
||||
diff=$(query $symbol 'regularMarketChange')
|
||||
percent=$(query $symbol 'regularMarketChangePercent')
|
||||
fi
|
||||
|
||||
if [ "$diff" == "0" ]; then
|
||||
color=
|
||||
elif ( echo "$diff" | grep -q ^- ); then
|
||||
color=$COLOR_RED
|
||||
else
|
||||
color=$COLOR_GREEN
|
||||
fi
|
||||
|
||||
if [ "$price" != "null" ]; then
|
||||
# printf "%-10s$COLOR_BOLD%8.2f$COLOR_RESET" $symbol $price
|
||||
# printf "$color%10.2f%12s$COLOR_RESET" $diff $(printf "(%.2f%%)" $percent)
|
||||
# printf " %s\n" "$nonRegularMarketSign"
|
||||
# echo \$$price
|
||||
# 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"
|
||||
else
|
||||
printf "%0.2f\n" $price
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user