Browse Source

added config inside of the script, made seprate install script.

master
Thomas Lapoint 7 months ago
parent
commit
9c4b56744c
3 changed files with 30 additions and 26 deletions
  1. +15
    -17
      README.md
  2. +3
    -0
      install.sh
  3. +12
    -9
      radar

+ 15
- 17
README.md View File

@ -12,26 +12,24 @@ cURL
nomacs (or your photo veiwer of choice)
## arguments
```
$ radar
```
currently does nothing.
```
$ radar list
## install
this is a portable script, but the instructions below shows how to configure the script and add it to your PATH.
```bash
# clone repo
$ git clone https://gitlab.com/im-down/radar.git
# cd into folder
$ cd radar
# edit lines 4 and 5 of the script to your liking
$ (your editor) radar
# run install script (verify the install script if you do not trust it)
$ sudo bash install.sh
```
lists all areas to choose from (ex. MOB)
```
$ radar MOB
```
loads radar from area "MOB"
## to-do
~~make city/area selection~~ (done!)
default city/area
~~default city/area~~ (done!)
"config file" (default city/image veiwer)

+ 3
- 0
install.sh View File

@ -0,0 +1,3 @@
#!/bin/bash
sudo cp radar /usr/bin/
echo "installed. you can find the script at /usr/bin/radar"

+ 12
- 9
radar View File

@ -1,16 +1,19 @@
#!/bin/bash
#!/bin/sh
default="EVX"
# 'default' string is unused right now. might do defaults with a small config file...
# CONFIG
default_area="EVX" # default city/area to use if none is specified
default_viewer="nomacs" # default image veiwer (change reccomended)
if [ "$1" == list ]; then
# ----------------------------
if [ "$1" = list ]; then
curl https://pastebin.com/raw/S7QdSXMi
printf "\n"
elif [ -z "$1" ]; then
echo "no area selected, run 'radar list' to list areas."
wget https://radar.weather.gov/lite/N0R/"$default_area"_loop.gif
"$default_viewer" "$default_area"_loop.gif
rm -f "$default_area"_loop.gif
elif [ "$1" != list ]; then
wget https://radar.weather.gov/lite/N0R/$1_loop.gif
# this script uses 'nomacs' for image veiwing, but you can change it to whatever image veiwer you use.
nomacs $1_loop.gif
rm -f $1_loop.gif
wget https://radar.weather.gov/lite/N0R/"$1"_loop.gif
"$default_viewer" "$1"_loop.gif
rm -f "$1"_loop.gif
fi

Loading…
Cancel
Save