Skip to content

fosskers/streak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streak

https://melpa.org/packages/streak-badge.svg

This Emacs Lisp package provides streak-mode, a minor mode for tracking some daily streak. Exercising? Learning a language? Trying to quit a bad habit? Track your success in your mode line!

screenshot.png

Table of Contents

Installation

Note: this package requires at least Emacs 27.1

Melpa

You can install streak in the usual way:

M-x package-install RET streak

And configure it like so:

(use-package streak
  :ensure t)

Doom Emacs

Place the following in your packages.el:

(package! streak)

This should automatically pull streak from Melpa. Now make sure to run doom sync -u. Then in your config.el:

(use-package! streak
  :config
  (streak-mode))

This will start streak-mode when Doom opens.

Usage

Your First Streak

streak-mode stores your data in its “streak file”. This file will be created automatically the first time a streak is made with streak-new:

M-x streak-new

You’ll be asked to name your streak. You can keep this simple (a single word) since this label won’t appear as-is in your modeline. How the modeline actually appears can be fully customized by you (see below).

Once you’ve started your streak, it will increment (in the mode line) automatically day by day.

Manual Streak Tweaking

Consider these functions for manual control over the specific streak values:

  • streak-reset: Reset a streak, with “now” as the new starting point.
  • streak-increment: Increase a streak by 24 hours worth.
  • streak-decrement: The opposite of the above.
  • streak-update: Reread the streak file and manually update the mode line.
  • streak-remove: Remove a streak that you no longer want to track.

Customization

The following aspects of streak can be customized (all found under the streak customization group):

  • streak-file: A filepath to the “streak file” where your records are kept.
  • streak-formatters: An alist of functions to customize how each streak is formatted. The key of each pair must be a string that matches a streak name found in your streak file, while the value must be a function that accepts the days of that streak and returns a string.
    (setq streak-formatters '(("study" . (lambda (days) (format "Study: %d Days" days)))
                              ("running" . (lambda (days) (format "Run: %d Days" days)))))
        

So a full Doom config would look like:

(use-package! streak
  :config
  (setq streak-formatters '(("study" . (lambda (days) (format "Study: %d Days" days)))
                            ("running" . (lambda (days) (format "Run: %d Days" days)))))
  (streak-mode))

all-the-icons

TODO (Feel free to PR a working setup!)

FAQ

How is this different from org-habit?

org-habit is useful for tracking repeated tasks/events that occur over an interval, like “Vaccuum every Saturday”. streak on the other hand is for maintaining a daily streak of some initiative you’re pursuing, like “Study German every day” or “Stop eating ice cream”. Further, streak shows you your current record in the mode line, thus visible at all times to keep up your motivation.

About

A minor mode for Emacs to track a streak.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors