Skip to main content

Schedrem

A cross-platform task scheduler and reminder configured in YAML.

How it Works

Schedrem is a Python package that provides a tool for scheduling tasks and setting reminders.

As a resident program, it monitors changes in the configuration file, triggers tasks to execute commands or display message boxes as reminders. It also validates the configuration format every time the file is saved.

The configuration file, which is a YAML file, is easy to read and write. You can use your favorite text editor to configure your schedules.

Audible alarm using a sound file (currently WAV format only) is available.

Requirements

  • Python 3.11 or later
  • PySide6 — GNU Lesser General Public License v3.0 (LGPL-3.0)
  • PyYAML — MIT License
  • psutil — BSD 3-Clause License
  • PyAudio — MIT License
  • Pydantic — MIT License

Installation

From PyPI

Install from PyPI using pip:

python -m pip install -U schedrem

From Source Using pip

git clone https://github.com/hikyae/schedrem
cd schedrem
python -m pip install -e .

From AUR

There also exists an AUR package.

Install from AUR using a helper such as yay or paru:

yay -S schedrem
paru -S schedrem

From Source Using Makepkg

git clone https://aur.archlinux.org/schedrem.git
cd schedrem
makepkg -si

Configuration

Schedrem searches for the configuration file in the order specified below and uses the first one that is found. The actual path depends on the platform and environment variables.

The file must be in YAML format. Edit it with your preferred text editor, and make sure it is encoded in UTF-8.

Schedrem will automatically detect the changes you've made to the configuration file. If there is an error in the file, a message box will pop up and it will try to tell you the reason. Please fix the file and save it, then close the message box. Otherwise, the message box will keep popping up.

Note that there is no configuration file to set command-line options such as --config or --debug.

Path Specified by Command-Line Parameter

You can set the file path by passing it as a command-line parameter:

schedrem --config path/to/config

Default Paths for Linux/macOS

  • ${XDG_CONFIG_HOME}/schedrem/config.yml
  • ${XDG_CONFIG_HOME}/schedrem/config.yaml
  • ${HOME}/.config/schedrem/config.yml
  • ${HOME}/.config/schedrem/config.yaml

Default Paths for Windows

  • %USERPROFILE%\.config\schedrem\config.yml
  • %USERPROFILE%\.config\schedrem\config.yaml
  • %APPDATA%\schedrem\config.yml
  • %APPDATA%\schedrem\config.yaml

Examples

Please refer to the examples directory in this repository.

Structure

Schedules

All the schedules should be listed here.

Each schedule is an item in the list of schedules, denoted by a leading hyphen (-). It can have description (abbreviated as desc), time, wait, delay, enabled or disabled, and an action that consists of message (abbreviated as msg), yesno, command (abbreviated as cmd), sound, and font. Basically, every key is optional with a few exceptions. If there is no action specified out of message, yesno, or command, an error occurs.

schedules:
  - message: This is the simplest schedule. This message is shown every minute.

  - description: The message "Good morning" is shown every day at 6 o'clock.
    time:
      hour: 6
      minute: 0
    message: Good morning.
Description

A string to describe the schedule.

Time

The time specification is inspired by cron, but is more readable and has some differences.

Specify integers or a list of integers for year, month, day, hour, minute to schedule the date(s) and time(s). Specify string or a list of strings for weekday (abbreviated as dow) to schedule the day(s) of the week.

If you omit any of them, then the task is triggered at any of the times within that range. This is similar to using * in a crontab.

If you don't specify the time, then the task is triggered every minute.

Wait

The time to wait before triggering the task. The task won't be triggered until the specified time has elapsed.

You can specify integers for year, month, day, hour, minute, but only year is mandatory.

Delay

Additional delay to be applied to each scheduled time. You can specify a non-negative float value in seconds. The default is 0.0.

This was implemented as a workaround to mitigate a bug in certain desktop environments where some message boxes fail to appear when multiple ones are created simultaneously.

Enabled / Disabled

A boolean (true/false, yes/no, on/off) to set whether the task should be triggered or not. Specify either enabled or disabled, but not both. If neither is specified, the schedule is enabled by default.

Useful when you toggle multiple schedules with a single flag using an anchor in YAML.

schedules:
  - disabled: true
    message: This schedule will not be triggered.
Action

The "action" is a conceptual term, not a configuration file key. The configuration file consists of the following keys: message (abbreviated as msg), yesno, command (abbreviated as cmd), sound, and font.

The detail of these keys is as follows:

  • message: A string to show in a message box with an OK button.
  • yesno: A string to display in a message box asking for a Yes or No response. If the user selects "Yes", the command will be executed, and the message will be shown if they are specified. If "No" is selected, neither the command nor the message will be run.
  • command: A string of an arbitrary shell command.
  • sound: A string of the path to a sound file to play, or a boolean (true/false, yes/no, on/off) to set whether the default sound should be played while showing a message box. The only acceptable sound file format is WAV.
  • font: A string specifying the font family and font size to use in the message box, in the format <font family> <font size>, for example, "Cica 40".

Optional global settings

These are optional settings that affect all schedules.

  • enabled or disabled: A boolean (true/false, yes/no, on/off) to set whether Schedrem should run. Specify one of these keys, but not both. If neither is specified, Schedrem is enabled by default. Setting enabled to false or disabled to true stops waiting for all schedules and kills all running tasks, including visible message boxes.

    enabled: false
    

    The equivalent setting using disabled:

    disabled: true
    
  • weekdaynames: A list of lists of strings to set the names for the days of the week. They start from Monday and are case-insensitive. The default value is [mon, tue, wed, thu, fri, sat, sun].

    weekdaynames:
      - [mon, tue, wed, thu, fri, sat, sun]
      - [月, 火, 水, 木, 金, 土, 日]
    
    schedules:
      - description: Time to take out the burnable trash
        time:
          hour: 7
          minute: 50
          weekday: 月
        message: 燃えるゴミを捨てる
    
  • font: A string specifying the font family and font size to use in the message box, in the format <font family> <font size>, for example, "Cica 40". If you set this value outside of schedules, each action will use this font setting unless the font is explicitly set within the action. The default value is Arial 15.

    font: Arial 70
    
    schedules:
      - description: You will see the huge text every minute
        message: HUGE
    
  • aliases: Thanks to the YAML specification, it is possible to make aliases for values for schedules. The naming of the key aliases is not mandatory.

aliases:
  - &workdays [mon, tue, wed, thu, fri]
  - &friday13th
    day: 13
    dow: fri

schedules:
  - desc: Time to go
    time:
      hour: 8
      minute: 0
      dow: *workdays
    msg: Go to work

  - desc: Beware of unluckiness in the morning
    time:
      hour: 8
      minute: 0
      <<: *friday13th
    msg: Good morning, and beware!

Usage

First, you need to put your configuration file into one of the places described in the Configuration section.

Try starting Schedrem from a terminal to check for any errors:

schedrem --debug
python -m schedrem --debug

This starts Schedrem in the foreground with the debug option, displaying configuration information if there are no issues. If no errors appear, you're good to proceed. You can stop the process by pressing <Ctrl>+C.

Set the config path if you put it besides the defaults:

schedrem --config path/to/config

Auto-starting

On Linux, to start Schedrem as a background program in a stand-alone window manager, add the following line to your startup script, such as ~/.xinitrc:

schedrem &

The trailing ampersand "&" means that the program should run in the background. To stop Schedrem, just type pkill schedrem.

In a desktop environment (such as GNOME, KDE, Xfce, MATE, Cinnamon, etc.), you can simply add Schedrem to the list of autostarted applications without the trailing "&".

On Windows, you need to create a shortcut for the command:

  1. Open the Startup Folder:

    • Press Win + R, type shell:startup, and press Enter.
  2. Create a New Shortcut:

    • Right-click inside the Startup folder and select New > Shortcut.
  3. Enter the Shortcut Target:

    • In the location field, type schedrem. Its absolute path will be resolved automatically.
    • Click Next.
  4. Name the Shortcut:

    • Enter schedrem as the name.
    • Click Finish.

On macOS, you need to put a plist file as ~/Library/LaunchAgents/com.yourusername.schedrem.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.yourusername.schedrem</string>
    <key>ProgramArguments</key>
    <array>
        <string>/path/to/schedrem</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Tips

  • There is a command-line option --action that can receive a JSON string as an action. Though this option is used internally for executing tasks, you can also manually execute it as a command. Answering "No" to yesno prompt lets the command exit with the code 1. If command is specified and executed, the command exits with its return code.
schedrem --action '{"msg":"test","sound":true}'
schedrem --action '{"yesno":"yes?","cmd":"echo yes"}'; echo $?
schedrem --action '{"yesno":"Did you do push-ups?","msg":"Nice."}' || schedrem --action '{"msg":"Do it."}'
# Snoozeable alarm example in POSIX shell
while ! schedrem --action '{"yesno":"wake up","sound":true}'; do sleep 5m; done
  • Unlike cron, you can configure the time with constraints on both the day of the month and the day of the week.

Metadata

Release files for schedrem 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schedrem 1.8.0
File Size Uploaded Provenance Actions
schedrem-1.8.0.tar.gz 162.4 kB Without provenance Details for schedrem-1.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schedrem 1.8.0
File Interpreter ABI Platform Actions
schedrem-1.8.0-py3-none-any.whl Python 3 none any Details for schedrem-1.8.0-py3-none-any.whl

Total release size: 322.2 kB

Release files / schedrem-1.8.0.tar.gz

Download URL schedrem-1.8.0.tar.gz
Size 162.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5f78214c1f6c35dd458a1c06ae00a6313431b50b2ca9b23e247a4e6ae84ebe05
BLAKE2b-256 checksum
How to use checksums
2b390a4c073ff169d248274769c886a06e8744ddd6cf1abf2a999167691dfc6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / schedrem-1.8.0-py3-none-any.whl

Download URL schedrem-1.8.0-py3-none-any.whl
Size 159.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f28046517f7c8de214ccebc2b490c7c8d19e32747de7a109e27cf4fce7ea182
BLAKE2b-256 checksum
How to use checksums
0f140ba65325ffa8c1db5f08b4d11c850a60ba1ea432006acfdfbb2eda75c4d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for schedrem 1.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page