maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting) (https://talk.maemo.org/showthread.php?t=46594)

shapeshifter 2010-03-05 18:22

[Announce] "Alarmed" scheduling App (automatic profile switching, gprs-data-resetting...)
 
Hi there.

I wrote a small App that acts as a GUI front-end and CLI-wrapper to maemos alarmd scheduler back-end. It's written in python and uses the PySide bindings to Qt.

Feature list:
  • Set all of the below to be executed at specific intervals (every minute, hourly, on specific weekdays, on last day of month etc...):
    • Recurring alarms
    • Reset the GPRS data counter
    • Switch to online/offline mode
    • Switch the profile to silent/general or any ProfilesX profile
    • Switch bluetooth on/off
    • Execute a custom command
    • More 'cron-like' stuff like this ;)
  • Saving presets for comman line executions
  • Enabling and disabling events
  • Complete CLI-Interface
  • Support for Cron syntax like "23,26 */3 1,2 * *"
  • Support for date syntax like "now + 10 minutes"

Notes:
  • Support for ProfilesX dropped in favour of Tweakr profiles
  • If it should happen that you create an event and for some reason it gets lost from Alarmed's menu/list, but still exists and acts, look in /var/cache/alarmd/alarm_queue.ini and you'll find your event somewhere at the bottom. It comes with a "cookie", which identifies it. For example: "cookie: 886". You can then use the CLI interface to delete the event. It will tell you it doesn't exist, but it will nevertheless delete the backend-event:
    Code:

    /opt/alarmed/alarmed.py -CD 886
    Don't mess with the alarm_queue.ini, you might do serious damage!
Allright, if you have read all this, you may install the App from extras-devel :)

Here are some screenshots:

http://imgur.com/vbC2t.png

http://imgur.com/kdmzH.png

http://imgur.com/P3kCN.png

http://imgur.com/5R6Fm.png

http://imgur.com/jbDoA.png

Changelog:
0.1.4-2:
  • Added flight mode enable/disable (thanks to rlinfati)
  • Fixed a bug in gprsdataresetter.py (thanks to rooted)
  • Slightly less frequently crashing due to some workarounds. Is stable at times, but still crashes at random due to pyside bugs.
0.1.4-3:
  • _Much_ more stable due to more workarounds (thanks avoozl on #pyside). Couldn't get it to segfault even once anymore!
0.1.4-4:
  • Fixed missing python-alarm dependency (thanks to hcm)
0.1.5-2:
  • Temporarly removed dbus from menu as it's not working anyway
  • Made it possible to put real commands with arguments and everything into the command exec line!
  • Added profile switching for silent and general profiles
0.1.6-2:
  • Added support for switching tweakr profiles!
  • A few small bug fixes
  • Switch to .sh files for small scripts
0.1.6-3:
  • Small fix in tweakr profile switching
0.1.7-1:
  • Added relative event settings ("tommorow", "next tuesday...", "in x seconds/minutes/hours/days")
  • Small bugfix in tweakr profile switching
0.1.7-3:
  • Small bug fixes
0.1.8-1:
  • Massive restructuring of code
  • Complete CLI interface added (see /opt/alarmed/alarmed.py -Ch for help)
  • Added support for cron-like strings, e.g. "23,26 * 1,2 * *"
  • Added support for date-like strings, if you have coreutils installed, e.g. "now + 10 minutes"
  • Minor bug fixes, probably introduced a couple of new ones.
0.1.8-2/3:
  • small fixes and fix for people not having bash installed (thanks evad)
0.1.9-1/2:
  • Cleaned up dependencies, no more boost! Pyside ftw.
  • Added bluetooth switch
  • Added saving/loading presets when using command line execution!
0.1.9-3/4:
  • GPRS counter reset fixed, resets both home and roaming at the same time.
0.1.9-5:
  • Switched around alarm buttons and added info message to alarm dialog.
0.1.9-6:
  • Improved list layout (no more sideways scrolling)
0.2.0-1:
  • You can now toggle (enable and disable) events!
0.2.1-1
  • Fixed a small bug that prevented events from being saved.
    Also incorporated patches by hunludvig and ForeverYoung:
  • UTF-8 for text
  • Removed tweakr support, instead added support for ProfilesX
  • Alarm buttons fixed
  • Fixed bug where deleted item remains in list
  • Improved cron syntax
    Thanks a lot for the contrubution!
0.3.0-1
  • New: Switching to a specific network (as requested by rotoflex)
  • New: Builtin functions: Switch to 2G, 3G or Dual Mode
  • Fixed: Scheduling for 'Next...' now works (as reported by Deserve)

rooted 2010-03-07 15:13

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Bug in gprsdataresetter.py: Type of gprs_reset_time key is string, so the proper command line input is:

gconftool-2 -s /system/osso/connectivity/network_type/GPRS/gprs_reset_time --type=string $(date +%s)

Stumbled upon it by chance. Was looking for command line option to reset GPRS counter (to use it with fcron), found it here! Thanks.

Bingley Joe 2010-03-07 15:20

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Thanks! This will be incredibly useful once you've got it stable..

rlinfati 2010-03-07 16:04

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Please, add a option to go offline ( fligth mode ) and go online ( normal mode ), thanks

cortex:/home/opt/alarmed# cat go-online.sh
#!/bin/sh

/usr/bin/dbus-send --system --dest=com.nokia.mce --type=method_call /com/nokia/mce/request com.nokia.mce.request.req_device_mode_change string:"normal"

cortex:/home/opt/alarmed# cat go-offline.sh
#!/bin/sh

/usr/bin/dbus-send --system --dest=com.nokia.mce --type=method_call /com/nokia/mce/request com.nokia.mce.request.req_device_mode_change string:"offline"

x-lette 2010-03-07 16:16

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Do I get it right this is a kind of crond with gui? That would be fantastic! But still I'm waiting for it getting more stable as I really depend on a working device :rolleyes:

shapeshifter 2010-03-08 13:18

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
new version! see first post for updates.

Quote:

Originally Posted by rooted (Post 558772)
the proper command line input is:
gconftool-2 -s /system/osso/connectivity/network_type/GPRS/gprs_reset_time --type=string $(date +%s)
Stumbled upon it by chance.

Thanks for this one! Fixed in 0.1.4-2.

Quote:

Originally Posted by rlinfati (Post 558812)
Please, add a option to go offline ( fligth mode ) and go online ( normal mode ), thanks

Added in 0.1.4-2 as a built-in function, thanks for supplying the scripts!

Quote:

Originally Posted by x-lette (Post 558824)
Do I get it right this is a kind of crond with gui?

Yep that's pretty much what it is, though the actual daemon (alarmd) is shipped with the n900 already. I just wrote a GUI for it.

hcm 2010-03-10 10:58

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
thank you very much, exactly what I was looking for :)

I think the package should depend on python-alarm, it was not installed automatically in my case…

Corwin 2010-03-10 11:13

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Thanks a lot for your work, very much appreciated.
Unfortunately it will not come up when I try to start it - nothing happens.

hcm 2010-03-10 11:16

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
@corwin: have a look at my post above, install python-alarm (apt-get install python-alarm as root)

shiny 2010-03-10 11:17

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Quote:

Originally Posted by Corwin (Post 562345)
Thanks a lot for your work, very much appreciated.
Unfortunately it will not come up when I try to start it - nothing happens.

I found that the python-alarm package was missing and had to install it manually. Could this be a dependency issue that needs fixing?


All times are GMT. The time now is 23:00.

vBulletin® Version 3.8.8