dglent / meteo-qt Goto Github PK
View Code? Open in Web Editor NEWSystem tray application for weather status information
License: GNU General Public License v3.0
System tray application for weather status information
License: GNU General Public License v3.0
It would be very useful if there was an option to disable tooltips.
They look nice in Unity. Not so in Mint.
Hello,
I use i3wm and I noticed there isn't a convenient way to assign a shortcut to show the panel (at least as far as I could tell, please correct me if I'm wrong); I know this is usually handled by plasma, so I came up with a quick solution that doesn't require you to write an entire shortcut system.
Usually when I want a popup window I configure i3 to move it to the "scratchpad" workspace and assign a shortcut to move it to the current workspace. This can be done with any window as long as it has a unique name. All I need to make it completely automatic with meteo-qt is to make the panel visible by default.
I verified this to work by adding
start_minimized = self.settings.value('StartMinimized') or 'true'
if start_minimized == 'false':
self.showpanel()
to the overviewcity method in the SystemTrayIcon class. Now I can set
StartMinimized=false
in meteo-qt.conf and the panel will be visible whenever I launch the program.
--edit--
The check would also need to be run whenever the widget is updated
You may want to check this guide: http://python.org.gr/index.php/files/category/4-odigoi?download=45:python
And/or this app: https://github.com/Ilias95/FF-Multi-Converter
Running 5bd50c0 on up to date Arch Linux x86_64 there was a core dump for apparently no reason.
I'm not aware of anything particular that happened before.
So find a gdb backtrace on https://gist.github.com/pmattern/917ba17ac8635d4606ca for now and let me know if additional information is needed.
It's only my opinion but I think it would be very useful if windchill factor temperature would be displayed.
Especially for us living in a cold climate :)
And if under Sunset the daylight length (Sunset minus Sunrise) would be too.
If icon and temperature is displayed the temperature is quite small. Making it bold would make it more visible.
Overall it's a very nice program, though.
It would be nice to have meteo-qt start automatically with the desktop.
I'm not familiar about it but on the packaging side this could probably be done by adding a file to /etc/xdg/autostart. That's not the best solution IMO though, because it would be hard to disable.
With user privileges, it seems this could be achieved by adding a desktop file in ~/.config/autostart.
A tickable box in the meteo-qt settings could make it possible to add this desktop file or remove it easily ("Enable autostart"), and this has the advantage of being desktop-agnostic (at least I suppose).
Currently if you modify the main window of meteo-qt (move it around on your desktop and/or change its size), the settings are lost when you minimise it to the tray and restore it later (it is then centred anew and with the default dimensions).
Saving the window position and size in the config file could probably help implement this feature.
Openweathermaps lets you specify a location by city, zip/postal code or lat & long. City,country is particularly inadequate in the US, I see 3 cities in the US with my city name.
Right now both the dialogue which opens upon clicking the wrench right of the form "City" in dialogue "Meteo-qt Configuration" and the dialogue to add additional cities which opens upon clicking "Add" in the former are named "meteo-qt". This is pretty inconvenient at times, and be it with regards to referring to those dialogues in bug reports only, see the somewhat awkward results from trying to be precise in #66.
So I think it would make some sense to rename the dialogues.
Not really sure about optional titles, but I guess just "Cities" for the former and "Add a city" for the latter would be at least an improvement for the time being.
Hi,
this is not really a bug but a feature request.
I want to use meteo on Ubuntu. I already created a package, installed it, got my key from openweathermap and added my keys. Now the icon shows the temperature but I cannot see the details because there is no tooltip in Ubuntu and also left click and right click have the same action (showing the drop down menu).
The whole thing is called appindicators:
https://unity.ubuntu.com/projects/appindicators/
Maybe you could add support for that.
Just a menu item to show the details in a dialog or something like that.
I think that "Kalamata, Greece" is not the most suitable default... :)
Several strings in the current English template are out of date. Also consider removing compiled translation files from repository and setting up Transifex auto-update from https://raw.githubusercontent.com/dglent/meteo-qt/master/meteo_qt/translations/meteo-qt_en.ts.
Commit a317b10 fails to build due to some problems regarding the translations
python setup.py install --root /path/to/target/dir
[...]
Traceback (most recent call last):
File "setup.py", line 69, in <module>
'meteo_qt/translations/meteo-qt_zh_TW.qm']),
TypeError: 'tuple' object is not callable
Forcing volunteers to study Qt Linguist and open Pull Requests for every edit of translation is just not cool. Also updating .ts files after every single template change is pain.
A platform like Transifex or Launchpad will help with crowdsourcing translations from concerned citizens without technical skills. Maintaining existing ones will become easier too.
Choosing the more accurate temperature setting including the position after the decimal point right when meteo-qt gets launched the first time on a new user profile makes meteo-qt crash and dump core.
To reproduce make sure no meteo-qt instance is running, delete an eventually preexisting directory $XDG_CONFIG_HOME/meteo-qt
and launch the application. Next, make the usual settings in dialogue "Settings" / "Meteo-qt Configuration", in particular select a city and set "Temperature accuracy in system tray" to "0.1°". meteo-qt will then crash upon clicking OK
.
The problem can not be seen when the same steps are taken but "Temperature accuracy in system tray" is left at its default setting "0°" and only tweaked after the dialogue was left by clicking OK
and opened another time, eventually as data get acquired before the setting is changed that way.
Seen with 8310605 / 0.9.2 on Arch Linux.
I would personally use PEP8 since it is almost universally accepted in Python's ecosystem. Since this is not a library or a huge application this is not such a big deal.
Nonetheless, you should be consistent in the style used. For the most part you use camelCase
but in some cases you use underscores (e.g. lang_list
attribute in Settings
class).
Please choose a style and stick with it.
Can you add feature to change panel icon font size is very unreadable small ?.
This is the traceback I get:
Traceback (most recent call last):
File "/home/feanor/Prog/GIT/meteo-qt/meteo_qt/meteo_qt.py", line 378, in config
dialog = settings.MeteoSettings(self.accurate_url, self)
File "/home/feanor/Prog/GIT/meteo-qt/meteo_qt/settings.py", line 37, in __init__
self.add_cities_incombo()
File "/home/feanor/Prog/GIT/meteo-qt/meteo_qt/settings.py", line 324, in add_cities_incombo
if len(list_cities) > 0:
TypeError: object of type 'NoneType' has no len()
or a option (maybe on by default) in the setup script. Running this update every time make it hard/impossible to create a reliable and reproducable package for debian
Provide an option to use forcast.io instead of openweathermap. Thanks either way.
Hi this is a similar problem as in bug #63.
My desktop environment ist now Ubuntu 17.04 budgie desktop.
Before I was using the Unity desktop which had the "feature" that there is no difference in left or right clicking a system tray icon.
Now in the budgie desktop there is the difference again and other apps like discord or keepassx which have an icon in the systray now open on left clicking and show a context menu on right click. So far so good.
But meteo always just shows the context menu. No matter if I left or right click the icon.
The DESKTOP_SESSION environment variable is set to budgie-desktop
.
Is there a way to adjust the height of the weather status window? Both in LXDE and LXQT, the window is sized to spill underneath the bottom panel so the forecast is obscured. Is there a configuration file or other action where I can adjust this behavior so that the window fits from the top of screen to the top edge of the bottom task launcher panel. Thank you.
Not just only that CTRL + C failing is a Bug, but actually the App ignores a standard Unix signal to kill itself, also a Bug.
Repro Steps:
Fixed by #61 (review)
Recent meteo-qt is crashing and dumping core when an attempt is made to translate the first city on a new user profile right after adding.
Steps to reproduce
$XDG_CONFIG_HOME/meteo-qt
doesn't preexist. Launch meteo-qt and confirm the desktop notification informing that no city has been configured yet. Open the settings, file an OpenWeatherMap key in its form and hit "Apply".5284a59 or c78082b on Arch Linux. Except some minor differences within the traces same findings within an LXQt and Xfce session.
The problem can not be seen when dialogue "Cities" is closed by clicking "OK" without clicking "Translate" before. Once the dialogue was closed that way the crashes can no longer be provoked by adding additional cities according to "2." of the steps to reproduce.
Traces can be found in this GIST.
EDIT Reflect renaming of dialogue windows in question in 5284a59
ERROR: Error: 401 Unauthorized
This is just a cosmetic problem.
Daylight is showing, for example, 13:0 instead of 13:00
juan@x ~ $ meteo-qt
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/meteo_qt/meteo_qt.py", line 763, in run
timeout=5)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 1346, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.6/urllib/request.py", line 1321, in do_open
r = h.getresponse()
File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
response.begin()
File "/usr/lib/python3.6/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.6/http/client.py", line 279, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: <?xml version="1.0" encoding="UTF-8"?>
Aborted (core dumped)
juan@x ~ $ cat ~/.config/meteo-qt/meteo-qt.log
07/09/2018 15:39:03 ERROR: Error closing overviewcity: <class 'AttributeError'> - meteo_qt - root
juan@x ~ $ cat ~/.config/meteo-qt/meteo-qt.conf
[General]
APPID=XXX_REMOVED_THIS_FOR_SECURITY_XXX
CitiesTranslation={}
City=Buenos Aires
CityList=[]
Country=AR
FontSize=20
ID=XXX_REMOVED_THIS_FOR_SECURITY_XXX
Interval=120
Proxy=False
TrayColor=#ffffff
Unit=metric
[Logging]
Level=INFO
[SearchCity]
Geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x3\xe\0\0\x1\xa7\0\0\x4\xed\0\0\x2\xd8\0\0\x3\xe\0\0\x1\xa7\0\0\x4\xed\0\0\x2\xd8\0\0\0\0\0\0\0\0\a\x80)
juan@x ~ $ python --version
Python 3.6.6
juan@x ~ $ lsb_release -a
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
juan@x ~ $ uname -a
Linux x 4.17.4-1-ARCH #1 SMP PREEMPT Tue Jul 3 15:45:09 UTC 2018 x86_64 GNU/Linux
juan@x ~ $
City: Buenos Aires, Argentina.
Qt5, KDE, API Key configured.
According to both the specification and the habits of many other applications user-specific log files should be placed in $XDG_DATA_HOME instead of $XDG_CONFIG_HOME, probably best at a path like ~/.local/share/meteo-qt/meteo-qt.log
.
If meteo-qt is configured to display both icon and temperature the horizontal alignment within the area that's at meteo-qt's disposal isn't centrally any longer but left, compare display of both icon and temperature
with temperature
and icon
only respectively.
This for sure isn't a bummer, yet I think the UI would be more smooth if this got fixed, in particular as central alignment seems to be the default behaviour of virtually all similar applications.
Behaviour doesn't seem to depend on the technology used by the panel as it's the same in plugins "System Tray" of KDE Plasma 5 and plugin-statusnotifier of LXQt which are implementing SNI as well as in plugin-tray of LXQt and "Notification Area" of Xfce both of which are implementing the old System Tray Protocol.
Seen running 5bd50c0 on Arch Linux i686 or x86_64.
It's a shame that it's not possible to change wind speed units from m/s to km/h (kph) or even knots. Meters/second are not intuitive... Is there a trick?
Recent VCS checkouts as well as release 0.9.0 are crashing on new user profiles on Arch Linux as soon as a city got selected.
To reproduce start meteo-qt on a user profile where it hadn't been used before or where $XDG_CONFIG_HOME/meteo-qt
had been deleted and select an arbitrary city from dialogue "meteo-qt". As soon as a city was selected that way and OK
is clicked in dialogue "Meteo-qt Configuration" the application crashes.
When launched from a virtual terminal there's output
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/meteo_qt/meteo_qt.py", line 557, in config
self.config_save()
File "/usr/lib/python3.5/site-packages/meteo_qt/meteo_qt.py", line 543, in config_save
self.tray()
File "/usr/lib/python3.5/site-packages/meteo_qt/meteo_qt.py", line 433, in tray
temp_decimal = eval(self.settings.value('Decimal'))
TypeError: eval() arg 1 must be a string, bytes or code object
on the shell, traces can be found at https://gist.github.com/pmattern/0290959a4e2563720b019fbb4309c682. Problem is not related to #44, bisecting suggests it's a regression introduced in 8d0716d.
This would lower the installation barrier and would make it easier for people to try the application.
Moreover, it would also make it easier for Linux distributions to package the application.
~ $meteo-qt
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/meteo_qt/meteo_qt.py", line 763, in run
timeout=5)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.5/urllib/request.py", line 1257, in do_open
r = h.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 279, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine:
Aborted
I think it would be nice if we could set multiple locations. I.e. you may live in a major City, but you might be interested in how is the weather in your hometown etc.
I have been getting various connection errors recently. I believe it is since the update from 0.4.3 to 0.5.0...
The program crashes when I choose the city and click apply button:
rinaldus@peter /tmp/meteo-qt/meteo_qt $ python3 meteo_qt.py
ERROR: Error closing overviewcity: <class 'AttributeError'> - meteo_qt
INFO: http://api.openweathermap.org/data/2.5/find?q=Moscow&type=like&mode=xml&APPID=18dc60bd132b7fb4534911d2aa67f0e7 - searchcity
INFO: http://api.openweathermap.org/data/2.5/find?q=Moscow&type=like&mode=xml&APPID=18dc60bd132b7fb4534911d2aa67f0e7 - searchcity
Traceback (most recent call last):
File "meteo_qt.py", line 511, in config_save
if (self.traycolor != traycolor or self.tray_type != tray_type or
AttributeError: 'SystemTrayIcon' object has no attribute 'tray_type'
Аварийный останов
I think it would be nice to be able to cancel the settings dialog (i.e. to explicitly apply settings).
Hi. It this plugin working? I get these messages when I set my location. I get succesfully added my personal api key to the program, but still get errors. What I'm doing wrong? My system is SparkyLinux 5.x Nibiru (Debian Testing) with LXQt 0.13.0, with all up-to-date. Many thanks for your work!
Greetings!
It would be nice to able to configure, or autodetect the color of font. On dark themes the default black font is unreadable.
Thank you.
The tags currently used are the so-called lightweight ones. These don't get considered by git describe
yielding results like this one
$ git describe --always
v0.8.1-116-g8310605
from current master which doesn't really make sense.
The problem can be circumvented easily by using simple annotated tags. These can be set by running
$ git tag -a <name of tag> [-m <description>]
where omitting the description at the command line will open an editor to add it which is optional. Set that way they can get uploaded to GitHub by running
$ git push --tags <remote name>
and will then display in the output of git describe
.
Hi
On dark panel, tray icon temperature is wrong display (i'm on ubuntu 16.04): fonts are dark on dark.
Best regards
If meteo-qt gets launched by ~/.config/autostart/meteo-qt.desktop
as usual an additional instance gets added per session both in panel plugin (widget) "System Tray" of KDE Plasma 5
and "Notification Area" of Xfce 4.12.
I didn't understand the exact technical details so far and hence cannot say whether meteo-qt or the panel plugins are to blame here. So I'll just state what I'd consider a relevant finding or thought.
The same behaviour can be seen with LXQt ConnMan Applet but neither with NetworkManager's nm-applet nor with the notifier of Octopi, a package management GUI for Arch Linux, all of which are started according to the Autostart Specification, too.
Problem can not be seen in LXDE or LXQt at all.
It doesn't seem to matter whether or not the application ("applet") that's meant to run in the panel plugin allows for running several instances in parallel. Octopi notifier doesn't but nm-applet as well as meteo-qt do.
nm-applet on the other hand throws a warning about a registered D-Bus object when a second instance is launched from a terminal emulator which could very well be related to the problem, IMO. Maybe the affected panel plugins are relying on D-Bus to check the status of the applets but don't get this information handed by the latter.
AFAIK only a single instance of a panel plugin implementing either the old System Tray Protocol or the new [K]SNI can be run at a time. If so it could eventually be considered a bug per se if applets allow for running several instances in parallel.
On the other hand panel plugins should not rely on some particular technology like D-Bus as assumed above to prevent several instances as long as this technology isn't a recognized standard.
Hello dglent!
Is well known that request library is more efficient and readable than urllib.request library. request provides a more pythonic way to process web responses and error handling, and also, provides a really nice layer of abstraction, making the code beautiful and easy to read and maintain. Have you consider use it?
In other hand, many people have corporative proxies(with or without authentication) to browse the web. Is there a chance to add the proxy option to meteo-qt?
Ok this is just my personal opinion, but I find it easier to read the code
when code blocks are grouped together and separated by empty lines and
comments.
I also like to have a .setup() method where I create and place the various
widgets.
You can check what I mean here. If you like it I can make a pull request.
Just what the title says. In order to help you I've created an AUR package for Archlinux:
https://aur.archlinux.org/packages/meteo-qt/
Under certain conditions recent meteo-qt is crashing and dumping core when it is terminated from its context menu right after launching the first time on a new user profile.
Steps to reproduce
$XDG_CONFIG_HOME/meteo-qt
doesn't preexist. Launch meteo-qt and confirm the desktop notification informing that no city has been configured yet.The crashes seem to be tied to certain conditions, most likely to meteo-qt being run in non-Qt panels. At least the problem doesn't exist in LXQt sessions here but does under Xfce or when lxpanel, the panel of LXDE, is running in an Openbox "only" (no desktop environment) session.
They can no longer be triggered when meteo-qt is quit the first time it's running without provoking the crash as depicted in the steps to reproduce, e. g. by adjusting some settings or so before hitting "Exit".
c78082b on Arch Linux. No helpful output when launching meteo-qt from a terminal emulator, traces can be found in this GIST.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.