-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alarm user on alarm #148
Comments
Khal could use |
Also I think @michaeladler wrote something like this for his own use? |
Without thinking too much about this, I'm not a fan of writing our own Quoting Markus Unterwaditzer (2015-01-29 18:05:40)
|
Somehow the workflow would be, write a cronjob that polls every X minutes from khal events within next X minutes events and pass those events to |
@untitaker: Nope, I pretty much wrote the opposite: a tool that removes annoying alerts from ics-files :) |
@michaeladler I would like to be annoyed by such a tool, any name in mind ? |
I'm happy to support any such endeavor with any custom functions needed, but won't get to implement the tool itself for quite some time. |
@mbaldessari 's suggestion: It would be extremely cool to have something (just thinking aloud here) like: |
I think that's problematic. If the command you posted were to be executed every hour, it could miss events that are happening within 60 mins and were synced recently. If the user tries to mitigate this by calling that command more often, the given script would be executed multiple times for one event. I think a better approach is a hook in the config file that is called whenever khal pleases to do so. But in that case, the next version of vdirsyncer will include such a hook, it will invoke a script for each new or updated ics file, thanks to @michaeladler. |
Commit susmentioned is this one I guess: pimutils/vdirsyncer@2084534 . Cool stuff. The easiest way would to go for the hook would be to remove all the previously registered cronjobs and recreate them. |
@teto In that case you might as well not rely on any hooks, and traverse the directories yourself. I suppose we'll need another hook for deleting items? |
I was not sure if the hook would react on a delete but it is needed I guess. You say " traverse the directories yourself." but how often ? you can do it every every X min or when the hook triggers. This way you skip useless updates. Tracking changes on a 1 to 1 mapping looks harder to me then just reset cronjobs. I dunno if there is exists a ID/hash per event ? |
I'm not sure if This external job/notification tracker can either:
I've no real strong preference. |
I think a daemon would be much easier to implement and get right. If you have a |
It certainly gives us more flexibility for more sophisticated features. Perhaps this daemon can also keep the database in memory, so the CLI has nicer On Fri, Aug 07, 2015 at 10:22:17PM -0700, Ben Boeckel wrote:
|
As an alternative to the daemon solution gcalcli (https://github.com/insanum/gcalcli) proposes a remind command as a cronjob. Looks easier to implement ? |
IMO, you're going to want to run every 10 minutes or so anyways, so I see no reason not to just run as a daemon. No daemonization logic is needed either; use |
I think the most low-hanging fruit for alarms would be to have My personal needs would be fine with that approach. |
feel free to send an PR :) |
I don't think it's much easier and also it would mean having the UI open at all times ? not very practical. |
If you use tmux (or screen) like I do then it's perfectly practical. Otherwise I'm not sure precisely what you'd use for notifications. |
Have it send a notification over D-Bus and if the required modules aren't available or the config disables it, output to stdout for processing by any tool. |
IMO, Todo and calendar apps are completely different things. Calendars document things that happen while Todo lists document things to be done. They require different logic to handle properly. Personally I use taskwarrior since it supports more complex queries and attributes than iCal does. To that end, I don't think these things should be conflated just because they both need to notify a user. An alarm for an event is usually set in time for me to get to an event while a task for that event may require subtasks, a week of lead time, and resulting "products". |
@mathstuf I meant that the file format for both alarms is the same (quite literally, by the way, since it's exactly the same spec). So my idea is basically: Some for of daemon that reads alarms from vdirs:
If you're using a different task management app/format that should be no problem; this proposal has no ties to todoman [nor khal, for that matter], just to vdir+icalendar, which is the format both use. |
Ah, that sounds suitable then. |
@geier @untitaker How do you feel about this idea? I can get a proof-of-concept at some point. :) |
Have at it if you want, I don't see myself using something like that at the moment, but who knows, I also thought colored days were useless and now I use them all the time. |
Hi all, can somebody tell me the status of notifications. Is currently somebody working on this topic? |
Not that we know of. It is a pretty big effort.
…On 2 November 2017 14:25:44 GMT+01:00, Fabian Panzer ***@***.***> wrote:
Hi all, can somebody tell me the status of notifications. Is currently
somebody working on this topic?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#148 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I have been inspired by vdirsyncer, khal and todoman to create a daemon that notifies about event stored in a vdir: https://github.com/nicoe/remhind there are still some rough edges related to the handling of VTODO but I'm working on it |
Hello there, I'm too trying to get event notification works. My first goal is to simply have a script that will notify-send if an event start in now + the event before alarm delay. I'll then cron run this script every minutes. I got a problem, I canno't search events using event alarm values. I think an enough use case could be Swimming 17:30 18:00 alarm 10 minutes before $ now '+%H:%M' $ now '+%H:%M' $ now '+%H:%M' $ now '+%H:%M' But we need to find events that want to alarm us at a given time. What do you thing about this ? |
@Eluminae I think you should consider using / improving @nicoe's remhind. The main difference is that (at least in design - I haven't tried it or read the code myself) it's a daemon with automatically updated schedule of notifications. This is much easier to setup / install - from the user's point of view. I haven't read remhind's implementation details but I tend to think it could be implemented better. Here are my two cents just out of reading the README:
|
I think the nicoe's implementation is interesting but I got some reasons to not use it
Maybe the ikhal could provide a notification daemon but it would still need for that to be able to query with alarms. Don't you think this feature could be in the khal responsibility scope ? |
The problem with We've discussed this a bit before, and having a separate application that just handles alarms for all ICS files made sense the most. |
Huge good point about calendar reminders. I want them too. I'll reconsider options :) |
I hope I didn‘t miss anything (didn‘t read the full discussion) but I use vdirsyncer and I convert all my ics files (using awk) to the remind format and restart the remind agent afterwards. |
@Anachron could you expand on your method a bit? Do you run the conversion via cron? |
A |
I didn't know about the vdirsyncer hook, so yes, for now I run my |
Would you mind sharing the script? |
Sure, I am not sure how well it works for your setup though: update-remind:
(You'll have to edit the ~/app/dat/remind/remind.rem path) and ics2rem:
(You'll have to edit the ~/usr/cal path) ics2rem.awk:
|
I am thinking about having a go to at making remhind good. I have tested it right now and a few things have popped up:
I am writing here to understand what the general consesus is regarding the configuration and parsing events. I think it would be perhaps be a good idea to use the What do you think some important aspects as far as the integration with other projects and architecture are? Thanks |
* Robin Opletal [2021-06-10 19:44 +0200]:
I am thinking about having a go to at making remhind good.
Thank you for your interes in remhind. Please feel free to fork, hack and
change anything in it.
I am not using it anymore (my nextcloud client does the event notification now)
so I lost a bit of interest in it.
|
I have a couple of tools that listen for changes in my caldav collections, and trigger updates, one in go and one as a simple shell script. The principle is:
I think the same idea can be used for an alarms daemon:
Using Note that I mention Maybe in simple tabular format? $ khal alarms
Today, Sat 2021-06-12
19:00 19:30-20:30 Have fun (format is Or maybe JSON? $ khal alarms --json
[
{"eventName": "Have fun", startTime: 1621953998, "endTime": 1621953998, "alarms": [1621953998]}
] |
I'm dropping my shell script here which gives a big rofi notification pop-up whenever an alarm is coming up. I wrote this since nothing posted here so far fits my needs. Maybe someone will find this useful.
|
Here's a Python script to notify for all events in advance according to the set #!/usr/bin/env python3
"""Notify for all Khal events in advance.
According to the set NOTIFY_MINS (list of minutes in advance to get a
notification).
"""
import datetime
import re
from typing import List, Pattern
from sh import khal, notify_send
NOTIFY_MINS: List[int] = [1, 5, 15, 60]
events: str = str(khal("list", "--notstarted", "today", "today", _tty_out=False))
regex: Pattern = re.compile("^([0-9]{2}:[0-9]{2})-([0-9]{2}:[0-9]{2}) (.*)$")
now: datetime.time = datetime.datetime.now().time()
for line in events.split("\n"):
matches: List[str] = regex.findall(line)
if len(matches) != 1:
continue
start: datetime.time = datetime.time(*tuple(map(int, matches[0][0].split(":"))))
end: datetime.time = datetime.time(*tuple(map(int, matches[0][1].split(":"))))
if " :: " in matches[0][2]:
title, description = matches[0][2].split(" :: ")
else:
title = matches[0][2]
remaining = datetime.datetime.combine(
datetime.date.min, start
) - datetime.datetime.combine(datetime.date.min, now)
remaining_minutes: int = round(remaining.total_seconds() / 60)
print(remaining_minutes)
if remaining_minutes in NOTIFY_MINS:
notify_send(
f"Upcoming calendar event: {title}",
f"{matches[0][0]}-{matches[0][1]} in {remaining_minutes} mins.",
) |
Thanks for that python script. with a few changes it does exactly what I needed |
|
Alarms is a feature which I am missing too. I think, to print them by khal and shedule them by an external program is a good idea. I like way as suggested by @WhyNotHugo:
I started working on this, but there are some questions I'd like to discuss: FormatIt is not very simple to add a format-string alarm-time and just call event.format(), because there can be more than one alarm per event, so the event-object would'nt know which alarm to print. I can see two ways to handle this:
the output of this command is primarily intended to be processed by other programs, therefore I think, the second method should be okay. ConfigI think we need two timedelta-parameters. One that specifies for which period triggering alarms should be issued and one in which period events with alarms should be searched for. My alarms are mostly not longer than some hours before the event or some hours after the start of the event in case of whole day events like birthdays. However, as far as I know, there is no limit, so we should give users the ability to set the time to search. I am not sure about the names for the parameters. What do you think about alarm_timedelta and alarm_search_timedelta? I am not realy sattisfied with this names, so if someone has better suggestions ... |
I had looked for a program like khal one year ago without success but I am very glad to have found it. My question is not directly related but might become. I am looking for a daemon able to read my calendar and warn me via popups when an event is closing in. Thunderbird does warn me but only when it's open. So I was wondering if anyone knew of such a tool and if not, would it make sense to divide khal into a daemon and a client application (as urxvt or powerline).
The text was updated successfully, but these errors were encountered: