Skip to content

A project designed for Linux users that facilitates the addition, listing, and deletion of schedules through the terminal.

License

Notifications You must be signed in to change notification settings

amateur-hacker/scheduler

Repository files navigation

Scheduler

TABLE OF CONTENTS

https://github.com/amateur-hacker/dotfiles/blob/main/scheduler-preview/schwithnotification.png

https://github.com/amateur-hacker/dotfiles/blob/main/scheduler-preview/schwithrofi.png

https://github.com/amateur-hacker/dotfiles/blob/main/scheduler-preview/schwithcommands.png

Scheduler is a program that reads a schedule file and performs scheduled tasks at their designated times. It provides audio notifications for the schedule and prompts the user to confirm completion. The program features a Command Line Interface (CLI) written in Bash, which enables users to add, list, and delete scheduled tasks.

Scheduler(CLI)

The command line interface (CLI) for Scheduler is named “sch” and is written in Bash, featuring several command line options.

Options:

  • -a “SCHEDULE”: add a new schedule to the schedule file
  • -lus “NUM”: List schedules, up to NUM (default: 1).
  • -luc “NUM”: List schedules completion status, up to NUM (default: 1).
  • -dus “NUM”: Delete schedules, up to NUM (default: 1).
  • -duc “NUM”: Delete schedules completion status, up to NUM (default: 1).
  • -lss “NUM”: List the schedule with the specific number of your choice.
  • -lsc “NUM”: List the schedule completeion status with the specific number of your choice.
  • -dss “NUM”: Delete the schedule with the specific number of your choice.
  • -dsc “NUM”: Delete the schedule completeion status with the specific number of your choice.
  • -las: List all schedules.
  • -lac: List all schedules completion status.
  • -das: Delete all schedules.
  • -dac: Delete all schedules completion status.
  • -u | –update: To update the scheduler.
  • -r | –restart: To restart the scheduler.
  • -v | –version: To see the version number of scheduler.
  • -h | –help: To see usage of scheduler program.

Usage:

To add a new schedule:

  • sch -a “SCHEDULE”

Examples:

When adding a single schedule:

sch -a "01. 09:45AM Python +2h"
sch -a "02. 01:45PM Web Development +3h 2m"
sch -a "03. 03:45PM Bash Scripting +4h 2m 5s"

When adding multiple schedules:

sch -a "01. 09:45AM Python +2h" "02. 01:45PM Web Development +3h 2m" "03. 03:45PM Bash Scripting +4h 2m 5s"
sch -a "01. 09:45AM python +2h" "02. 01:45PM Web Development +3h 2m"

Schedule Format:

serial numberSchedule TimeScheduleCompletion Time
01.09:45AMpython+2h
02.01:45PMWeb Development+3h 2m
03.03:45PMBash Scripting+4h 2m 5s

Note:

  1. The schedule you write should always be enclosed in double quotes.
  2. When using double quotes, begin with a serial number followed by a period, using this format: 01., 02., 03., 10.
  3. Then, leave a single space and specify the initial/start time of your schedule using the 12-hour format with AM or PM, such as: 09:45AM, 01:10PM, 03:15AM.
  4. Do not include any spaces between the time and the AM/PM designation.
  5. Then, leave another space and specify the schedule that you want to do at that particular time.
  6. Ensure that each word in the schedule description is separated by only a single space.
  7. Then, leave another space and specify your completion time using the “+” symbol, followed by a time duration in this format: +2h, +3h 2m, +4h 2m 5s.
  8. You can only make up to 10 schedules in a day. To create additional schedules, you will either need to delete some existing schedules from those 10 schedules or utilize the overwrite functionality, as mentioned below.
  9. If you write the schedule with the same number again, it will overwrite the previous one. You don’t need to worry about adding the schedule in a sequential manner because it will be automatically handled. The schedule will be rearranged automatically based on their respective numbers.

List schedules, up to NUM (default: 1).

  • sch -lus “NUM”

Examples:

sch -lus "3"
sch -lus 4

List schedules completion status, up to NUM (default: 1).

  • sch -luc “NUM”

Examples:

sch -luc "3"
sch -luc 4

Delete schedules, up to NUM (default: 1).

  • sch -dus “NUM”

Examples:

sch -dus "3"
sch -dus 4

Delete schedules completion status, up to NUM (default: 1).

  • sch -duc “NUM”

Examples:

sch -duc "3"
sch -duc 4

Note:

  1. By editing the .config/scheduler/config file, you can modify the listing order direction of -lus, luc, dus, duc flags.
  2. Double quotes are optional for enclosing argument in almost all flags expect when using -a flag.

List the specific schedule.

  • sch -lss “NUM”

Examples:

sch -lss "3"
sch -lss 4

List the specific schedules completions status.

  • sch -lsc “NUM”

Examples:

sch -lsc "3"
sch -lsc 4

Delete the specific schedule.

  • sch -dss “NUM”

Examples:

sch -dss "3"
sch -dss 4

Delete the specific schedule completion status.

  • sch -dsc “NUM”

Examples:

sch -dsc "3"
sch -dsc 4

List all schedules

  • sch -las

List all schedules completion status:

  • sch -lac

Delete all schedules:

  • sch -das

Delete all schedules completion status:

  • sch -dac

List last schedule

  • sch -lus

List last schedule completion status

  • sch -luc

Delete last schedule

  • sch -dus

Delete last schedule completion status

  • sch -duc

To update the scheduler.

  • sch -u | –update

To restart the scheduler.

  • sch -r | –restart

To see the version number of scheduler.

  • sch -v | –version

To see usage of scheduler program.

  • sch -h | –help

Note:

  1. The lus, luc, dus and duc flags will work when the “LIST/DELETE_UP_TO_SCHEDULE_DIRECTION” and “LIST/DELETE_UP_TO_COMPLETION_DIRECTION” variables in the .config/scheduler/config file are set to “last”.
  2. The lus, luc, dus, and duc flag working because the default argument is set to 1 for both list/delete up to schedule and list/delete up to completion status.

Installation Instructions

  • This program is designed only for linux users.
  • This program can be installed on Arch, Ubuntu/Debian, Fedora, and OpenSUSE based distributions.
  • To install this program on your Linux distribution, please follow the instructions below:

Installing Scheduler

  • To install scheduler, you need to clone this repository and run the install.sh script.
git clone https://github.com/amateur-hacker/scheduler.git
cd scheduler
./install.sh

NOTE: Dependencies will automatically install from install.sh script.

About

A project designed for Linux users that facilitates the addition, listing, and deletion of schedules through the terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages