From 77f3d8adc39fdefaaa18df1a0c25c369e7198b10 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 19 Apr 2023 18:13:32 +0300 Subject: [PATCH] add city to arguments --- README.md | 2 +- earth_wallpaper.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index df1f46d..51be766 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/earth_wallpaper.sh b/earth_wallpaper.sh index 7d21785..8bf88fe 100755 --- a/earth_wallpaper.sh +++ b/earth_wallpaper.sh @@ -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