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?

Corwin 2010-03-10 11:30

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
hcm, shiny, that did the trick. Thanks a lot!
Data counter reset set up, happy :)

Best regards,
Corwin

F2thaK 2010-03-10 11:34

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
i wish someone would make an app like this that can swap between "tweakr" profiles at given times

shapeshifter 2010-03-10 11:39

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

Originally Posted by hcm (Post 562335)
I think the package should depend on python-alarm, it was not installed automatically in my case…

Oops, thanks for pointing this out! Fixed in new build 0.1.4-4

Quote:

Originally Posted by Corwin (Post 562345)
Unfortunately it will not come up when I try to start it - nothing happens.

This should be solved with the fixed dependency issue, hopefully.

jukey 2010-03-10 13:50

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

first of all: I do love this application. It's easy to use and has a nice interface. It also seems to work perfectly.

One little bug:

1. Select "New event"
2. Select "Alarm" and switch to "Command execution"
You will see input fields "Enter name" and "Enter command" In both of them the first letter always is upper case. If you hit "Shift" first the first letter in the line is lower case.

Thanks a lot, Uwe

raverpol 2010-03-10 14:22

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
nice appl :) but why there is not "first day of a month" option while there is last day option? hehe :)

shapeshifter 2010-03-10 22:04

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

Quote:

Originally Posted by f2thak (Post 562365)
i wish someone would make an app like this that can swap between "tweakr" profiles at given times

I looked into this, but atm I don't see a way to properly interact with the tweakr profiles. I contacted the author of tweaker and I guess we'll find a solution. Until then, Alarmed now supports switching between the default "silent" and "general" profiles as of 0.1.5-2!

Quote:

Originally Posted by jukey (Post 562534)
In both of them the first letter always is upper case. If you hit "Shift" first the first letter in the line is lower case.

I'm pretty sure this is standard behavior for input fields in all of maemo! You can see this happening anywhere. It's called "auto-capitalization" and you can turn it off in "Text Input" in the n900 settings menu. Apart from that, it should be possible to turn this off for single text fields but it seems like this feature is not available in pyside yet. When it becomes available, I'll insert it for the exec line.
Btw, note that now it should be possible to put in complete commands into the line including arguments. So it's no longer neccessary to write seperate scripts and put them in.

Quote:

Originally Posted by raverpol (Post 562566)
why there is not "first day of a month" option while there is last day option?

This is a restriction in the alarmd scheduling daemon provided by maemo. They just didn't include that, sorry ;)

jcg81 2010-03-10 22:31

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Very interesting app! Is there a way to add a feature of day/time based call forwarding? ie. forward calls on weekdays to google voice. thanks.

shapeshifter 2010-03-13 18:39

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

Alarmed now supports tweakr profile switching!

Quote:

Originally Posted by f2thak (Post 562365)
i wish someone would make an app like this that can swap between "tweakr" profiles at given times

Done! I added this feature in 0.1.6-2 :)

Quote:

Originally Posted by jcg81 (Post 563094)
Very interesting app! Is there a way to add a feature of day/time based call forwarding? ie. forward calls on weekdays to google voice. thanks.

It's definitely possible, I'm adding it to the planned features list and will be looking into it :)

lemmyslender 2010-03-13 19:39

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
I've installed 0.1.6-2 and tried a couple times to set profile switching, both tweakr created and fro general to silent.

Neither appear to be working?

shapeshifter 2010-03-13 23:26

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

Originally Posted by lemmyslender (Post 566279)
I've installed 0.1.6-2 and tried a couple times to set profile switching, both tweakr created and fro general to silent.

Neither appear to be working?

I'm sorry, it appears to be working fo me, can you please run it from a command line? to do so, open an X-Terminal from the applications menu -> more and type in /opt/alarmed/alarmed.py
try to set the profile with a timing rule and post any output it gives (e.g. to a service like www.pastie.org or in this forum.) also, please paste the complete outpu of 'cat /var/cache/alarmd/alarm_queue.ini' so I can debug the problem. thanks :)

lemmyslender 2010-03-14 00:47

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
OK, per request, cat of alarm_queue.ini before running alarmed
Code:

~ $ cat /var/cache/alarmd/alarm_queue.ini
[config]
snooze: 600

[#00000001]
cookie: 1
trigger: 1268564485
flags: 132288
alarm_appid: ham_updates_status_menu_item
alarm_time: 1230894085
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_secs: 86400
recur_count: -1
action_cnt: 1
action0.flags: 4130
action0.dbus_interface: com.nokia.hildon_update_notifier
action0.dbus_service: com.nokia.hildon_update_notifier
action0.dbus_path: /com/nokia/hildon_update_notifier
action0.dbus_name: check_for_updates

[#0000006b]
cookie: 107
trigger: 1265684340
title: Alarm
message: Tb
icon: qgn_list_hclk_alarm
flags: 7216
alarm_appid: worldclock_alarmd_id
alarm_time: -1
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: 21
alarm_tm.tm_min: 59
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
action_cnt: 2
attr_cnt: 1
action0.flags: 65
action0.label: cloc_bd_alarm_notification_snooze
action1.flags: 1088
action1.label: cloc_bd_stop
attr0.attr_name: textdomain
attr0.attr_type: 3
attr0.attr_data.sval: osso-clock

[#00000128]
cookie: 296
trigger: 1269061200
flags: 131072
alarm_appid: data_reset
alarm_time: 1269061200
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_count: -1
action_cnt: 1
recurrence_cnt: 1
action0.flags: 36
action0.exec_command: /opt/alarmed/gprsdataresetter.py
recurrence_tab0.mask_min: 1
recurrence_tab0.mask_hour: 1
recurrence_tab0.mask_mday: 1048576
recurrence_tab0.mask_mon: 4095

[#00000179]
cookie: 377
trigger: 1268527500
flags: 131264
alarm_appid: modest
alarm_time: 900
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_secs: 900
recur_count: -1
action_cnt: 1
action0.flags: 4130
action0.dbus_interface: com.nokia.modest
action0.dbus_service: com.nokia.modest
action0.dbus_path: /com/nokia/modest
action0.dbus_name: SendReceive

and alarmed.py - set a profile switch to "night" profile
Code:

~ $ /opt/alarmed/alarmed.py
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout

and alarm_queue.ini after
Code:

~ $ cat /var/cache/alarmd/alarm_queue.ini
[config]
snooze: 600

[#00000001]
cookie: 1
trigger: 1268564485
flags: 132288
alarm_appid: ham_updates_status_menu_item
alarm_time: 1230894085
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_secs: 86400
recur_count: -1
action_cnt: 1
action0.flags: 4130
action0.dbus_interface: com.nokia.hildon_update_notifier
action0.dbus_service: com.nokia.hildon_update_notifier
action0.dbus_path: /com/nokia/hildon_update_notifier
action0.dbus_name: check_for_updates

[#0000006b]
cookie: 107
trigger: 1265684340
title: Alarm
message: Tb
icon: qgn_list_hclk_alarm
flags: 7216
alarm_appid: worldclock_alarmd_id
alarm_time: -1
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: 21
alarm_tm.tm_min: 59
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
action_cnt: 2
attr_cnt: 1
action0.flags: 65
action0.label: cloc_bd_alarm_notification_snooze
action1.flags: 1088
action1.label: cloc_bd_stop
attr0.attr_name: textdomain
attr0.attr_type: 3
attr0.attr_data.sval: osso-clock

[#00000128]
cookie: 296
trigger: 1269061200
flags: 131072
alarm_appid: data_reset
alarm_time: 1269061200
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_count: -1
action_cnt: 1
recurrence_cnt: 1
action0.flags: 36
action0.exec_command: /opt/alarmed/gprsdataresetter.py
recurrence_tab0.mask_min: 1
recurrence_tab0.mask_hour: 1
recurrence_tab0.mask_mday: 1048576
recurrence_tab0.mask_mon: 4095

[#00000179]
cookie: 377
trigger: 1268527500
flags: 131264
alarm_appid: modest
alarm_time: 900
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
recur_secs: 900
recur_count: -1
action_cnt: 1
action0.flags: 4130
action0.dbus_interface: com.nokia.modest
action0.dbus_service: com.nokia.modest
action0.dbus_path: /com/nokia/modest
action0.dbus_name: SendReceive

[#0000017a]
cookie: 378
trigger: 1268527200
flags: 131072
alarm_appid: To_Night
alarm_time: 1268527200
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
action_cnt: 1
action0.flags: 36
action0.exec_command: /bin/ash -c '/opt/alarmed/tweakrprofileswitcher.sh Night'

Failed to switch to "Night" profile. Setting a normal alarm works.

lemmyslender 2010-03-14 01:01

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Went into opt/alarmed and ran tweakrprofileswitcher Night
Code:

/home/opt/alarmed $ /bin/ash tweakrprofileswitcher.sh Night
/home/opt/alarmed $ method return sender=:1.1 -> dest=:1.194 reply_serial=2
  boolean true

It paused there for a couple minutes until I hit enter. Checking the profile, it said Night, but hadn't changed any of the settings.

F2thaK 2010-03-14 02:16

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
okay it doesnt support tweakr profiles??

F2thaK 2010-03-14 09:27

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
okay NOW IT SUPPORTS TWEAKR PROFILES :D


THANKS

shapeshifter 2010-03-14 11:12

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

Originally Posted by lemmyslender (Post 566473)
OK, per request, cat of alarm_queue.ini before running alarmed

Thanks for all the useful info and for reporting the bug :)
There was a small bug in tweakrprofileswitcher.sh, which is now fixed. As you said, it only changed the name, but didn't set anything.
It's fixed in 0.1.6-3

qw3rty 2010-03-14 11:37

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
How about supporting IM status changes, is that possible in the future?

F2thaK 2010-03-14 14:28

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

Originally Posted by shapeshifter (Post 566742)
Thanks for all the useful info and for reporting the bug :)
There was a small bug in tweakrprofileswitcher.sh, which is now fixed. As you said, it only changed the name, but didn't set anything.
It's fixed in 0.1.6-3

tested, but does NOT work for me......... :(

I really want this

rooted 2010-03-14 14:36

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
shapeshifter: take a look at this, also compare your existing scripts, because there are 100% right ones here:

http://wiki.maemo.org/Phone_control

shapeshifter 2010-03-14 15:19

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

Originally Posted by f2thak (Post 566871)
tested, but does NOT work for me......... :(

What exactly does not work? Are you sure you have 0.1.6-3 (and not 0.1.6-2)? Please post the output of
Code:

cat /var/cache/alarmd/alarm_queue.ini
and describe step by step what you're doing and what the outcome is (i.e. does the tweakr profile name change or does nothing happen at all etc.)

Quote:

Originally Posted by rooted (Post 566880)
shapeshifter: take a look at this, also compare your existing scripts, because there are 100% right ones here:
http://wiki.maemo.org/Phone_control

Sorry, what's with that? I know about that page. But of course there's nothing on tweakr profiles in there. Normal profile switching works. Tweakr profile switching requires more work to be done, but it seems to work for me (triplechecked if it really adjusted the profile settings etc.)

lemmyslender 2010-03-14 17:06

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Getting warmer. Still doesn't switch either regular or tweakr profiles for me. Ran tweakrprofileswitcher.sh from command line. Changes the settings and name, but doesn't exit back to command line.

However, if I use "Command Execution" with the line "/bin/ash /home/opt/alarmed/tweakrprofileswitcher.sh Night" (no quotes) it works!

If you want other info, ask

Thanks

shapeshifter 2010-03-14 17:25

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

Originally Posted by lemmyslender (Post 566962)
Changes the settings and name, but doesn't exit back to command line.

However, if I use "Command Execution" with the line "/bin/ash /home/opt/alarmed/tweakrprofileswitcher.sh Night" (no quotes) it works!
If you want other info, ask

That is totally weird. The strange fact is, that if it A) does work when you specify it manually, and B) does change the name of the profile when you use the built-in menu but C) does not change any settings in that case, it would mean that 1.) the script gets run in both cases but 2.) in the second case, something is different in the surroundings. For me, if I define an action using the builtin-menu, the event looks like this:

Code:

[#00000508]
cookie: 1288
trigger: 1268587260
flags: 131072
alarm_appid: Enter_name
alarm_time: 1268587260
alarm_tm.tm_year: -1
alarm_tm.tm_mon: -1
alarm_tm.tm_mday: -1
alarm_tm.tm_hour: -1
alarm_tm.tm_min: -1
alarm_tm.tm_wday: -1
alarm_tm.tm_yday: -1
alarm_tm.tm_isdst: -1
action_cnt: 1
action0.flags: 36
action0.exec_command: /bin/ash -c '/opt/alarmed/tweakrprofileswitcher.sh Night'

And it works! It changes the name and all the settings.

Could you please post the relevant event from /var/cache/alarmd/alarm_queue.ini from both cases? One, where you defined the event manually from command execution, and one where you did it from the built-in function?

Thanks for the help :)

lemmyslender 2010-03-14 17:34

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
I just modded alarm.py line 589 to remove the -c and ' from the line. That gives me the same output as the command execution in alarm_queue.ini, and it works. Give me 10 and I'll revert the code and set 2 profile changes, one each way and paste alarm_queue.ini and the results'

*edit* before changing both commands were the same.

shapeshifter 2010-03-14 17:41

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
I think I found the problem. there's a superfluos "read" in tweakrprofileswitcher.sh which only gets active (and blocks the script) when running it with ash -c. Let me fix it. (This also explains why it works on my phone, I had a manually copied over version of that script...)

edit: can't update the package at the moment because the maemo autobuilder queue is broken. It's been a couple of hours already. Don't know when it's gonna be fixed.

ndi 2010-03-14 17:52

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Could we get relative alarms please?

I've always wanted relative alarms. For example, I want to sleep for an hour. Right now, I have to eyeball the watch (or task switch), compute stuff like an hour 45 minutes, set an alarm, all with red eyes.

I'd like a quick way to set an alarm in relative terms. On NT, I use AT to schedule alarms because it takes relative timing, e.g. one can AT +1:00:00 Alarm.exe (the plus makes it relative). I'm thinking CLI alarms are a bit odd (though I'd love them) but a GUI like Alarmed could be useful, perhaps as a type of alarm?

I would also love presets for that unambiguous date thing. If i want to wake up tomorrow at 7 or Monday at seven I have to do math date with no calendar in sight. For example, date should have a pre-selection popup or a special popup that includes presets like "Tomorrow". It's organic to set an alarm "Tomorrow at 7" not 15th of 3rd month, 2010.

And finally, it would be nice if (assuming this is within the scope of this app) to define alarms, custom-wise. For example, have a command line as an alarm preset. I could get a beep.mp3 and "mplayer /beep.mp3" (whatever) and name it "beep" if I want it to beep every hour, a wakeup alarm isn't always best. (ETA: I know it has command lines, I was suggesting presets)

Well I have a few more but that's basically what's been grinding me about alarms. I wish I had a quick popping app on desktop that does "new alarm" and I'd have three scrollbars, one for day (Today, Tomorrow, Wednesday, Thursday - since today is Monday, tomorrow is Tuesday - and after a few days (2-3), it goes on as 15, 16, 17, etc), the second would be hour and the third minute, ideally with 00, 15, 30 and 45 at the top, followed by 01, 02, 03).

Then it would be easy to add an alarm for tomorrow at 7.

lemmyslender 2010-03-14 18:15

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

Originally Posted by shapeshifter (Post 566989)
I think I found the problem. there's a superfluos "read" in tweakrprofileswitcher.sh which only gets active (and blocks the script) when running it with ash -c. Let me fix it. (This also explains why it works on my phone, I had a manually copied over version of that script...)

edit: can't update the package at the moment because the maemo autobuilder queue is broken. It's been a couple of hours already. Don't know when it's gonna be fixed.

OK I lied in my previous post. Editing the code lead to different commands in alam_queue.ini, I had made several changes and was mistaken.

But you found the error anyway. Cool :)

It took forever this today to get app manager to see the update and download the current version. I guess it'll get fixed when it gets fixed.

Looking forward to the new version. In the meantime, I have a workaround anyway.

Thanks for the great program. I'll probably end up using it with ermining to sync multiple calendar with google. The next version of ermining should support command line syncing again. That'll get me away from the buggy MfE and only being able to sync one calendar and eliminate a bug with email related to MfE.

rooted 2010-03-14 18:37

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

Originally Posted by shapeshifter (Post 566899)
Sorry, what's with that? I know about that page. But of course there's nothing on tweakr profiles in there. Normal profile switching works. Tweakr profile switching requires more work to be done, but it seems to work for me (triplechecked if it really adjusted the profile settings etc.)

I know there's not anything about tweakr profiles, I was talking about a possibility that you add many predefined functions and also check whether you have right commands (dbus calls without -reply options are a bit faster).

shapeshifter 2010-03-15 09:56

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
New version! See first post for details!

Quote:

Originally Posted by ndi (Post 566994)
Could we get relative alarms please?

Done! :) Alarmed now supports:
  • In... X seconds/minutes/hours/days
  • Tommorow at xx:xx
  • Next... Monday..Friday at xx:xx
Hope it's working fine! (And I hope I didn't introduce any breakage to old features...)
Also, I'm not all too happy with the spinbox for the number of s/min/h/d. Requires an awful lot of tapping or using the keyboard. And I didn't find a way to make they keyboard automatically switch to "fn" mode for typing in numbers. I'll see if I can improve this.


Quote:

Originally Posted by ndi (Post 566994)
And finally, it would be nice if (assuming this is within the scope of this app) to define alarms, custom-wise. For example, have a command line as an alarm preset. I could get a beep.mp3 and "mplayer /beep.mp3" (whatever) and name it "beep" if I want it to beep every hour, a wakeup alarm isn't always best. (ETA: I know it has command lines, I was suggesting presets)

I'll look into it.

Quote:

Originally Posted by lemmyslender (Post 567011)
Thanks for the great program. I'll probably end up using it with ermining to sync multiple calendar with google. The next version of ermining should support command line syncing again. That'll get me away from the buggy MfE and only being able to sync one calendar and eliminate a bug with email related to MfE.

Cool idea. Glad you like it :)

Quote:

Originally Posted by rooted (Post 567028)
dbus calls without -reply options are a bit faster.

Ah, thanks for the hint! I didn't know that. I'll adjust them for the next release.

ndi 2010-03-15 10:44

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

Nothing broken thus far.

lemmyslender 2010-03-15 12:16

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
Built-in profile switching still not working for me.

Command line switching via tweakrprofileswitch.sh script still works fine though.

Caesar 2010-03-15 13:39

Re: [Announce] "Alarmed" scheduling App (supports automatic GPRS data counter resetting)
 
i installed it and time scheduled switching between tweakr-profiles does not work. any recommendations? i allready rebooted the device in case some changes are only applied after rebooot, but that did not change anything?!


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

vBulletin® Version 3.8.8