Update readme and add package installation

This commit is contained in:
Antonio J. Delgado 2023-04-19 17:59:11 +03:00
parent 074e8e4764
commit c353c5892f
2 changed files with 24 additions and 1 deletions

View file

@ -1 +1,15 @@
## earth_wallpaper ## 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
```

View file

@ -120,7 +120,16 @@ temperature=$("${wget_cmd}" -q -O - "$weather_url" | egrep -o "<temp_c>-?[0-9]*\
text="Image from $cur_date at $time\n$city $temperatureº C" text="Image from $cur_date at $time\n$city $temperatureº C"
convert_cmd=$(which convert) convert_cmd=$(which convert)
if [ ! -x "${convert_cmd}" ]; then 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 fi
run_and_log "${convert_cmd}" $wallpaper_file -pointsize 50 -font "${font_name}" -fill "#505050" -gravity SouthEast -annotate +0+0 "$text" $wallpaper_file run_and_log "${convert_cmd}" $wallpaper_file -pointsize 50 -font "${font_name}" -fill "#505050" -gravity SouthEast -annotate +0+0 "$text" $wallpaper_file
error_code=$? error_code=$?