Thread Tools
Posts: 224 | Thanked: 501 times | Joined on Aug 2011 @ suncity
Hi All!

I have another problem in which maybe someone could help: I'm trying to replace the operator widget in hildon-home with my custom widget.

I know that there is a custom operator name widget but I would like to add my own functions to the widget not just writing predefined texts.

So I tried to analyze the source code of that custom operator name widget and it seems - I do not really know C programming though - that there is no special function for placing the widget in the upper row. And as one of the members here told me hildon-home.c calls the appropriate .so file by hard-coding.

My thought is that if I create a hildon-home widget .so and name it and place it to /usr/lib/hildon-desktop then it should be appear in the upper row (after killall hildon-home of course).

But I'm working in python so it is not that simple. I'm able to create a .so from a python code with cython but even if the widget (.py) is working when I test it in hildon-home, the .so isn't working when I name and place it like I said above.

So I do not know whether it is even possible for hildon-home.c to read a cython made .so (so it is possible to create "operator widget" in python) or it is essential to make the .so from a C source code.

Any idea would be appreciated. Thanks,


The Following User Says Thank You to justmemory For This Useful Post:
Posts: 103 | Thanked: 102 times | Joined on Jul 2011 @ Hungary
Sidenote to this post:
Some time ago I saw justmemory's desktop and his own-made stuff on it on a hungarian N900 forum.
So I've got buzzed that maybe, just maybe it's possible to me to reduce my desktops number from two to just one with his help.
I need a nameday applet, Foreca Weather, and my calendar events display, so I need 2 desks now.
Then we agreed on that that it's would be nice if we can put some custom info from the mentioned apps to the place of the operator's name's place.
With operator name widget, I made the following image of what I'm needed.

So my question to Linux pros is this.
Is it possible to:
- place manualupdate weather info
- place autoupdate number of closing events from calendar
- place autoupdate nameday info
to the place of the operator's name?
Attached Images

The Following 4 Users Say Thank You to dy1ng For This Useful Post:
pichlo's Avatar
Posts: 4,998 | Thanked: 15,008 times | Joined on Sep 2012 @ UK
Originally Posted by dy1ng View Post
I need a nameday applet, Foreca Weather, and my calendar events display, so I need 2 desks now.
Not to diminish your request which is a very valid and good one, but I have the exact three widgets you mention plus a lot of icons on my single desktop. I can add a screenshot if needed but I will need to censor it first to hide some personal info.

The Following User Says Thank You to pichlo For This Useful Post:
Posts: 103 | Thanked: 102 times | Joined on Jul 2011 @ Hungary
Originally Posted by pichlo View Post
Not to diminish your request which is a very valid and good one, but I have the exact three widgets you mention plus a lot of icons on my single desktop.
I forget to mention that I like my first desktop as it is now.
Just few shortcuts and a nice background, quite a minimal setup.
I tried to put everything into one - fits, but too dense to me.
Plus.. memory, memory, memory.. Weather widget eats some for sure, calendar too, so it's would be nice to have an all in one solution for all these stuff.

The Following 2 Users Say Thank You to dy1ng For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,512 times | Joined on Aug 2010 @ Wigan, UK
The custom operator name widget uses GConf keys to determine what to display in the widget (see connui-cellular-operator-home-item-custom-settings.h). The keys are:




The widget monitors changes in the values of these keys, so you can use a script or other process to update the values and display the information of your choosing in the widget.
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website


Last edited by marxian; 2015-10-27 at 12:24. Reason: Fix online colour/shadow keys

The Following 10 Users Say Thank You to marxian For This Useful Post:
Posts: 224 | Thanked: 501 times | Joined on Aug 2011 @ suncity

thanks a zillion!!! Now I'm able to write anything into that row (have to test it though but it is working from the command line).


The Following 2 Users Say Thank You to justmemory For This Useful Post:
Posts: 224 | Thanked: 501 times | Joined on Aug 2011 @ suncity
Hi All!

Based on dying's idea I created a script and service to see some useful information and not the operator's name

So, as I'm hungarian there is a hungarian version which writes the nameday too...

- dependency: sudo, custom-operator-name-widget
- unzip the attached zip file to /opt/onr/ (you have to create onr directory in /opt)
- move the file named 'onr' to /etc/init.d/ make it executable (sudo chmod +x onr) and run the following command in terminal: sudo update-rc.d onr defaults
- move the file named 'onr_startup' to /etc/event.d/. This makes possible to start service automatically after boot.
- edit /opt/onr/GetMoonInfo file 'hemisphere' line (3. line)
- edit /opt/onr/GetWeatherInfo file 'address' line (93. line) - example:|GB007|LONDON or|NEW-YORK
- run the following command in terminal: sudo /etc/init.d/onr start

What it writes:
- 1. line: time and date
- 2. line: (nameday), number of birthday today, number of events or tasks today (it does not handle repeating events and tasks!), battery level (based on bme; if you have bq27200 feel free to modify the script)
- 3. line: weather now, moon illumination and if waning ("-") or waxing ("+")
- 4. line: weather today
- 5. line: weather tomorrow

If there is a internet connection (cannot test it with mobile net...) it refreshes weather and moon data every 15 minutes (You can modify it in script, line 105(this line number is 486 in hun version): time.sleep(whatyouwantinseconds)).
The script runs in every two seconds; you can modify it in line 187 (568 in hun version).
The script checks its' memory usage every minute (you can modify it in line 189 (570 in hun version)) as it raises through time (I do not know why) and restarts itself if it is equal or greater then 3%.

Known bugs:
- sometimes it just freezes (the python script runs though); I do not know why. I suspect it is the hildon-desktop/hildon-home because it happens after waking up the device from locked state. In ths case you have to manually restart it: sudo /etc/init.d/onr restart.
- sometimes it creates a linebreak and shifts the lines lower.



//Edit: If something is not working or you simply do not want the service you can test the python script itself by running it: python /opt/onr/ or cd /opt/onr then ./ If you do this you can see the output so if something is not working it eases debugging (press Ctrl+c for skip).

//Edit2 (2016-05-13 12:26): Corrected moon phases names so it writes the "-" and "+" correctly and don't have the "moon referenced before assignment" error. Please use these if you downloaded the one(s) that I first uploaded.
Attached Images
Attached Files
File Type: zip (5.4 KB, 84 views)
File Type: zip (8.8 KB, 87 views)

Last edited by justmemory; 2016-05-13 at 12:24.

The Following 8 Users Say Thank You to justmemory For This Useful Post:
Posts: 224 | Thanked: 501 times | Joined on Aug 2011 @ suncity
Hi All!

After some learning and using my previous script I decided to rewrite my "wallet" application for n900.
Please note that I'm not a programmer it is just a hobby for me and all the features represent mainly my needs and my logic.
Bugs can occur so please tell me if there is any.
This is my first .deb package too (it should work but who knows...)...


The application does not depend on matplotlib and numpy directly. If you do not have those installed you just simply cannot see the graphs.
Important: there is no automatic rollover so if you have some money at the end of the month you have to enter that manually for next month's income (maybe I should add rollover function too).

There are two views available:
- Main view
- Calendar view

Main view:
You can see all expenses, incomes for the current month, and all Savings that you added so far to the database (not just for current month). You can tap all of them.
There is a “speedclock” that shows all expense as percentage of all income.
There is a trend line that shows all expense and all income for the months of the current year.

If you tap on expenses, incomes or savings you can see the detailed view for the current month by category. There is a menu button that shows a graph which represents summarized expense for categories as percentage of all expense for that month.
There is also a button which you can click on and add an entry.
There is the category name, amount of money and if there is a difference (+percentage, -percentage, equal) to previous month for that category. If there were no such expense, income or saving for that category in previous month then there is no text.

There is a difference between expenses, incomes, and savings as for expenses you can add tags. If you tap on a particular category (preferably left side of the screen) then the current row is expanded and you can see the summarized tags and expenses for that tag.

There is an arrow which you can tap and see the very details for that category: on the left side of the window you can see every entry that is in the database. You can change order by tag, day, and expense. On the right side of the window there is a graph that shows summarized expense for tags as percentage of all expense for that category. If you long press on a particular entry you can edit or delete that entry.

For incomes and savings there are no such options (yet) because for incomes and savings you can specify only category. Therefore you can modify these entries in a different way (I shall improve this in the future).

If you want to add an entry you have to tap on the button next to the all expenses label. The date is automatically set to current date. For amount of money you can enter only numbers (do not have to use blue arrow key with keyboard!). You can specify categories in the entry box or if there is any in the database then you select it from the list if you click on the category button. For expenses there is a tag entry and button. If you selected a category then all tags for that category are shown when you click on the tag button. But you can specify new ones in the entry as well. Be aware the latest information will be written to the database (e.g.: you selected a category but want to modify that you can simply choose another one or specify a new one in the entry). In the entry box you always have to press “enter” to store the information.
If everything is set you can click on “save”. If something is missing there will be a warning and no entry will be written to the database. If all data is set then clicking on save button will save that entry to the database and a short message will be shown about that. Important! If you add something to savings then it will be set into expenses as “Saving” category! Be aware that all the latest information are stored so if you click on save button again then it will write those information to the database again. For me the advantage of this is that iIf you would like you can set another entry by changing only category or amount or tag or date. This eases setting more entries with the similar category for example as you have to modify only tag and amount of money. If you do not want to set more entry you only have to press on back arrow. Then you will be taken to the main view and all the data will be refreshed.

Calendar view:
There is a calendar for the particular month. In the calendar you can see expenses, incomes and savings for that day. If you tap on a day then you can see the summarized information for that day – from here all the functions are the same as written in main view. The advantage of calendar view is that if you want to see a particular day or want to add an entry for that day you can do that. In the adding window date is automatically set to that date and all the details are shown for that day if you go to the details window.

There are menu buttons both in calendar view and main view:
- Next month
- Previous month
- Specific month
- A button which you can change the view with
- Settings
- Search

I hope the names are speaking for themselves… (: But here are some details:
- Specific month can be selected between 2016 and 2045
- In settings window you can set currency, default view and an expense which if you add to expenses then it will be automatically set as a saving as well (so you do not have to add that amount to savings).
- You can search for everything and anything in all three databases – no whole words required and capital letter doesn’t matter. Incomes and savings entries can be modified or deleted only this way (for now). Important! If you modify or delete a saving entry, the “connected” expense entry remains the same as before (no automatic modification or deletion done) so you have to manually modify that expense entry as well (and vice versa: if you modify an expense which is technically a saving entry, the saving entry remains…).

Planned features:
- apply details view for incomes and savings
- maybe connect savings and expenses more
- some kind of password protection and/or encryption
- export-import (backup?) functionality
- make multiple edition available (e.g. whole category)
- try to add portrait support – relayout windows on rotation if there is a graph
- more report options (more charts, report between dates, compare years/categories, etc.) suggestions and ideas are welcomed (:
- make add budget option available
- make bill (and maybe reminder?) option available
- make recurring expense/income/saving option available
- maybe draw a new, fancy icon... (:
- automatic rollover between months

Known bugs:
- date selection with hildon.DateButton results segmentation fault when no date selected – i.e. the user taps outside the date selection dialog. This does not happen in the search window though…
- Sometimes warnings are raised – maybe in connection to rotation and matplotlib. E.g.: – assertion G_IS_OBJECT failed.
- hildon button relief setting (i.e.: hildon.Button().set_relief(gtk.RELIEF_NONE)) does not always work so it looks like a normal button.

That is all. Hope you will find it useful.

Attached Images
Attached Files
File Type: deb maemoneypot_0.1.0-1_all.deb (38.1 KB, 41 views)
File Type: gz maemoneypot_0.1.0-1.tar.gz (121.1 KB, 42 views)

Last edited by justmemory; 2017-01-31 at 10:20. Reason: Clarification

The Following 10 Users Say Thank You to justmemory For This Useful Post:
Posts: 224 | Thanked: 501 times | Joined on Aug 2011 @ suncity
Hi All!

I made some - hopefully - improvements.

- Cleaned the code a bit and used a bit different filestructure,
- Fixed a bug,
- Added password protection.
How this works: password protection is set disabled by default at installation. If you wish to set it then tap on 'Settings' and set it to 'Enabled'. After this it will pop up a window where you can type the password. Then is restarts and now it will ask for the password as a 'login' procedure.

Side notes:
- it uses hashlib so it saves the password as an encrypted 'text';
- if you installed and used previous version then the installation won't hurt you original settings and database but due to the fact that this is my first attempt to achieve this behaviour please create a backup of these (copy /home/user/.maemoneypot/settings.ini and .maemoneypotdb to MyDocs for example). I tried the installation and it worked as it should but who knows...
- changing password is not an option yet - only manually can be changed but would like to add this option soon...


EDIT:// Sorry, there was an issue in the install script and user cannot add record to database; I fixed it now (hopefully).
Attached Files
File Type: gz maemoneypot_0.2.0-1.tar.gz (37.4 KB, 24 views)
File Type: deb maemoneypot_0.2.0-1_all.deb (38.2 KB, 19 views)

Last edited by justmemory; 2017-04-06 at 15:43.

The Following 3 Users Say Thank You to justmemory For This Useful Post:
Community Council | Posts: 4,178 | Thanked: 10,120 times | Joined on May 2012 @ Southerrn Finland
So it hashes the password and saves the hash to a file.
Does the authentication phase then compare a hashed input password against the hash in the file?

What prevents a malicious user to create a hash for a password, replace the hash in file and log in with the new password?

The Following 4 Users Say Thank You to juiceme For This Useful Post:

maemo 5, python-hildon

Thread Tools

Forum Jump

All times are GMT. The time now is 19:36.