Browse Source

Created dwm_currency.sh, dwm_bar.sh edited accordingly

patch-fontkeys
Brayan 3 years ago
parent
commit
e8273b726c
2 changed files with 25 additions and 0 deletions
  1. +23
    -0
      bar-functions/dwm_currency.sh
  2. +2
    -0
      dwm_bar.sh

+ 23
- 0
bar-functions/dwm_currency.sh View File

@ -0,0 +1,23 @@
#!/bin/sh
# A dwm_bar function to print the rate of CURRENCY/USD from rate.sx using rate.sx/1CURRENCY
# Creator of the project: Joe Standring <git@joestandring.com>
# Additional plugin added by Brayan de Albuquerque <brayandealbuquerque@gmail.com>
# GNU GPLv3
# Dependencies: curl
# Change the value of CURRENCY to match your currency code
dwm_currency() {
CURRENCY=EUR
printf "%s" "$SEP1"
if [ "$IDENTIFIER" = "unicode" ]; then
printf "%s" "$(curl -s rate.sx/1$CURRENCY)"
else
printf "%s %.5s" "$CURRENCY" "$(curl -s rate.sx/1$CURRENCY)"
fi
printf "%s\n" "$SEP2"
}
dwm_currency

+ 2
- 0
dwm_bar.sh View File

@ -42,6 +42,7 @@ export SEP2="]"
. "$DIR/bar-functions/dwm_date.sh"
. "$DIR/bar-functions/dwm_connman.sh"
. "$DIR/bar-functions/dwm_loadavg.sh"
. "$DIR/bar-functions/dwm_currency.sh"
# Update dwm status bar every second
while true
@ -69,6 +70,7 @@ do
dispstr="$dispstr$(dwm_ccurse)"
dispstr="$dispstr$(dwm_date)"
dispstr="$dispstr$(dwm_loadavg)"
dispstr="$dispstr$(dwm_currency)"
xsetroot -name "$dispstr"
sleep 1


Loading…
Cancel
Save