No Description

ohnonot 374fd66fc1 replaced ${catp ...} with ${execp cat ...} because issue #1 (and some more small changes) 1 month ago
config 114ee764bb Major Overhaul Part II 8 months ago
img e02508a102 major overhaul part I 8 months ago
myconfig 114ee764bb Major Overhaul Part II 8 months ago
scripts 374fd66fc1 replaced ${catp ...} with ${execp cat ...} because issue #1 (and some more small changes) 1 month ago
.gitignore 114ee764bb Major Overhaul Part II 8 months ago
LICENSE 766629c59f added gpl 3 years ago
README.md 374fd66fc1 replaced ${catp ...} with ${execp cat ...} because issue #1 (and some more small changes) 1 month ago
changelog 1907959a5c narrative 1 year ago
conky-itlv-toggle.lua 374fd66fc1 replaced ${catp ...} with ${execp cat ...} because issue #1 (and some more small changes) 1 month ago
conky-itlv.lua 374fd66fc1 replaced ${catp ...} with ${execp cat ...} because issue #1 (and some more small changes) 1 month ago
geticons.sh e02508a102 major overhaul part I 8 months ago
startconky 114ee764bb Major Overhaul Part II 8 months ago

README.md

Get a weather forecast from the Finnish Meteorological Institute.

It provides forecasts from all over the world in English, Swedish and Finnish language. The forecasts are most precise for Finland and surrounding countries.

The scripts in this repository will

  • download forecast information for a given location
  • format it according to configuration settings
  • display it in a conky either on your dektop or in a separate window (to be executed by a hotkey or menu icon)

Installation

There's no installation as such. Clone the repository or download the zip (also from here) to a folder of your choice. Keep in mind that all files need to stay together.

Because I am unsure about licensing issues, weather icons are not included. Please run the script ./geticons.sh from the repo's base directory; this will download the icons from the website, then convert and save them to the appropriate folders to become usable by the script.
The icons are in vector fromat and need to be converted to PNG for conky to be able to use them. For that, you need imagemagick's convert command.

Quickstart

  • Copy one of the configuration files from the config directory to the myconfig directory.
  • Open it and edit some values to your liking, esp. the URL I suppose.
  • from the repository's base directory issue e.g.
    ./startconky myconfig/default.cfg
    or use the absolute path from anywhere else:
    /absolute/path/to/conky-itl-weather/startconky myconfig/default.cfg
    (you could add this command to your desktop environment's startup applications).

Note: the path to the configuratioon file is relative to the repository's base directory where startconky is located!

Hard Dependencies

  • bash - yes, the various scripts make use of many bash-specific things, particularly associative arrays.
  • wget to get the web page.
  • xmllint (package libxml2 or libxml2-utils) to parse the web page.
  • sed to further parse the output
  • the coreutils package

Soft Dependencies

  • conky - if you're unsure, look out for a package named conky-all. I list this under Soft Dependencies because the script itself runs well without conky; its plain text output (a configurable option) can be used elsewhere.
    • the "DejaVu Sans" font, available through most ditributions' package management. I list this as a dependency because the conky layout easily breaks when changing fonts. But there are much nicer fonts out there and I recommend taking the effort to change that.
  • for ./startconky:
    • ping to make sure the server can be reached
    • for --toggle or --reload:
      • basic functionality: xprop wmctrl pgrep pkill
      • replace window icon with a forecast icon: xseticon convert (convert is part of imagemagick)
  • for ./geticons.sh to convert icons to PNG: convert (convert is part of imagemagick)

Usage & Configuration

./startconky will start a conky that executes a shell script.
The shell script looks at your configurations, parses the web page, and produces conky-readable output.
The conky then reads that output, parses it according to conky rules, and displays it.
This process is repeated every 10 minutes or so.

If you don't know conky, check this out first.
This README cannot cover all conky-related topics relevant to this repository.

If you want to run the conky on-demand in its own window, instead of the desktop, you can try the --toggle or --reload option:

./startconky --toggle myconfig/anyname.cfg
./startconky --reload myconfig/anyname.cfg

In this case the path to the configuration file (always relative to the repositories base directory whre startconky is located!) becomes the second argument to the startconky command.

Some configurations are provided. If you want to modify them, pease copy them to the myconfig folder first, or create a new file in that directory.
Unspecified or commented variables continue to use default values.
The syntax is key = value. Spaces around = are optional, both single and double quotes around values are possible.

Most configuration happens inside the shell script (and your personal configuration), but it is still likely that you will need to edit the conky configs conky-itlv.lua or conky-itlv-toggle.lua. The recommended method is to copy the file to the myconfig folder while keeping its name intact, and edit that copy (the startconky script will look there first).

The startconky command can always be called with an absolute path (see Quickstart).

If you choose to clone with git, and keep all modifications to the myconfig folder, you can update the repository with

git pull

issued from the repository's base directory.

If you still experience problems:

  • You might want to create your own config file, overriding more default settings. The file config/defaults.cfg should always contain a well-commented full list of configurable options with their default values.
  • depending on your desktop environment, you might want to change the own_window_* values in conky-itlv, especially if you use a desktop manager (the software that puts icons on your desktop).
  • make sure the shell scripts itl.sh and startconky are executable: chmod -x itl.sh startconky (this normally shouldn't be an issue).
  • conky doesn't necessarily show anything first time you start it. You might have to wait until it downloads and parses the first weather info.
    However, it should update after 10 seconds.
  • Have a look at data/itl.sh.logfile for clues or contact the developer.

There's more explanation in all files.

Why not use one of the existing, much better looking Weather Conkys out there?

I am not a conky desktop widget designer. I am aware that there are much better-looking weather conkys out there.

In fact, I wouldn't recommend using this if you don't live in Northern Europe.

The reason I maintain this repository is because I use it, and the reason I use it is because I believe that a locally retrieved weather forecast is always superior to one retrieved from a large international website somewhere halfway around the globe.

I am trying as far as possible to mirror the website's way of displaying information, except for turning it 90 degrees. It might differ from what most people accept as a simple weather forecast design, but it has more granularity and more objectivity (except for the seemingly ubiquitous "Feels Like" temperature). I do not want to depend solely on what some website considers the best way to describe the weather for the whole day; on my weather conky I can see much more data and apply my own interpretation.

Some words about conky

"conky is a strange beast" i read somewhere. It can do nice things to your desktop and, used properly, it's extremely lightweight. But sometimes it behaves unexpectedly. Usually, once you have it set up, it runs stable, but the tweaking can be nerve-wrecking.

Changing the font will most probably mess up the layout, but you can fix most of it by adjusting vertical offset in your configuration (lineheight).

Tested on

  • archlinux (simple openbox, no desktop manager)... erm. Yes, I should do more distro testing.
  • GNU bash, whichever version is current on archlinux. Currently 5.0.x, But I am pretty sure it runs on all 4.x versions, too.
  • conky: 1.10.x, 1.11.x

Everything has been tested, but always something unpredictable can happen. If you encounter an error and want to help develop this script, please write to
this forum thread or this finnish forum thread or raise an issue.
Thanks!


Happy customizing and don't forget to look out the window sometimes!