add city to arguments

This commit is contained in:
Antonio J. Delgado 2023-04-19 18:13:32 +03:00
parent c73fd6c1ce
commit 77f3d8adc3
2 changed files with 6 additions and 2 deletions

View file

@ -11,5 +11,5 @@ Tested with XFCE4 and Gnome 2. Problems with Gnome >3.
### Usage
```bash
earth_wallpaper.sh Tampere
earth_wallpaper.sh --city Tampere
```

View file

@ -49,6 +49,11 @@ font_name=$("${gsettings_cmd}" get org.gnome.desktop.interface font-name | sed "
while [ $# -gt 0 ]
do
case "$1" in
"--city")
shift
city="${1}"
shift
;;
"--wallpaper-file")
shift
wallpaper_file="${1}"
@ -96,7 +101,6 @@ if [ -z ${curl_cmd} ]; then
exit 3
fi
city="$1"
if [[ -z ${city} ]]; then
echo "You must indicate a city to center the image."
exit 4