Compare commits

...

2 Commits

Author SHA1 Message Date
Felipe M 9f2dd51264
Updated antigen to use system one 2021-02-02 15:47:56 +01:00
Felipe M 6cc138acc6
Updated swaybar script 2021-02-02 15:47:47 +01:00
2 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,8 @@
#!/bin/bash
# vim: ts=4
source $HOME/.secrets/finnhub
function getPowerValue() {
POWER=$(cat /sys/class/power_supply/BAT0/capacity)%
echo $POWER
@ -23,8 +25,16 @@ function getVolume() {
echo $(amixer get Master | grep 'Left:' | awk -F"[][]" '{ print $2 }')
}
function getStock() {
curl -s "https://finnhub.io/api/v1/quote?symbol=$1&token=$SECRET_FINNHUB_TOKEN" | jq ".c"
}
function getNextEvent() {
khal list now -df "" | grep -v "^ " | head -n 1
}
while [ True ]; do
echo "$(getVolume) | $(getPowerValue)$(getPowerStatus) | $(getDate)"
echo "$(getNextEvent) | $(getStock AMC) . $(getStock GME) | $(getVolume) | $(getPowerValue)$(getPowerStatus) | $(getDate)"
sleep 30
done

2
.zshrc
View File

@ -28,7 +28,7 @@ export PATH=$PATH:$HOME/.local/bin
# Editor
export EDITOR=nvim
source ~/.antigen.zsh
source /usr/share/zsh/share/antigen.zsh
antigen use oh-my-zsh