diff --git a/README.md b/README.md index bbf5a6e..df1f46d 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ ## earth_wallpaper + +### Description + +Obtain an image of the planet earth centered over a city, with the night shadow according to the current time and overlay information about temperature and time. + + +### Requirements + +Tested with XFCE4 and Gnome 2. Problems with Gnome >3. +### Usage + +```bash +earth_wallpaper.sh Tampere +``` diff --git a/earth_wallpaper.sh b/earth_wallpaper.sh index 0ef240e..c16f75a 100755 --- a/earth_wallpaper.sh +++ b/earth_wallpaper.sh @@ -120,7 +120,16 @@ temperature=$("${wget_cmd}" -q -O - "$weather_url" | egrep -o "-?[0-9]*\ text="Image from $cur_date at $time\n$city $temperatureº C" convert_cmd=$(which convert) if [ ! -x "${convert_cmd}" ]; then - apt install imagemagick + if [ "$(which apt)" != "" ]; then + apt install imagemagick + elif [ "$(which yum)" != "" ]; then + yum install imagemagick + elif [ "${which pacman}" != "" ]; then + pacman -S imagemagick + else + message "Install imagemagick using your package manager." p + exit 1 + fi fi run_and_log "${convert_cmd}" $wallpaper_file -pointsize 50 -font "${font_name}" -fill "#505050" -gravity SouthEast -annotate +0+0 "$text" $wallpaper_file error_code=$?