Browse Source

Merge pull request #18 from bdealbuquerque/create_dwm_currency_sh

Create dwm currency sh
main
Joe Standring 4 years ago
committed by GitHub
parent
commit
eeeab403e9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions
  1. +8
    -0
      README.md
  2. +23
    -0
      bar-functions/dwm_currency.sh
  3. +2
    -0
      dwm_bar.sh

+ 8
- 0
README.md View File

@ -25,6 +25,7 @@ A modular statusbar for dwm
- [dwm_backlight](#dwm_backlight)
- [dwm_connman](#dwm_connman)
- [dwm_loadavg](#dwm_loadavg)
- [dwm_currency](#dwm_currency)
- [dwm_solar_panel(#dwm_solar_panel)
- [Installation](#installation)
- [Reccomendations](#reccomendations)
@ -162,6 +163,13 @@ Displays how much power is being produced from your solar panels
```
[💡 3.012 W ]
```
### dwm_currency
Displays the current rate of your currency in comparison to the USD provided by [rate.sx](http://rate.sx/)
```
[💡 1.225 ]
```
Dependencies: ```curl```
## Installation
1. Clone and enter the repository:
```


+ 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