• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

icons/H11-Feb-2021-9,4718,309

panel-plugin/H11-Feb-2021-13,98311,119

po/H11-Feb-2021-99,34380,900

AUTHORSH A D23-Jun-2020278 88

COPYINGH A D11-Oct-201617.7 KiB340281

ChangeLogH A D11-Feb-2021639 KiB21,44913,338

INSTALLH A D11-Feb-202115.4 KiB369287

Makefile.amH A D11-Oct-2016852 3826

Makefile.inH A D11-Feb-202128.4 KiB927819

NEWSH A D11-Feb-202117.2 KiB385366

READMEH A D28-Jan-202125.6 KiB568469

TODOH A D11-Oct-2016898 2319

aclocal.m4H A D11-Feb-2021422.7 KiB11,85210,698

compileH A D11-Feb-20217.2 KiB349259

config.guessH A D11-Feb-202143.2 KiB1,4811,288

config.h.inH A D11-Feb-20212.9 KiB11275

config.subH A D11-Feb-202135.3 KiB1,8021,661

configureH A D11-Feb-2021539 KiB18,24015,206

configure.acH A D11-Feb-20214.1 KiB124108

depcompH A D11-Feb-202123 KiB792502

install-shH A D11-Feb-202115 KiB519337

intltool-extract.inH A D11-Feb-20210

intltool-merge.inH A D11-Feb-20210

intltool-update.inH A D11-Feb-20210

ltmain.shH A D11-Feb-2021319.6 KiB11,2528,044

missingH A D11-Feb-20216.7 KiB216143

mkinstalldirsH A D11-Feb-20213.5 KiB163112

README

1XFCE4-WEATHER-PLUGIN
2==========================================================================
3You can always find up-to-date information at the plugin homepage:
4https://docs.xfce.org/panel-plugins/xfce4-weather-plugin
5
6
7CONTENTS
8==========================================================================
9* ABOUT
10* USAGE
11* INFORMATION FOR PACKAGE MAINTAINERS AND DISTRIBUTORS
12* MET.NO API DOCUMENTATION
13* DEBUGGING AND REPORTING BUGS
14* REQUIREMENTS AND DEPENDENCIES
15* EASY BUILD INSTRUCTIONS
16* TRANSLATING THE PLUGIN FOR YOUR LANGUAGE
17* ICON THEMES
18* CACHING
19* HIDDEN OPTIONS
20
21
22ABOUT
23==========================================================================
24Originally written by Bob Schlärmann, this panel plugin shows
25information about your local weather in the panel, using forecast data
26provided by met.no.
27
28
29USAGE
30==========================================================================
31The first time you open the configuration dialog, the weather plugin
32automatically configures itself to fetch weather data from a place
33which should be near you - based on your IP address. It will also try
34to guess and setup your unit system according to the country code.
35
36You can change this location using the Change... button, and searching
37for the city, country, address, monument etc. you're interested
38in. Only latitude, longitude and altitude (the latter only matters
39outside of Norway) will be used for the data requests, so you can edit
40the location name to anything you like.
41
42Besides location parameters, the configuration dialog boasts a variety
43of other configuration options to alter the appearance of icons,
44tooltips and parts of the summary window. On the scrollbox tab you can
45choose and rearrange the values presented by the scrollbox.
46Middle-click on the font or color button unsets a previously set
47font or color.
48
49Tooltips give detailed information about nearly every widget of the
50configuration dialog and will tell you what a certain value
51(temperature, apparent temperature, wind,...) does and how it can be
52interpreted.
53
54On the panel icon, a middle click forces an update, left click brings
55up the so-called summary window with a forecast page that shows
56forecasts for the next few days and a details page with more
57information on the current and plugin data. Right-clicking opens the
58contextual menu with more actions.
59
60
61INFORMATION FOR PACKAGE MAINTAINERS AND DISTRIBUTORS
62==========================================================================
63If you're going to distribute this package, and legal concerns and
64principles allow you to do it, please be so kind and set the
65GEONAMES_USERNAME configure option for the GeoNames web service which
66is used for altitude and timezone detection. GeoNames requires one to
67register an account and limits requests on a per-hour and per-day
68basis to prevent misuse of their service. There are no other
69restrictions and registration is free, uncomplicated and takes less
70than a minute (https://www.geonames.org/export/web-services.html).
71Performing these steps will ensure automatic altitude and timezone
72detection are kept operational for all users of the plugin. Currently,
73it is no big deal and only a precaution, as there are likely not that
74many users setting up the plugin within the same hour and exhausting
75the credits. Still, if it is ok with you to register a username
76yourself for the users of your package, then it would certainly help
77should that unlikely case become true. While the user can also set
78this via a hidden option, the developer/maintainer of the plugin
79thinks the user should not be bothered with it, as every user would
80need to do it by default, and that would hurt user experience.
81
82
83MET.NO API DOCUMENTATION
84==========================================================================
85To get a quick overview, please consolidate the met.no API weather
86documentation and especially their FAQ, which answers some questions
87left open by the former:
88
89* General documentation and data licensing
90  https://api.met.no/weatherapi/documentation
91  https://api.met.no/faq.html
92  https://api.met.no/license_data.html
93
94* Service-specific documentation
95  https://api.met.no/weatherapi/locationforecast/2.0/documentation
96  https://api.met.no/weatherapi/sunrise/2.0/documentation
97
98For more technical details you might need to study the XML schema
99corresponding to the document in question.
100
101
102DEBUGGING AND REPORTING BUGS
103==========================================================================
104Before reporting bugs or asking for new features, please open
105an issue on https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin/
106and check the TODO file, because your issue or request might have been
107reported already or be in planning. However, feel free to add any
108information not yet mentioned that you find useful.
109
110First, if you're having trouble with downloading data, then you might
111look at the warnings in the panel output. In case of an error, the
112HTTP status code will be reported, along with a short text given the
113reason, as a result of a download request. It is easy to look up this
114code on the web to find more detailed information. Although if it is a
115download problem and your connection is ok, then most probably the
116service isn't available at the moment due to maintenance or a similar
117reason, so just wait some time and try later. Please do not report
118bugs about such problems.
119
120If you encounter problems like crashes or weird behaviour, it might
121prove insightful to enable panel debugging as follows:
122
1231) Quit the current running panel instance using 'xfce4-panel -q'.
1242) Set the PANEL_DEBUG environment variable to 'weather' or 'all':
125   export PANEL_DEBUG=weather
1263) Start the panel and let it write its output to a file, e.g.:
127   xfce4-panel > panel.log 2>&1 & disown
1284) Watch output using tail -f or less or whatever you like:
129   tail -f panel.log
130
131This will make the plugin explain what it's currently doing and dump
132data it downloaded from the various sources. More information about
133debugging panel plugins can be obtained from several pages of the Xfce
134Wiki at https://docs.xfce.org/xfce/xfce4-panel/debugging.
135
136It's also relatively easy and often very helpful to create a backtrace
137using gdb or any other debugger should the plugin crash:
138
1391) Find the process ID of the weather plugin with something like
140   'pgrep -f libweather.so'. Let's assume the resulting PID is 1234.
1412) Attach the GNU debugger to that process: 'gdb attach 1234'.
1423) The plugin will be frozen now. Tell the debugger to let it continue
143   with the 'cont' command.
1444) Produce the crash if possible, or wait until it crashes.
1455) GDB will detect the crash and freeze the plugin again. Use 'bt' to
146   print a nice backtrace. Report the issue to the Xfce bugtracker at
147   https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin,
148   providing the backtrace.
1496) 'quit' exits the debugger.
150
151
152BUILD REQUIREMENTS AND DEPENDENCIES
153==========================================================================
154To be able to build the plugin, the following requirements have to be
155met in addition to those of XFCE-4.14:
156
157* >=libxml-2.4.0
158* >=libsoup-2.42.0
159* >=upower-0.9.0 (optional)
160
161You might also need developer libraries necessary for building other
162parts of XFCE. Usually autogen.sh / configure will tell you, otherwise
163look at the XFCE build instructions https://docs.xfce.org/xfce/building
164and the release information https://wiki.xfce.org/releng/4.14/roadmap.
165
166
167EASY BUILD INSTRUCTIONS
168==========================================================================
169If you're interesting in building the plugin yourself, these
170instructions provided here will work for most users. If not, please
171look at the INSTALL file or ask at a forum for your linux distribution
172or try the methods explained on https://www.xfce.org/community. Make
173sure you have installed the needed dependencies (see previous section
174BUILD REQUIREMENTS AND DEPENDENCIES).
175
176For the panel being able to find the plugin, it is important to set
177the proper prefix. The prefix is the place in the filesystem where the
178plugin files gets installed. It has to match the prefix used for
179building the panel. There's nothing the plugin can do about that
180requirement. When you're using the panel provided by the package
181management system of your distribution, then the prefix is in most
182cases /usr, otherwise the default prefix is /usr/local.
183
184If you want to install the current version from git, execute the
185following command in the weather plugin project directory (make sure
186you have GNU automake installed!):
187
1881a) ./autogen.sh --prefix=/usr
189
190Otherwise, if you've downloaded the tarball from e.g.
191https://archive.xfce.org/, issue the following command:
192
1931b) ./configure --prefix=/usr
194
195If 1a) or 1b) fail, you should receive an error message telling you
196the cause for the failure (e.g. missings libraries). If you're missing
197a dependency you need to install it using the package management
198system of your distribution. Distributions commonly have two versions
199of a software package: One containing the supplementary files needed
200for compiling other packages (usually called "dev"-packages), and the
201other one providing the runtime libraries etc. While the latter is
202usually installed, the former often is not, so better check this.
203
204Note: To solve distribution-specific problems the most efficient way
205is to ask at a forum for your distribution, not on a general forum.
206
207Then for both cases:
2082) make
209
210If this fails, file a bug on
211https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin, or
212send a mail to the xfce mailing list and provide make output.
213
214Finally, and usually as root:
2153) make install
216
217Note: Depending on your prefix, this might overwrite an existing
218version of the plugin.
219
220You can later uninstall the plugin (as root) with
2214) make uninstall
222
223The panel should then recognize the new plugin, if it doesn't try to
224restart it using xfce4-panel -r. If it still doesn't work after that
225try to ask for help somewhere (forums, mailing lists, #xfce on
226IRC). Please do not report such problems on the bug tracker.
227
228
229TRANSLATING THE PLUGIN FOR YOUR LANGUAGE
230==========================================================================
231If you need help getting started with translating the weather plugin
232into your language, please visit https://translations.xfce.org/ and
233absorb the information that is there, especially on the *Help* page!
234There is other useful documentation available on this topic, try this
235wiki page for a start:
236https://wiki.xfce.org/translations/translation_guidance_in_xfce
237
238TRANSLATORS, PLEASE MAKE SURE YOU CHECK YOUR FILE FOR ERRORS BEFORE
239UPLOADING IT! Otherwise, it will break compilation of the plugin. It
240is easy to do this with the following command (where file.po is the po
241file of your language):
242msgfmt -c --check-accelerators=_ -v -o /dev/null <file.po>
243
244This plugin provides a lot of descriptions via the tooltips in the
245config dialog. These aim to give short, but interesting explanations
246for the various units and available values. While the conventions
247should be followed for most of the widgets - you might look up such
248agreements and recommendations on the Xfce wiki or ask your
249translation team about them -, the descriptions should be translated
250in a way that they are understandable and comfortable to read in your
251own language, which means that they don't have to be translated
252literally. On the contrary, it is recommended that you use your own
253words and phrases to get the best results. The author believes this
254will make translation much easier and more fun, without denying it can
255be quite tedious sometimes.
256
257If your po file is out of date and doesn't contain all strings that
258appear in the plugin source code, you can use the build system to
259update it for you. See the previous section EASY BUILD INSTRUCTIONS
260for setting up the build system and perform step 1a to clone the
261repository and generate the make files using automake. If this
262succeeds, simply change to the po subdirectory and execute the command
263"make update-po". This will regenerate all po files in the po
264directory and mark changed strings as fuzzy or obsolete, and add new
265strings as untranslated. You can then work on it as usual.
266
267However, if you need to start with a translation completely from
268scratch (the po file doesn't exist and isn't listed in transifex),
269then please write a mail to xfce@xfce.org or xfce-i18n@xfce.org or use
270the bug tracker and ask for such a file being added to the project.
271Currently, only the package maintainer or developer of the plugin can
272add this new file and include it in the automake files in the git
273repository so that it is integrated into the build process and
274packaged properly.
275
276Korean translator Seong-ho Cho also recommended the following command
277- to be executed in the project's root directory - for creating a
278fresh pot file:
279
280xgettext --keyword=_ --keyword=d_:1 --keyword=P_:1,2 --keyword=P_:1,2 --keyword=N_ --keyword=NP_:1,2 --from-code=UTF-8 --foreign-user --output=xfce4-weather-plugin.master.untitled.pot panel-plugin/*.[ch]
281
282This gives a po-template file with untranslated strings, with the
283advantage being that this only requires the gettext package to be
284installed. Of course, you can always simply ask the developer/package
285maintainer to generate and add a new po file for your language, so
286that you can download it using transifex.
287
288
289ICON THEMES
290==========================================================================
291
2921) Icon theme support
293--------------------------------------------------------------------------
294
295As of 0.8.3, xfce4-weather-plugin supports icon themes. This requires
296a specific icon naming scheme that corresponds to the met.no API
297symbols definition. Icon sets following the freedesktop.org
298standardized naming scheme are not supported because they lack too
299many icons the plugin would need for the various weather conditions
300provided by met.no, so adhereing to the standard wouldn't make much
301sense (see the next section 2) for more information).
302
303If you want to design your own set, please have a look at the default
304Liquid theme that is included in this package to get an idea what the
305icons should look like and at the source file weather-translate.c,
306where you will find references and explanations for the weather
307symbols.
308
309The plugin searches for icon themes in the following directories, in
310this particular order (this very same order will be used for listing
311the themes in the configuration dialog):
312$XDG_CONFIG_HOME/xfce/weather/icons
313$(datadir)/icons
314
315Where
316* $XDG_CONFIG_HOME is usually /home/user/.config
317* $(datadir) is whatever you configured it to be on build-time, like
318  /usr/local/share/xfce4/weather/icons or
319  /usr/share/xfce4/weather/icons
320
321In these directories the plugin shall find subdirectories that contain
322the icon themes. Let's look at the structure by example of the Liquid
323theme (files or directories in brackets [] are optional):
324
325Liquid
326|--22
327|--48
328|--128
329\--theme.info
330
331The theme.info file needs to be present, or the plugin will not
332consider the directory a valid icon theme. This file may contain
333the following entries:
334------------------------------- theme.info -------------------------------
335Name=Liquid
336Author=Unknown
337Description=Modified icon theme originating from the Superkaramaba Liquid Weather plugin
338License=GPL-2
339-------------------------- theme.info ends here --------------------------
340
341Make sure that each entry is on one line. Entries may not span
342multiple lines, all additional lines will be ignored. You can use \n
343for newlines, though. These values will be shown in the tooltip of the
344theme selection combo box in the configuration dialog. You might want
345to put an extra LICENSE file into your theme directory.
346
347Directories 22, 48 and 128 shall contain the icons in PNG format (or
348at least with a PNG extension) at approximately the size the directory
349names suggest. Icon sizes for the panel icon will be chosen depending
350on the panel size. For the tooltip, the icon will be taken from the
351128 directory, and medium sized icons (48) for the forecast window and
352similar places.
353
354Here is a list showing which icon sizes are recommended for the
355various panel sizes:
356
357Directory   Panel size    Recommended icon sizes
35822          16-23         22, 24, 16
35948          24-48         48, 24, 32
360128         49-128        128, 96, 80, 64
361
362To be found by the plugin, the icons need to be named exactly as
363follows (listed in alphabetical order):
364
365* cloud.png
366* fog.png
367* lightcloud.png
368* lightrain.png
369* lightrainsun.png
370* lightrainthunder.png
371* lightrainthundersun.png
372* nodata.png
373* partlycloud.png
374* rain.png
375* rainthunder.png
376* sleet.png
377* sleetsun.png
378* sleetsunthunder.png
379* sleetthunder.png
380* snow.png
381* snowsun.png
382* snowsunthunder.png
383* snowthunder.png
384* sun.png
385
386At night time, the plugin will first look for icons having a "-night"
387suffix, e.g. partlycloud-night.png, lightrainsun-night.png etc. The
388rest of the filename needs to be the same as for the day icon, and the
389icons should probably look similar, however with brother sun replaced
390by sister moon. Of course, the latter is rather a design decision than
391a technical necessity. If no night variant is provided, the plugin
392will fallback to using the day icon.
393
394Note that not all symbols are expected to have icons for night
395time. For example, the CLOUD symbol is used when there is 100%
396cloudiness and the sun or moon cannot be seen. However, the plugin
397will still look for such night icons, in case the designer has another
398idea how to indicate night time without creating confusion.
399
400The only exception to this is the icon for NODATA, which has no night variant.
401This icon will only be shown when the plugin has not been configured yet -
402but then more likely only the NODATA icon of the default theme will
403appear and not that of your theme -, or when there is no data
404available, for example in case of a network error. It also serves as
405the fallback icon for all missing day icons. Finally, if you do not
406provide a NODATA icon for your theme, then the one of the default
407theme will be used which is assumed to always be present.
408
409If the plugin can't find a specific icon, it will remember that it is
410missing and not try to read it again until you restart the panel for
411change the theme. Also, icons for the panel and for the tooltip will
412be cached. These are measures to minimize disk access. Just keep that
413in mind when you work on your icons when the plugin is running.
414
415All icon sets included and distributed in the xfce4-weather-plugin
416package are under GPL by default.
417
4182) Freedesktop standardized naming scheme
419--------------------------------------------------------------------------
420
421It was suggested (https://mail.xfce.org/pipermail/xfce/2012-August/031180.html)
422to make use of icon themes implementing the freedesktop standardized naming
423scheme, like some KDE and GNOME application do, for reference please see
424https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html.
425
426This might not be such a good idea, however, because
427* the standard only provides a limited set of weather icons which will
428  not be enough to represent all possible conditions the weather plugin
429  can show,
430* it is unclear what to do when those icons are missing, and solving
431  this in a good manner will make things unnecessarily complicated for
432  the plugin,
433* with the Liquid icon set there already is a good default icon set that
434  suits most users,
435* the deficiences of the Liquid theme can be solved more easily with
436  proper theming support and a bit of editing (providing an
437  alternative Liquid theme for dark panels).
438
439Of course, you might take any such freedesktop compliant theme as the
440basis for your personal new icon set, so you only have to design or
441assemble the remaining few icons. And finally, with a bit of searching
442you can find lots of free-to-use icons and icon sets on the web!
443
4443) The "Liquid" icon theme and its license
445--------------------------------------------------------------------------
446
447In August 2012 a question was raised about the license of the Liquid
448icon theme (see https://mail.xfce.org/pipermail/xfce/2012-August/031178.html
449and https://mail.xfce.org/pipermail/xfce/2012-August/031188.html for
450further discussion), so let's elaborate a bit on that.
451
452According to original author of the plugin, Bob Schlärmann, the
453"Liquid" icon theme originates from the now abandoned "Liquid Weather"
454package for KDE Superkaramba and has been part of the weather plugin
455since around 2004. While this is not 100% certain, it is supposed to
456be licensed under GPL-2, as is the "Liquid Weather" script.
457
458Unfortunately, the Liquid Weather website at liquidweather.net is no
459more, and so obtaining the script package is a bit difficult and
460requires searching for mirrors. A link that still works at the time of
461this writing is:
462ftp://ftp.wanadoo.nl/pub/mirrors/FreeBSD/ports/distfiles/lwp-15.0.skz
463
464However, trying to contact the developers of Liquid Weather in
465September 2012 for verification about this issue did not yield any
466response.
467
468An archived version of the website which contains information about
469the previously available icon sets and the license is still available at
470https://web.archive.org/web/20100724155753/http://liquidweather.net/icons.php:
471"On this page, you'll find additional iconsets and backgrounds for
472liquid weather ++ - please note that the backgrounds are not easily
473installable with versions earlier than v9.0. With the exception of the
474weather.com, Beginning and Um icons, I believe that these iconsets are
475either GPL or available for redistribution. If I am wrong, please let
476me know and I'll remove them. Please note that the weather.com icons
477are used with permission of the weather.com website, and the Beginning
478and Grzanka icons are used with the permission of their authors. This
479means that these iconsets may not be copied, modified or redistributed
480without permission. The same applies to the Umicons included in the
481core liquid weather tarball."
482
483A further look at http://kde-look.org/content/show.php?content=6384,
484brings forth this bit of information: "License: Everything is GPL,
485EXCEPT FOR some of the icon sets, which are distributed with the
486permission of their authors." Looking at the archived web page above,
487the Liquid weather icon set is not to be found in the exceptions list,
488so according to that it should be GPL. Besides, the similarity of the name of both
489the icon set and its containing package also hints to that licensing.
490
491To sum it all up, the icon theme is considered licensed under GPL too,
492though its original author remains unknown. If someone can resolve this,
493please send a mail to the current maintainer of the weather plugin, and
494he/she will give proper credit.
495
496
497CACHING
498==========================================================================
499As of 0.8.3, xfce4-weather-plugin caches downloaded weather and
500astronomical data. Per plugin instance, one file containing that
501cached data is created in the user cache directory, typically in
502$HOME/.cache/xfce4/weather. This file will be generated or overwritten
503on every weather data download and read before any location data
504change. Cached data has a certain expiry date and will not be used if
505it is older than that. There is an option not exposed by the UI to
506change the maximum age; This parameter is called "cache_file_max_age"
507and can be found in the plugin configuration file usually located in
508~/.config/xfce4/panel. It is set to the maximum age in seconds and
509defaults to 48 hours (172800 seconds).
510
511By using caching, some deficiencies of data provided by met.no can be
512worked around:
513
514First, their location forecast service wasn't really meant to provide
515data for the current weather, which the plugin tries to convey.
516However, the forecasts for the next few hours (typically the next 3
517hours or sometimes even the next hour for cities, in any case at max 6
518hours for all locations) are in most cases good enough to fake current
519conditions using interpolation. Note that other weather providers
520often present values for current weather that have been measured half
521an hour or even more ago, so in most cases it won't make a big
522difference.
523
524Second, caching reduces network traffic. Data will only be downloaded
525after the download interval time has expired. Information about
526download times can be seen in the details page of the summary window.
527
528Third, caching data enables the plugin to work without internet
529connection for some time (see the previous paragraph about
530cache_file_max_age for information about configuring this expiry
531time).
532
533Note that refreshing data by middle-clicking the icon or by clicking
534on the appropriate context menu entry does not clear the cache.
535However, data that has been downloaded will always overwrite any
536existing data.
537
538
539HIDDEN OPTIONS
540==========================================================================
541Further options are available which are not exposed via the UI because
542they are usually not needed. To add or edit these, quit the panel with
543"xfce4-panel -q", make the desired modifications to the appropriate
544config file in $HOME/.config/xfce4/panel, then restart the panel with
545"xfce4-panel &".
546
547* cache_file_max_age: Maximum allowed age of the cache file in seconds.
548  See the previous section CACHING for an explanation.
549
550* geonames_username: The GeoNames webservices are credit-based, and
551  although the plugin uses them only for setting up its configuration,
552  the credits could get exhausted if many users use the plugin. This
553  configuration option gives the user the chance to set a registered
554  GeoNames username manually (see INFORMATION FOR PACKAGE MAINTAINERS
555  AND DISTRIBUTORS on how to register). Delete this option completely
556  to use the default GeoNames username set at build time.
557
558* power_saving: If the plugin has been compiled with support for
559  upower, it will try to extend battery life by taking the following
560  measures:
561  If the machine is on battery,
562     - decrease the regular update interval to 30 seconds,
563     - stop the scrollbox animation and
564     - update the summary window clock only every minute.
565  Setting this value to false will deactivate power saving. If upower
566  support has not been compiled in, then this setting will have no
567  effect.
568