! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCHSET] Add reminders
Status:
RESOLVED: MOVED
Product:
Xfce4-datetime-plugin
Component:
General

Comments

Description Olivier Brunel 2018-10-10 20:05:19 CEST
This is a patchset that adds reminders, i.e. alarms of sort that can be triggered on a given date & time. It also fixes issue where the date/time wasn't updated on resume, albeit only on Linux.

With it, it is possible to double-click on the calendar, to open a window where one can manage so-called reminders. A reminder is simply a date and time, a title, and optionally a (multi-line) description, a command line and/or a recurrence.
On the specified date & time, the reminder is said to expire, and will be shown in a window where one can either ask to be reminded later (in a specified interval), or delete/apply recurrence. On start, all expired reminders are shown.

Reminders are indeed not kept once expired, nor do they appear multiple times when recurring. Instead, once expired they are simply either removed, or recurrence is applied, i.e. they're reset to a newly calculated date/time (based on the original one, i.e. not accounting for any "remind later" delay).

Recurrence is simply a given amount of time being added, meaning one cannot do more complicated things such as "first Monday of the month". However, a command-line can be specified for each reminder, which can take variables to get the reminders date/time, title, etc and it is possible to simply create new reminders by writing their definitions to stdout (which is piped to the plugin).

It is also possible to easily import/export reminders.

Note that this can all be disabled using --disable-reminders on configure for those who don't want the bloat :)
Comment 1 Olivier Brunel 2018-10-10 20:05:59 CEST
Created attachment 8025 
datetime.h: Add missing include
Comment 2 Olivier Brunel 2018-10-10 20:07:19 CEST
Created attachment 8026 
Fix button refresh after suspend for Linux only

Refreshing the button (to update date/time) is done via timeouts, but the
way they're implemented in GLib means they're not suspend aware, thus
the timeouts simply "resume"/keep going on resume, and as a result the
update/refreshing might come a little while after needed/resuming from
suspend.

This is fixed by using suspend-aware timeout sources, based on absolute
time on CLOCK_REALTIME. However, this is implemented via Linux-specific
interface (timerfd) and thus only works there.

If needed for other unices, an implementation using POSIX timer_create
& co might do the trick (but will force to play with signals).

Fixes https://bugzilla.xfce.org/show_bug.cgi?id=9004 for Linux systems
Comment 3 Olivier Brunel 2018-10-10 20:07:47 CEST
Created attachment 8027 
Add calendar popup menu to go to/select today

Also refactor calendar creation via a function. This will all become
(more) useful in the next commit when adding reminders.
Comment 4 Olivier Brunel 2018-10-10 20:08:27 CEST
Created attachment 8028 
Add reminders

It is now possible to double-click on the calendar, to open a window
where one can manage so-called reminders. A reminder is simply a date
and time, a title, and optionally a (multi-line) description, a command
line and/or a recurrence.

On the specified date & time, the reminder is said to expire, and will
be shown in a window where one can either ask to be reminded later (in a
specified interval), or delete/apply recurrence.

On start, all expired reminders are shown.

Reminders are indeed not kept once expired, nor do they appear multiple
times when recurring. Instead, once expired they are simply either
removed, or recurrence is applied, i.e. they're reset to a newly
calculated date/time (based on the original one, i.e. not accounting for
any "remind later" delay).

Recurrence is simply a given amount of time being added, meaning one
cannot do more complicated things such as "first Monday of the month".
However, a command-line can be specified for each reminder, which can
take variables to get the reminders date/time, title, etc and it is
possible to simply create new reminders by writing their definitions to
stdout (which is piped to the plugin).

It is also possible to easily import/export reminders.

The file format for reminders, used for import/export, to save the
current reminders as well as for command-line's stdout, is as follows:

First line is the only one required:
YYYY-MM-DD HH:MM Ru Title goes here

Typical date/time information, then the number and unit for recurrence,
or 0 if none. Unit is one of MHdmY for minute, hour, day, month and year
respectively.

Optionally, there can be a command-line prefixed with $ and/or a
description; Since it can spread over multiple lines, description must
be prefixed with +N: where N is the number of additional lines (0 if
none)

Lastly, this can all be disabled using --disable-reminders on configure
Comment 5 Andre Miranda editbugs 2018-10-15 00:33:25 CEST
Hi Olivier,
This feature looks awesome and works pretty well.
I must assume I didn't review the code properly, but I've got some questions/considerations:

- That's quite an addition (4361 new lines) to datetime-plugin, a plugin that according to its name, it's meant to just show date and time.
- It's far from obvious that one can add reminders double clicking on the calendar.
- Why not Orage? It's much more complicated than your implementation, but I think it does what you want and more.

At some I hoped to archive datetime-plugin, because it's confusing to new users which plugin to use, one less thing to maintain and it offers nothing that can't be done with panel's clock.

So, I guess it makes sense to not extend datetime-plugin to something it is not meant to be. Instead, you are welcome to fork datetime-plugin into something else, e.g. xfce4-reminder-plugin, I can help you making it an official plugin.

Another venue to explore, is to simplify Orage's UI, for instance introduce "simple reminders" or hide advanced/complicated stuff in expanders.

I know you put a lot of effort into this, I have not the final word, another dev might merge your patches into datetime.
Comment 6 Olivier Brunel 2018-10-15 17:21:34 CEST
Hi Andre,

Right, in the end I forgot to mention the origin/motivations for writing this, my bad. So here it is:

I of course knew of Orage, but I wasn't looking for a (full blown) calendar application, and Orage, as lightweight as it may be, remains that, with the additional complications/complexities (tasks, events, categories, priorities, etc) that come with it. This isn't to criticize it of course, but simply highlight how I wasn't looking for a calendar app, merely one where I could set alarms or, well, reminders, in a very simple manner.

A reminder, to me, was simply a date & time, and a text to show/be reminded of, nothing more. I wanted something small & simple, and though I looked I never found anything that would work for me. Meanwhile, I always had the time shown in my panel, that I knew I could click to pop up a calendar, and I always thought that would be perfect: it's already (a small & simple thing) running, the UI already exist so it wouldn't even have to eat any more of my screen estate, if only I could (dbl-)click on that calendar and set some reminders, that would be ideal...

Time went by, I never found anything that worked for me, my need for such reminders grew, so I finally decided to see if I could write that panel plugin myself, and here we are.

About your questions:

- Yes, I realize it is quite an addition, that's also why I made sure it could be disabled at compile time. The datetime plugin seemed perfect to me, because it already had the whole time button/calendar thing done obviously, and I figured that would be another way to distinguish it from the internal clock plugin.
I'm not sure I'm in the best position to say which is better, "extend" datetime or create a new plugin reminders.

- You're right, it's not obvious when you don't know it. I could see about adding a tooltip to the calendar, saying something like "Double click to manage reminders" It might also be possible to add a button "Manage reminders..." on the preferences window to do the same thing as well.

- As previously explained, Orage does (way) more than what I was looking for, and I wasn't looking for all that. I really wanted something small & simple, even more so than Orage. Not a calendar, just a way to set reminders. (As big this addition looks to datetime, on my system here the package for this new datetime is about 195 KiB (126 KiB for the original one), whereas the one for Orage is 5,201 KiB.)


Hopefully I answered everything, if not just let me know.

Cheers,
Comment 7 Alexander Kurakin 2019-09-30 21:51:27 CEST
Any news on this?
Comment 8 Git Bot editbugs 2020-05-23 01:24:32 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/panel-plugins/xfce4-datetime-plugin/-/issues/23.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #14748

Reported by:
Olivier Brunel
Reported on: 2018-10-10
Last modified on: 2020-05-23

People

Assignee:
Florian Rivoal
CC List:
2 users

Version

Version:
unspecified

Attachments

datetime.h: Add missing include (628 bytes, patch)
2018-10-10 20:05 CEST , Olivier Brunel
no flags
Fix button refresh after suspend for Linux only (7.98 KB, patch)
2018-10-10 20:07 CEST , Olivier Brunel
no flags
Add calendar popup menu to go to/select today (5.65 KB, patch)
2018-10-10 20:07 CEST , Olivier Brunel
no flags
Add reminders (135.19 KB, patch)
2018-10-10 20:08 CEST , Olivier Brunel
no flags

Additional information