commit 5ea848bddc397311fd1e2f868732ed8ef9491374 Author: trav Date: Sun Nov 15 02:17:00 2026 -0800 v0.23.0: Routine, first public version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c25560 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +node_modules/ +__pycache__/ +*.pyc +/android/build/ +/test-data/ +/build/ +/dist/ +/android/apk/ +/android/routine.keystore +CLAUDE.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a71cb6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,131 @@ +# PolyForm Noncommercial License 1.0.0 + + + +## Acceptance + +In order to get any license under these terms, you must agree +to them as both strict obligations and conditions to all +your licenses. + +## Copyright License + +The licensor grants you a copyright license for the +software to do everything you might do with the software +that would otherwise infringe the licensor's copyright +in it for any permitted purpose. However, you may +only distribute the software according to [Distribution +License](#distribution-license) and make changes or new works +based on the software according to [Changes and New Works +License](#changes-and-new-works-license). + +## Distribution License + +The licensor grants you an additional copyright license +to distribute copies of the software. Your license +to distribute covers distributing the software with +changes and new works permitted by [Changes and New Works +License](#changes-and-new-works-license). + +## Notices + +You must ensure that anyone who gets a copy of any part of +the software from you also gets a copy of these terms or the +URL for them above, as well as copies of any plain-text lines +beginning with `Required Notice:` that the licensor provided +with the software. For example: + +> Required Notice: Copyright Yoyodyne, Inc. (http://example.com) + +## Changes and New Works License + +The licensor grants you an additional copyright license to +make changes and new works based on the software for any +permitted purpose. + +## Patent License + +The licensor grants you a patent license for the software that +covers patent claims the licensor can license, or becomes able +to license, that you would infringe by using the software. + +## Noncommercial Purposes + +Any noncommercial purpose is a permitted purpose. + +## Personal Uses + +Personal use for research, experiment, and testing for +the benefit of public knowledge, personal study, private +entertainment, hobby projects, amateur pursuits, or religious +observance, without any anticipated commercial application, +is use for a permitted purpose. + +## Noncommercial Organizations + +Use by any charitable organization, educational institution, +public research organization, public safety or health +organization, environmental protection organization, +or government institution is use for a permitted purpose +regardless of the source of funding or obligations resulting +from the funding. + +## Fair Use + +You may have "fair use" rights for the software under the +law. These terms do not limit them. + +## No Other Rights + +These terms do not allow you to sublicense or transfer any of +your licenses to anyone else, or prevent the licensor from +granting licenses to anyone else. These terms do not imply +any other licenses. + +## Patent Defense + +If you make any written claim that the software infringes or +contributes to infringement of any patent, your patent license +for the software granted under these terms ends immediately. If +your company makes such a claim, your patent license ends +immediately for work on behalf of your company. + +## Violations + +The first time you are notified in writing that you have +violated any of these terms, or done anything with the software +not covered by your licenses, your licenses can nonetheless +continue if you come into full compliance with these terms, +and take practical steps to correct past violations, within +32 days of receiving notice. Otherwise, all your licenses +end immediately. + +## No Liability + +***As far as the law allows, the software comes as is, without +any warranty or condition, and the licensor will not be liable +to you for any damages arising out of these terms or the use +or nature of the software, under any kind of legal claim.*** + +## Definitions + +The **licensor** is the individual or entity offering these +terms, and the **software** is the software the licensor makes +available under these terms. + +**You** refers to the individual or entity agreeing to these +terms. + +**Your company** is any legal entity, sole proprietorship, +or other kind of organization that you work for, plus all +organizations that have control over, are under the control of, +or are under common control with that organization. **Control** +means ownership of substantially all the assets of an entity, +or the power to direct its management and policies by vote, +contract, or otherwise. Control can be direct or indirect. + +**Your licenses** are all the licenses granted to you for the +software under these terms. + +**Use** means anything you do with the software requiring one +of your licenses. diff --git a/README.md b/README.md new file mode 100644 index 0000000..04addb9 --- /dev/null +++ b/README.md @@ -0,0 +1,326 @@ +# Routine + +![Routine with the template routine it starts with](docs/screenshot.png) + +The day's routine as one long list you tick off as you go. Blocks (Morning, Work, Evening, …) hold +your tasks and their sub-tasks; tick them as you do them, skip what isn't happening today, and +write a line about the day at the bottom. Every tick plays a little stop-motion animation, with +its own sound, out of the box you ticked. Streaks count the days in a row a task got done, and +three windows look back: **History** (every task, every day, as a grid), **Statistics** and the +**Journal** (your notes). + +For Linux and macOS. There is also an app for the Rabbit R1, kept in step with the desktop through +a small sync server of your own (Linux only for now). + +## Install + +**macOS** (13 Ventura or newer, Apple silicon or Intel). Open Terminal (⌘ Space, type Terminal), +paste this line and press Return: + +``` +curl -fsSL https://git.autonomic.zone/trav/routine/raw/branch/main/install-mac.sh | bash +``` + +No password, Xcode or Homebrew needed: it downloads Routine, its own Python and Qt (about 400 MB, +all kept in `~/Library/Application Support/Routine-app`) and puts **Routine** in your Applications +folder, so it's in Launchpad and Spotlight. To keep it in the Dock: open it, right-click its Dock +icon → Options → Keep in Dock. *The Mac version is new and hasn't been tried on a real Mac yet: if +something's off, see [If something goes wrong](#if-something-goes-wrong).* + +**Linux** (Fedora, Ubuntu / Debian, Arch, and most others). In a terminal: + +``` +curl -fsSL https://git.autonomic.zone/trav/routine/raw/branch/main/install-linux.sh | bash +``` + +It needs Python 3.10 or newer (every current distribution has it) and PySide6 (Qt for Python). If +your system has PySide6 already, that's used; if not, it offers your distribution's package (it +shows the `sudo` command and asks first) or a private copy just for Routine (about 250 MB, no +password). The app goes to `~/.local/share/routine-app`, and Routine appears among your apps. + +**Update**: run the same line again. **Uninstall**: the same line with `-s -- --uninstall` on the end +(`… | bash -s -- --uninstall`). Neither ever touches your routine or your history. + +## First steps + +1. **Open Routine.** The first time, it starts from a template routine: a few blocks with tasks + that show what a routine can hold (sub-tasks, a weekend-only block, a weekday-only task, a + suggestion, a calm task). Have a look, tick something. +2. **Make it yours**: Settings (Ctrl+, on Linux, ⌘, on a Mac) → **Routine**. Delete the template's + tasks, add your own blocks and tasks, give them hours, colours and days, then **Save routine**. + See [Changing the routine](#changing-the-routine). +3. **Tick as you go.** The window opens on the block you're in now (») and the day rolls over at 4 am, + so late-night tasks count for the evening before. Scroll sideways (or ‹ ›) for earlier days. +4. **Streaks** build by themselves; **View → History / Statistics / Journal** look back over them + ([Streaks](#streaks)). +5. **Back it up**: your whole routine and history are two files; see [Your data](#your-data). + +## On a Mac + +Everything on the desktop works the same, with a Mac's habits: the menu bar is at the top of the +screen, ⌘ stands in for Ctrl in every shortcut (History is ⌘Y, since ⌘H hides an app), Settings +is in the Routine menu, and windows have the usual title bar. **Coming soon on macOS**: the sync +server and the Rabbit R1 (their Settings pages are there, greyed out). Your data is kept in +`~/Library/Application Support/Routine`, the error log in `~/Library/Logs/Routine`. + +## If something goes wrong + +Routine keeps running after most errors: it writes what went wrong to a log and says so once. +**Help → Open log folder** shows the log (`errors.log`; `launch.log` has the messages from the last +start). The log holds only where in the program things went wrong, never your routine or notes. +Please send it along with what you were doing. **Help → About Routine** shows the version and where +everything is kept. + +- Linux: `~/.local/state/routine/` +- macOS: `~/Library/Logs/Routine/` + +## The animations + +Every tick plays a little stop-motion animation, with its own sound, +out of the box you ticked. The more you tick in a day, the more of them you get to see: the +first 5 ticks draw from set 0 (the biggest, 40 animations, since those ticks happen every day), +the next 5 from set 1, and so on, purely at random within the set: repeats can happen, and +nothing remembers what has played (`shared/ANIMATIONS.md` lists them all). A task marked +**calm animation** in the editor plays one of 40 calm ones instead: slower, two seconds, with +quiet sounds, for early mornings and late nights. Each one starts at the box you ticked but is moved, +as little as it takes, to stay entirely on screen (and drawn smaller only if it couldn't fit at all). It still counts toward the next set. Once you're past the last set, a special two-second star plays too: time to ask for +more animations. + +## Using it + +- **One day, top to bottom**: blocks (Morning, Work, Lunch, …) with every task and sub-task as a + checkbox. Ticking or skipping a task does the same to its sub-tasks that are still open. +- **skip** hides a task without ticking it off (recorded as skipped, no animation). +- **Click (tap on the R1) a block's heading** to hide its tasks, again to show them; remembered + per device. Until you've done it once, each heading says "click/tap to hide" or "to show". +- **All / Incomplete / Completed** at the bottom (All / To do / Done on the R1, to fit): + everything, only what's still to do, or only what got ticked (with the tasks it sits under). + In All you can untick a done task or unskip a skipped one. Today remembers the last pick; an + earlier day always opens on Completed. +- **Ticking a task on an earlier day** asks first ("this is for a day in the past, …"): yes / oops. +- **»** (Now) jumps to today at the current time (the latest block that has started: after the + last block, until the day rolls over, that last one); the app opens there. The date at the top + and the note at the bottom stay put while the tasks scroll between them. +- **Earlier days are to the left**: scroll sideways (touchpad), Alt+Left / Alt+Right, or ‹ ›. +- **The note** at the bottom of each day, past days included. +- **Settings → Appearance → Look**: the date (always "Sunday, November 8th"; **Show the year** adds ", 2026", + and the R1 follows at install), the header font (the date; default Edition), the note title's + font (default Caveat, a handwritten script bundled in `shared/fonts`, SIL Open Font License), and + block colours: a swatch by each block's name, the heading row in its colour, or the whole block. + **Emboss the block colours** draws whichever of those as a button (hover and press darken it, + as on any button), with no dark edge unless **Colours → Block edge** gives it one (0 % none, + 35 % a button's); the R1 stays flat. + **Say "now" on the current block** (on by default) shows or hides that word; the R1 never says it. +- **Settings → Appearance → Colours**: every gray (header, background, tasks area, buttons, the note, + lists) and a tint, with Light and Dark tabs for each mode's own set (shared-resources design.html#colors). +- The day rolls over at 4 am (`dayStartsAt`), so night tasks after midnight count for the night before. +- **Ctrl+,** (or Edit → Settings in the menu bar: tap **Alt** to show it) opens Settings: the + routine editor, look, sounds, tooltips, streaks (streak animations, cheat days, embossed history + dots), where the data is kept, the sync server, the R1. On a Mac: **⌘,** or Routine → Settings + in the menu bar at the top of the screen. +- **Help → Open log folder** and **Help → About Routine** (the version, and where everything is kept). +- On the R1 the wheel stays volume (wheel down + side button = screenshot); scroll by touch. + The moon / sun in its bottom bar switches between the dark look (white on black, best in + bright sunlight) and the light one (the desktop's: embossed boxes, the Edition date, the + desktop's block colouring, sent along at install). The date scrolls away with the tasks there. + +## Changing the routine + +Settings → Routine: a tree of blocks and the tasks nested under them, with a form for the +selected one (name, hours, colour and days of the week for a block; name and days for a task, +and whether it's **just a suggestion**: quiet text with no checkbox, like an idea for how to do +the task above it, never ticked or skipped) or has a **calm animation** (see below). A block or +task left off a day takes everything under it along. ↑ at the top of a block moves a task into +the end of the block above; ↓ at the bottom moves it into the start of the block below. Add block / task / +sub-task, delete, move with ↑ ↓, and indent/outdent with → ←. **Save routine** bumps its `rev`, +gives today's list the new routine, and sends it through the sync server to the R1 at its next sync. Past +days keep the routine they had; renaming a task keeps its history (moving it under a different +parent starts a new one). + +**The first run** starts from a template (`shared/schedule.json`): a few blocks whose tasks show +what a routine can hold (sub-tasks two deep, a weekend-only block, a weekday-only task, a +suggestion, a calm task). It's copied into your data folder as `schedule.json`, and from then on +that copy is your routine: it always wins over the template, whatever their `rev`s. Delete the +template's tasks in Settings → Routine and add your own. A fresh R1 install also begins with the +template (its `rev` is 0, so the first sync replaces it with the desktop's routine as soon as +that has been saved once). + +An install from before the template (a history already there, but no `schedule.json` of its +own) is never switched to the template: it takes a `schedule.from-repo*.json` from the data +folder if there is one (a saved copy of the routine the repo used to ship), else it rebuilds the +routine from the most recent day in the history (that day's blocks and tasks, ids kept; weekday +limits can't be told from one day, so check them in the editor). + +## Streaks + +Every task keeps a streak: the days in a row it got ticked. Days a task isn't on (a weekday-only +task at the weekend) don't count either way, and today doesn't count against it until it's over. +When a tick by hand brings a streak to **7, 21, 42, 66, 100, 150, 254 or 365** days (and every 100 +more after that), a special two-second streak animation plays instead, showing the number (a calm +task gets a calm one). **Cheat days**: after 7 days in a row (Settings → Streaks sets how many, or +turns it off) one missed day is forgiven and the streak carries on; two misses running end it. +**On the R1** the same ticks play the same streak animations, with the same number: the R1 only +holds the last couple of months, so the desktop sends each streak as it stood 30 days ago through +the sync server (with the streak settings), and the R1 counts on from there. Until it has that (a +server that hasn't been updated yet), the R1 counts from its own days and only plays a streak animation when it +can see where the streak began; the settings then come along at install. +**View → History** (Ctrl+H; ⌘Y on a Mac), **Statistics** (Ctrl+T) and **Journal** (Ctrl+J) open windows of their own +beside the main one, each showing a range of days picked at its top (last 30 / 90 days, this +year, all time, or from – to). + +**History** is the range as a grid: blocks and their tasks across the top, days down the left +(months marked by a line), opening on today at the bottom. Two buttons beside the range tiles +change that, both remembered: the arrow flips the day order (newest at the bottom or at the top; +with the axes swapped, on the right or on the left), and the axes button (lit while on) swaps the +axes: days across, tasks down the side, so long streaks run sideways on a wide screen. A day a +task got done is a dot in its block's colour; a streak joins its dots into one pill, which narrows +to a thin stem over days the task wasn't on, so a weekday-only streak reads as one. A cheat day is +a hole in the pill; a missed day a faint speck; today, still to do, a faint ring. Click a block's +heading to fold it into one column (or row): full colour where every task was done, pale where +some were, empty where none were (click again to open it; remembered). Hover a dot for the task, +the day and its streak; hover a heading for the task's full name. Pinch, Ctrl+wheel or Ctrl + / − +zoom around the pointer (Ctrl+0 back to 100 %, remembered); zoomed far out it turns into bars with +week or month labels, so years fit. Home / End jump to the start / end of the days (top or left / +bottom or right). Settings → Streaks embosses the dots or draws them flat. + +**Statistics** lays the routine out as the main window does (the same blocks, colours and indents, +every task with a record in the range, in today's order; a task since removed in quiet italics), +read-only, with a figure where the checkbox would be. The tiles at the bottom pick it: **% of days** +(of the days it was on), **Longest streak** (in the range, with the cheat days that streak used and +the streak going now beside it) or **Days done**; each heading shows its tasks' % together. +Click a task for its details in the panel at the bottom (longest streak with its dates and cheat +days, the streak now, % and days done, the next reward and how far off it is); click it again and +the panel sums up the range (the routine's %, the best streaks, perfect days, cheat days used). +Headings hide their tasks on a click here too, remembered apart from the main window's. + +**Journal** is the notes, newest first, each under its date with the % of that day's tasks done; +click the % for what got done that day, by block, and below a line what didn't. **With a note** +(the default) leaves out the days without one; **Every day** shows them too. Double-click an entry +to open that day in the main window; right-click to copy its note. + +## Your data + +Two files are everything: **`schedule.json`**, your routine, and **`routine.db`**, the history: +every day from the first run on has a record, ticked or not (SQLite, one JSON document per day: +see `routine/model.py`), with your notes and a log of every animation that played, when, and for +which task. The sync server only relays the last 60 days between the desktop and the R1. + +They start out in + +- Linux: `~/.local/share/routine/` (settings in `~/.config/routine/config.json`) +- macOS: `~/Library/Application Support/Routine/` (settings in `config.json` there too) + +To **back them up**, copy those two files (with Routine closed, to be safe), or keep them in a +folder that's backed up or synced already: **Settings → Data** keeps either one in a folder of +your choosing. Pick it and the file is moved there (copied, checked, then the original removed). +If that folder already has one, it asks: **use that one** (yours stays where it was), **replace +it with mine** (that one is kept beside it as `.replaced-