Coder Social home page Coder Social logo

egg-timer.el's Introduction

egg-timer.el

Introduction to the fork

This is a fork of the excellent and original egg-timer.el because I really liked the simplicity of the interface here but I wanted to be able to free form enter text for choosing a timer's time as well as select from a list with completion, also I wanted to make it work on systems where I didn't have access to DBUS notifications (remote terminal machines, windows machines, etc) so I wanted to make the notification system more customisable if I wanted too, and then I wanted the ability to list/modify the timers running... so I sort of took the original incredibly simple and beautiful code and mangled it with complexity.

But the users experience of it should remain very simple.

This version exposes four functions to the user:

  • egg-timer-schedule lets you schedule a timer either from a completing read or entering any time string that looks right enough according to timer-duration-words so writing "3 seconds" or "3 hours" would give you a timer for "3 second" or "3 hour" because it trims off -s and things. If there is any text after the second word this is appended to the label of your timer as a reason for its existence, so "25 minutes turn down oven" would let you know why you got a notification at that point with the context.
  • egg-timer-p tells you if you have running timers
  • egg-timer-list lists your running timers
  • egg-timer-cancel lets you choose a timer to cancel

There is also a variable egg-timer-notification-method that lets you choose now notifications work, by default it uses notifications-notify but it can be set to 'buffer to pop up buffer showing when the timer completes or 'message to just display a message. If it is linked to a function then it will call that function and pass it the label of the timer to display, this can be either a lambda or a #'my-function

Everything below here is the original documentation


MELPA Use Emacs to set timers.

schedule an alarm using Emacs use the system's notification system to display the alarm

Installation

egg-timer is available on MELPA. To install you may need to run:

  • M-x package-refresh-contents
  • M-x package-install egg-timer

Configuration

This module intentionally does not define any keybindings. If you'd like to set one yourself, consider using and adapting the following snippet:

(require 'egg-timer)
(global-set-key (kbd "C-s-a") #'egg-timer-schedule)

If you'd like to customize the intervals that egg-timer.el uses, the variable egg-timer-intervals should suffice. For example, if you'd like to support a timer for 3 hours:

(setq egg-timer-intervals (add-to-list 'egg-timer-intervals '("3 hour" . 180)))

If you'd like to create a keybinding to immediately schedule an alarm instead of being prompted for a list of options, use egg-timer-do-schedule:

(global-set-key (kbd "C-s-a") (lambda () (interactive) (egg-timer-do-schedule 2)))

For more information:

  • See the module documentation in egg-timer.el.

Alternatives to egg-timer.el

Many timer packages exist, so what's different about egg-timer? Many of the timers on MELPA are pomodoro timers. egg-timer is not exclusively a pomodoro timer -- although you could use egg-timer-do-schedule to create one if you'd like.

egg-timer prompts users using Emacs's built-in completing-read function; this integrates with ivy or other completion libraries that users may prefer. egg-timer also notifies users with notifications-notify, which integrates with the FreeDesktop notification protocol, notifying users at the operating system level.

Enjoy responsibly.

egg-timer.el's People

Contributors

wpcarro avatar twitchy-ears avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.