Updated swaybar script
This commit is contained in:
parent
eba8d60086
commit
6cc138acc6
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# vim: ts=4
|
# vim: ts=4
|
||||||
|
|
||||||
|
source $HOME/.secrets/finnhub
|
||||||
|
|
||||||
function getPowerValue() {
|
function getPowerValue() {
|
||||||
POWER=$(cat /sys/class/power_supply/BAT0/capacity)%
|
POWER=$(cat /sys/class/power_supply/BAT0/capacity)%
|
||||||
echo $POWER
|
echo $POWER
|
||||||
|
@ -23,8 +25,16 @@ function getVolume() {
|
||||||
echo $(amixer get Master | grep 'Left:' | awk -F"[][]" '{ print $2 }')
|
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
|
while [ True ]; do
|
||||||
echo "$(getVolume) | $(getPowerValue)$(getPowerStatus) | $(getDate)"
|
echo "$(getNextEvent) | $(getStock AMC) . $(getStock GME) | $(getVolume) | $(getPowerValue)$(getPowerStatus) | $(getDate)"
|
||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue