dooit

repository·main·Indexed 25 days ago

https://github.com/dooit-org/dooit

A highly customizable, extensible TUI Todo Manager featuring a Vim-like interface and Python-based configuration. Version 3.3.4 supports topicwise todo lists with branching, a responsive terminal UI, and a backend powered by SQLAlchemy with Workspace and Todo data models. The tool includes a CLI for data migration and configuration management, and provides a DooitAPI for customizing the dashboard, bar widgets, and layout.

Tokens
10.6K
Snippets
36
Records
68
Agent score
84%

What's inside dooit

  1. Overview of Dooit features

    main

    Dooit is an interactive todo manager with a terminal user interface (TUI). Key features include:

    • Interactive UI: A beautiful and responsive terminal interface.
    • Customizability: Full control over the bar, colors, and display settings.
    • Extensibility: Uses a Python configuration file, allowing for complex logic and custom behavior.
    • Vim-like Keybindings: Familiar keyboard navigation for power users.
    • Topicwise Todo Lists: Supports separated lists with branching capabilities.
  2. Install Dooit via Home Manager on NixOS

    main

    To use Dooit with Home Manager, import the homeManagerModules.default from the dooit input. You must also add the dooit-extras.overlay to nixpkgs.overlays and specify dooit-extras in programs.dooit.extraPackages.

    # home-manager/dooit.nix
    
    {
      inputs,
      pkgs,
      ...
    }: {
      imports = [
        # home manager module for dooit
        inputs.dooit.homeManagerModules.default
      ];
    
      # adds dooit-extras to pkgs
      nixpkgs.overlays = [inputs.dooit-extras.overlay];
    
      programs.dooit = {
        enable = true;
        extraPackages = [pkgs.dooit-extras];
      };
    }
  3. Configure Dooit layouts for Workspace and Todo widgets

    main

    In dooit, layouts define the order and presence of columns in the UI. You can customize these by subscribing to the Startup event and modifying the api.layouts object.

    Important Constraints:

    • Editing: You can only edit items if their corresponding column is present in the layout (e.g., if TodoWidget.due is missing from the layout, you cannot edit the due date).
    • Description Column: The Description column automatically expands to fill all remaining space after other columns are rendered.

    Available Columns:

    • WorkspaceWidget: Only description is available.
    • TodoWidget: description, due, effort, recurrence, status, and urgency are available.

    Tip for Hidden Columns: If you want to hide a column (like effort) but still maintain the ability to edit it, you can edit the column-specific formatter to show nothing and instead modify the description formatter to include that information.

    from dooit.ui.api.widgets import TodoWidget, WorkspaceWidget
    from dooit.ui.api import DooitAPI, subscribe
    from dooit.ui.api.events import Startup
    
    @subscribe(Startup)
    def layout_setup(api: DooitAPI, _):
        # Set the workspace layout
        api.layouts.workspace_layout = [WorkspaceWidget.description]
    
        # Set the todo layout
        api.layouts.todo_layout = [
            TodoWidget.status,
            TodoWidget.description, 
            TodoWidget.recurrence,
            TodoWidget.due,
            TodoWidget.urgency,
        ]
  4. Configure the Dashboard in V3

    main

    The dashboard configuration has changed. Instead of defining a DASHBOARD list in a config dictionary, you must now use api.dashboard.set() within a Startup event subscriber. It is recommended to use rich.text.Text for styling.

    from dooit.ui.api import DooitAPI, subscribe
    from dooit.ui.api.events import Startup
    from rich.text import Text
    
    @subscribe(Startup)
    def dashboard_setup(api: DooitAPI, _):
        def colored(text, color):
            return Text(text, style = color).markup
    
        theme = api.vars.theme
    
        ART = "some ascii art"
        NL = " \n"
        SEP = Text("─" * 60, "d " + theme.background3)
        help_message = f"Press {colored('?', 'magenta')} to spawn help menu"
        DASHBOARD = [ART, NL, SEP, NL, NL, NL, help_message]
    
        api.dashboard.set(DASHBOARD)
  5. Install and use Dooit Extras

    main
    Dooit Extras is a separate extension project containing utilities designed to help customize and 'rice' your dooit setup. It is maintained as a separate repository to allow for a more frequent release cycle for utilities and plugins without affecting the core dooit package.
  6. Install Dooit on NixOS using Flakes and Modules

    main

    To install Dooit on NixOS with Flakes, add the dooit and dooit-extras inputs to your flake.nix. Use an overlay in your configuration module (e.g., dooit.nix) to include dooit-extras in the extraPackages list of the dooit package.

    # dooit.nix
    
    {
      inputs,
      pkgs,
      ...
    }: let
      mydooit = pkgs.dooit.override {
        extraPackages = [
          pkgs.dooit-extras
        ];
      };
    in {
    
      # this overlay allows you to use dooit from pkgs.dooit
      nixpkgs.overlays = [inputs.dooit.overlay inputs.dooit-extras.overlay];
    
      environment.systemPackages = [
        mydooit
      ];
    }