Skip to content

Talk Calendar is a personal desktop calendar for Linux which has some speech capability.

License

Notifications You must be signed in to change notification settings

crispinprojects/talkcalendar

Repository files navigation

Talk Calendar

Talk Calendar is a personal desktop calendar for Linux which has some speech capability. This version of Talk Calendar uses it own built-in speech synthesizer which means it can be can compiled without any external speech library dependencies and so should be universal across different distributions.

If your distro supports libFlite you may want to use the Flite shared library version of Talk Calendar which can be found here. This integrates the Flite speech synthesizer shared library into Talk Calendar and provides enhanced speech functionality.

Talk Calendar has been developed using C and GTK4 for GTK desktops (GNOME, Cinnamon, XFCE etc.).

A screenshot of Talk Calendar is shown below.

Core Features

  • built with C and GTK4 for GTK based desktops
  • month view calendar
  • event details, location, start and end time can be entered and edited
  • calendar tooltips and multiday event display
  • export and import iCalendar files (backup and restore)
  • built-in diphone speech synthesiser
  • Sqlite3 database used to store events

Local Install Using Pre-built Binary (x86 Intel PCs)

A pre-built 64-bit x86 Talk Calendar executable is available and can be downloaded from the binary directory. This has been built using GTK 4 and compiled using Ubuntu 24.04 on Intel hardware assuming GTK4.8 to be compatible with Debian 12 and Raspberry Pi OS.

Extract the downloaded file which contains the Talk Calendar executable. Talk Calendar must have executable permissions to execute. Change Talk Calendar file permissions so that it can run as an executable as shown below.

sudo chmod +x talkcalendar

Assuming that the GTK4 base libraries are installed the Talk Calendar binary can be run from the terminal using:

./talkcalendar

Desktop System Menu Entry

To add Talk Calendar to the system menu modify the Talk Calendar desktop file provided in the download. A desktop file has a .desktop extension and provides metadata about an application such as its name, icon, command to execute and other properties. For user-specific applications desktop files can be located locally in the ~/.local/share/applications/ directory. Local user entries take precedence over system entries. For the GNOME desktop, the desktop file should be named using the application ID, that is <application_id>.desktop, which in this case is "org.gtk.talkcalendar.desktop"

You need to modify the "org.gtk.talkcalendar.desktop" file using your own user name and directory locations. For example, if your user name is "sam" and you install local applications in a folder called "Software" and you create a folder called "talkcalendar " to store the Talk Calendar binary executable then the executable path would be "Exec=/home/sam/Software/talkcalendar/talkcalendar". The Exec variable defines the command to execute when launching an application, in this case, the talkcalendar binary executable. The Path variable tells the system where to look for the executable and the calendar database. The Icon variable specifies the path to the icon file associated with the application. In a .desktop file, you need to use absolute and full paths.

Copy the "org.gtk.talkcalendar.desktop" file to the ~/.local/share/applications/ directory. Create the ~/.local/share/applications/ directory if it does not already exist. This way of locally installing Talk Calendar should be universal across different Linux distributions.

Autostart Talk Calendar

Copy the "org.gtk.talkcalendar.desktop" file to ~/.config/autostart to start Talk Calendar when the computer is switched on. Talk Calendar can then read out the current date and day events and any future upcoming events (see preferences settings) when the computer is switched on.

Calendar Usage

If you have used a calendar application before then using Talk Calendar will be straight forward.

Adding New Event

  • Click on the "New Event" button in the header bar or press Ctrl+n to invoke the "New Event" window
  • Enter the event summary
  • Enter the event description
  • Enter the location
  • Enter the start date by setting the day, month and year values
  • Enter start and end times (or tick the all day check box)
  • Times are entered as hour and minute values using the 24-hour time notation
  • Events are sorted by start time when displayed
  • Check the "Is Yearly" check box if the event repeats every year (e.g. birthdays and anniversaries)

A screenshot of the new event dialog is shown below.

Editing Existing Event

  • Select the event in the list view and either select "Event->Edit Selected Event" from the menu or press Ctrl+e
  • Change details as appropriate

Searching For Events

  • Select the Event->Search menu item
  • Enter a search term or location.

Preferences

  • Select Calendar->Preferences from the menu or use Ctrl+Alt+p to invoke the preferences window (see screenshot below)
  • Change options as required

You can use 12 hour format. Event end-times can also be shown in the list view. Public holidays can be displayed on the calendar which are also spoken.

Colours have to be entered manually using RGB values. You can use the w3Schools RGB calcuator for selecting a RGB colour.

Talk options can be changed. The option "Speak At Startup" allows Talk Calendar to read out the current date and day events when the calendar is started.

Talking

  • Press the t key to readout the current time.

  • Press spacebar to readout event details for the date selected.

Information

  • Select "Help->Information from the menu or press F1

  • the information window shows the keyboard shoutcuts, how many records are in the database, the Sqlite version being used on the system, the desktop font and scale factor.

  • Use the About dialog to display the Talk Calendar current version.

Keyboard Shortcuts

Ctrl+n			New Event
Ctrl+e			Edit Selected Event
Ctrl_Alt+p		Preferences window
Spacebar		Speak
t			Speak Time
F1			Information

Information

  • Select "Information" from the help menu or press F1

  • the information window shows the keyboard shoutcuts, how many records are in the database, the Sqlite version being used on the system, the desktop font and scale factor.

  • Use the About dialog to display current version.

Events Database

Events are stored in an Sqlite database. SQLite is a small, fast and full-featured SQL database engine written in C.

Export and Import iCalendar Files

Talk Calendar allows a personal calendar to be exported as an iCalendar file. These typically use the file extension ".ical" or ".ics". The iCalendar standard is an open standard for exchanging calendar and scheduling information between users and computers. An icalendar file is a plain text file and so can be modified using a standard text editor.

The export to icalendar file does not currently support time zones and so the DTSTART and DTEND properties contain dates with local time and have no reference to a time zone. For example, the following represents an event starting on January, 1st, 2024 at 11.30am and ending at 2pm.

DTSTART:20240101T113000
DTEND:20240101T140000

You should backup your events by using the File->Export menu item which will create an "events.ical" file in the working directory (keep this safe and make another copy if necessary). If you then corrupt your database, you can clear all events and then use the File->Import to restore exported events. This assumes that the "events.ical" file is in the current working directory. If you completely corrupt your Sqlite database called calendar.db then rename it and restart Talk Calendar which will create a new empty database and restore into this.

The icalendar import parser allows the date and local time to be imported and checks if a time zone has been specified using the TZID property. A file chooser dialog is used to allow the file to be chosen by the user as shown below. File filters can be used.

The parser will be updated with new features in future releases.

Recurring Events

The only recurring event type that is currently supported by Talk Calendar is yearly. This is required for events such as birthdays and anniversaries. The parser uses icalendar RRULE to determine if an event is yearly (e.g. birthday).

Speech Synthesis

This version of Talk Calendar uses a diphone speech synthesizer. This replaces the word concatenation speech synthesizer which played back pre-recorded English words for reading out dates, times and some common generic words used to summarise a personal calendar event. The issue with this approach was that the voice file was becoming increasingly large as more audio word recordings were added to the dictionary. I had to use Signed 16-bit PCM encoding for the audio recordings rather than 8000Hz 8-bit Unsigned PCM encoding to eliminate the audio hiss that could heard on playback but this made audio WAV files larger and so added to the voice file size problem.

The better approach is to use recorded diphones and construct words from these. With this approach the audio voice file size remains fixed but words have to be constructed by stitching together diphones in the correct order. The diphone synthesizer uses a set of pre-recorded diphone sound samples converted to raw hexadecimal values and concatenates these to produce speech output for a given text input. Unfortunately, the synthesizer is not as good as other fully fledged systems but it does work for reading out a short descriptive title for an event together with the date and time.

The pronunciation of some words is poor as there is very little information online on how to convert words to a diphone list. I have mainly used The CMU Pronouncing Dictionary to look up the pronunciation for a word and then made an educated guess at the diphone sequence.

Currently the word to diphone dictionary is small (a few hundred words) focused on common generic words used to summarise a personal calendar event (e.g. birthday, anniversary, holiday, reminder etc.) but has the potential to be expanded. At this stage it just converts event summary text to speech audio output and does not support the use of apostrophes and other special characters. You can use two or more words for the event summary such as "Birthday party", "Dads birthday", "Television reminder" and "Travel and visit". I have been adding some common English first names to the dictionary so that it is possible, for example, to readout a first name and birthday e.g. "Fred birthday" in an effort to personalise a calendar entry. Of course a generic title such as "Birthday reminder" can be used instead. Many first names have not yet been implemented and so this feature is far from complete. If an event summary word is not recognised then it is skipped over. More words for personal calendar events and notable dates will be added in future updates.

This voice used by Talk Calendar is derivative work based on the diphone collection created by Alan W Black and Kevin Lenzo which is free for use for any purpose (commercial or otherwise) and subject to the pretty light restrictions detailed here. I have used the same licence for the voice that I have created. There is information about recording your own diphones here and in the speech synthesis lecture by Professor Alan W Black here.

The diphone speech synthesizer is work in progress.

Audio Thread

Talk Calendar now uses GTask (async/wait pattern) to play audio in a thread rather than GThread and GMutex which were used previously. With GTK4 it appears that the preferred way to perform work in a thread is to use GTask. The code now uses g_task_run_in_thread() so that a play audio blocking operation is executed in a separate background thread. The function g_task_run_in_thread() turns a synchronous operation into an asynchronous one, by running it in a thread. Apparently, GTask maintains a thread pool that is based on the number of CPUs available (i.e. supports multiple CPU-cores).

Build From Source

The C source code for the Talk Calendar application is provided in the src directory.

Geany can be used as a source code editor for opening, viewing and then compiling the Talk Calendar C code. Geany is lightweight and has an integrated terminal for building the application. To install the Geany IDE use the command below.

sudo apt install geany

Alternatively, the latest version of Geany can be built from source using autotools.

Building on Ubuntu 24.04 and Debian 12 Bookworm x86 Hardware

To build Talk Calendar from source you need the gcc compiler, GTK4, GLIB, SQLITE and Flite development libraries. You need to install the following packages.

sudo apt install build-essential
sudo apt install libgtk-4-dev
sudo apt install libasound2-dev
sudo apt install sqlite3
sudo apt install libsqlite3-dev

The packages:

sudo apt install libglib2.0-dev
sudo apt install alsa-utils

are needed but should be installed by default.

To check the installed Sqlite 3 version use the command below.

sqlite3 --version

To determine which version of GTK4 is running on a Debian/Ubuntu system use the following terminal command.

dpkg -l | grep libgtk*

Use the MAKEFILE to compile Talk Calendar. Just run "make" inside the source code folder.

make

To run Talk Calendar from the terminal use

./talkcalendar

Debian Compile Notes

I have tried to keep the current code base compatible with Debian 12 which uses GTK 4.8. This is an older version of the GTK4 toolkit compared to that used with Ubuntu 24.04 which is GTK 4.14. Consequently, with the current version of Talk Calendar the RGB values for the today, calendar event, public holiday colours have to be entered manually to be compatible with GTK 4.8. However, the GTK ColorDialogButton was introduced in GTK4.10 and will be used in future updates.

The function gtk_css_provider_load_from_data was depreciated in GTK 4.12 and replaced with "gtk_css_provider_load_from_string". However, I have still used this to be compatible with Debian 12. If compiling with Ubuntu 24.04 you get a series of depreciation warning messages as GTK 4.14 is used. See comments in the calendar source code file to eliminate these.

With GTK4.12 the GtkFileDialog API is no longer signal based but callback based which should match a GAsyncReadyCallback function (async/await) and this will be used in future updates. In computer programming, the async/await pattern is a syntactic feature that allows an asynchronous, non-blocking function to be structured in a way similar to an ordinary synchronous function. The function "gtk_file_chooser_dialog_new" used with a response callback has been depreciated and so has been removed from source code and ical backup files are saved to the current working directory. A file dialog to export an ical backup file will be implemented using a GAsyncReadyCallback function and this will not be compatible with GTK4.8.

Debian Trixie will be the next stable release of Debian. At the time of writing the Debian GTK4 tracker shows that Debian Trixie is currently using GTK4.18.2.

Raspberry Pi OS

Raspberry Pi OS (64-bit) is a port of Debian Bookworm and by default it uses the Wayland compositor called labwc. Consequently, you can build Talk Calendar on a Raspberry Pi 4 and 5 running Raspberry Pi OS in the same way described above.

Building on Fedora

With Fedora you need to install the following packages to compile Talk Calendar.

sudo dnf install gcc make
sudo dnf install gtk4-devel
sudo dnf install gtk4-devel-docs
sudo dnf install glib-devel
sudo dnf install alsa-lib-devel
sudo dnf install sqlite-devel

To check the installed Sqlite 3 version use the command below.

sqlite3 --version

To check the installed version of the GTK4 development libraries use the command below.

dnf list gtk4-devel

Versioning

SemVer is used for versioning. The version number has the form 0.0.0 representing major, minor and bug fix changes.

Author

Project Status

Active and under development.

License

GTK is released under the terms of the GNU Lesser General Public License version 2.1. Consequently, Talk Calendar is licensed under the same LGPL v2.1 license.

Acknowledgements

Releases

No releases published

Packages

No packages published

Languages