Notices


Reply
Thread Tools
Posts: 82 | Thanked: 25 times | Joined on Apr 2011
#1
maybe this is posted at the wrong place, plz move it then.


is there a way (command in xterm) to delete the list of alarms? with this i mean the list of previously used alarms at the clock (kinda hard to explain hope this is clear enough), it gets longer and longer..


thx!
 
Posts: 147 | Thanked: 150 times | Joined on Aug 2010 @ Finland
#2
Originally Posted by tim_de_wolf View Post
maybe this is posted at the wrong place, plz move it then.


is there a way (command in xterm) to delete the list of alarms? with this i mean the list of previously used alarms at the clock (kinda hard to explain hope this is clear enough), it gets longer and longer..


thx!
http://talk.maemo.org/showthread.php?t=57598

No terminal command, but you can manually remove the alarms from the text file. I think it's a reasonable solution for doing it once, you can prevent the list from growing large if you just edit an old alarm in it instead of always creating a new one. That's what I'm doing now, for the lack of a better solution.

Last edited by Aonsaithya; 2011-04-23 at 22:30.
 
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#3
Originally Posted by tim_de_wolf View Post
maybe this is posted at the wrong place, plz move it then.


is there a way (command in xterm) to delete the list of alarms? with this i mean the list of previously used alarms at the clock (kinda hard to explain hope this is clear enough), it gets longer and longer..


thx!
You can do it one-by-one by clicking on this alarm on a list, then on the right side of screen you have two buttons: "Delete" and "Save".
And you know, on this list, on the left side of each alarm name, there is a square - it is a checkbox. If you want to set alarm to the same time as before (the same hour during day), you can click this checkbox and it will activate alarm - you won't have to create new one with the same hour. This is very unintuitive in my oppinion, I discovered this behaviour accidentaly after few months of using the phone... (maybe I'm just stupid).

If you want another way, alarms are stored in /var/cache/alarmd/alarm_queue.ini , but don't delete this file, as it will remove also every calendar alarm (as discovered by CepiPerez in http://talk.maemo.org/showpost.php?p=738068&postcount=5 ). Someone could write a script which would parse this file and remove every alarm, which has line
attr0.attr_data.sval: osso-clock
and does NOT have line
action1.dbus_interface: com.nokia.calendar
inside... Anyone up to it?

Last edited by misiak; 2011-04-23 at 22:44.
 
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#4
Ok, as I'm learning python, I just tried to write it. USE IT AT YOUR OWN RISK

Code:
sudo gainroot
apt-get install wget
wget http://www.miskiewicz.org/files/alarmcleaner.py
python alarmcleaner.py
Wait for it to finish running and then reboot your phone.

I tried to keep all other alarms (calendar, and possibly other).

If it failed and after reboot you notice problems or alarms from calendar disappeared, my script made a copy, so you can restore it:
Open terminal and paste this:
Code:
sudo gainroot
cp /home/user/MyDocs/alarm_queue.copy.ini /var/cache/alarmd/alarm_queue.ini
And reboot once again.

If everything is fine, open file manager (from applications menu), select "N900" memory and delete alarm_queue.copy.ini file from your internal storage.

The source of script is as follows (if anyone is interested):
Code:
import os
import shutil
# file names
filename1 = '/var/cache/alarmd/alarm_queue.ini'
filename2 = '/home/user/MyDocs/alarm_queue.copy.ini'
# make a copy
shutil.copy(filename1, filename2)
# open files
f1 = open(filename2, 'r')
f2 = open(filename1, 'w')
# read file 1
f1lines = f1.readlines()
# write first 3 lines
f2.write(f1lines[0] + f1lines[1] + f1lines[2])
tmp = []
howMany1 = 0
howMany2 = 0
# do the magic
for i in range(3, len(f1lines)):
    tmp.append(f1lines[i])
    # empty lines indicate ends of single alarms
    if len(f1lines[i]) < 2:
        foundosso = False
        foundcalendar = False
        howMany1 = howMany1 + 1
        # check if there are these two specific lines in alarm description
        for j in range(0, len(tmp)):
            if tmp[j] == 'attr0.attr_data.sval: osso-clock\n':
                foundosso = True
            if tmp[j] == 'action1.dbus_interface: com.nokia.calendar\n':
                foundcalendar = True
        # if it is osso-clock and not calendar, do nothing, if else write to new file
        if not(foundosso and not(foundcalendar)):
            for k in range(0, len(tmp)):
                f2.write(tmp[k])
            f2.write('\n')
        else:
            howMany2 = howMany2 + 1
        tmp = None
        tmp = []
f1.close()
f2.close()
print 'Done'
print 'Total alarms found: ' + str(howMany1)
print 'Alarms removed: ' + str(howMany2)
print '(Rest of alarms is from calendar etc., I tried to keep them)'
print 'Please reboot your phone now'

Last edited by misiak; 2011-04-23 at 23:39. Reason: added code
 

The Following User Says Thank You to misiak For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:41.