Skip to content

j2h4u/mc-hotlist-autogen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MC Hotlist Autogen

Automates the generation of the # autogen begin ... # autogen end section in the Midnight Commander hotlist file (~/.config/mc/hotlist).

Features

  • Tree-like structure for organized repository navigation.
  • Smart Collapsing:
    • Automatically collapses file chains like Host ── Owner ── Repo into a single line if there are no other siblings.
    • Collapses Owner ── Repo if an owner has only one repository.
  • Filtering:
    • Include: Specify owners (all their repos) or specific repos.
    • Exclude: Hide repos by name or glob pattern.
    • Multiple directories: Scan multiple repository directories.

Usage

Run the Python script to update your hotlist:

./generate_hotlist.py

Configuration

On first run, the script will create a default config.toml file from config.example.toml. Edit it to configure:

[general]
# Directories to scan for repositories
repos_dirs = ["~/repos"]

[repositories]
# What to include: owner (all repos) or owner/repo (specific)
include = [
    "j2h4u",              # all repos from this owner
    "torvalds/linux",     # specific repo only
]

# What to exclude (repo names or glob patterns)
exclude = ["temp-*", "*.worktree"]

Requirements

  • Python 3.11+ (or Python 3.6+ with tomli installed: pip install tomli)
  • Midnight Commander (mc) configuration file at ~/.config/mc/hotlist.

Design

Goal

Automate the generation of the # autogen begin ... # autogen end section in the Midnight Commander hotlist file.

Output Example

github.com
├── j2h4u
│   ├── hindsight
│   └── mc-hotlist-autogen
├── khabaroff-studio ── CopperPipes
└── tjvjk ── prepodam
gitlab.com ── j2h4u ── cv

Filtering: Include/Exclude Model

  1. Hosts — whitelist: only github.com and gitlab.com
  2. Include — what to add:
    • owner — all repos from this owner
    • owner/repo — specific repo only
  3. Exclude — what to remove (repo names or glob patterns)
  4. Multiple directories — scan multiple repository directories specified in repos_dirs

Output Format

  • Tree-style with ├── and └── prefixes.
  • Smart Collapsing:
    • If a host has only one owner with one repo, the entire chain collapses: Host ── Owner ── Repo.
    • If an owner has only one repo, it collapses: Owner ── Repo.
    • Uses the ── separator (with spaces).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages