# lucasbretana/dotfiles architecture

> Architecture diagram of the GitHub repository lucasbretana/dotfiles, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucasbretana/dotfiles
- Repository: https://github.com/lucasbretana/dotfiles

## Overview

##### Project type and purpose
- This is a “dotfiles” repository whose goal is to manage and install a user’s shell/SX window-manager/editing environment. It groups all configuration files (bashrc, vimrc, tmux.conf, i3 configs, etc.) and utility scripts under one version-controlled tree and uses an `install.sh` + `env` file to symlink them into the user’s home directory.

##### File structure
- Top-level items
- `.gitignore`, `README.md`
- `install.sh` – orchestrates the linking process
- `env` – environment variables that drive installation paths
- `home/` – contains everything that will be linked into `~`
- Under `home/`
- Single files: `vimrc`, `bashrc`, `Xresources`, `gdbinit`, etc.
- Subdirectories:
– `bin/` – custom utility scripts (`bandwidth.sh`, `battery.pl`, etc.)
– `txt/` – static text assets (e.g., quotes)
– config dirs for window manager and status bar: `i3config`, `i3blocksconfig`, `i3statusconfig`
- Linking pattern
- Regular files in `home/` → symlink to `~/.*` (e.g. `home/vimrc` → `~/.vimrc`)
- Directories in `home/` → their contents symlinked into corresponding target dir (`home/bin/*` → `~/.local/bin/`)

##### README for additional insights
- Describes two install-rules (file vs. directory linking)
- Mentions modular bash setup (.benv, .baliases, .bfunctions)
- Notes future plans for WM transition (compton)
- Emphasizes no external Vim plugins, pure shell scripting

##### Key reminders
- Flow: clone → install → runtime sourcing → script execution
- Detail environment layering: show how `env` drives target paths and how `.benv.priv` is optionally loaded

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Install Phase
    subgraph "Build & Install Phase"
        GitRemote["Git Remote"]:::repo
        LocalRepo["Local Clone"]:::repo
        Installer["install.sh"]:::install
        EnvLoader["env"]:::install
        LinkEngine["Symlink Engine"]:::install
    end

    GitRemote -->|clone/pull| LocalRepo
    LocalRepo --> Installer
    Installer --> EnvLoader
    Installer --> LinkEngine

    %% Configuration Sources
    subgraph "Configuration Sources (home/)"
        subgraph "Shell Modules"
            Benv["home/benv"]:::config
            Baliases["home/baliases"]:::config
            Bfunctions["home/bfunctions"]:::config
        end
        subgraph "Shell Config"
            Bashrc["home/bashrc"]:::config
            GitignoreFile["home/gitignore"]:::config
        end
        subgraph "Editor Config"
            Vimrc["home/vimrc"]:::config
        end
        subgraph "Window Manager Config"
            I3config["home/i3config"]:::config
            I3blocks["home/i3blocksconfig"]:::config
            I3status["home/i3statusconfig"]:::config
            Xinitrc["home/xinitrc"]:::config
            Xsessionrc["home/xsessionrc"]:::config
        end
        subgraph "Utility Scripts"
            BinDir["home/bin/"]:::scripts
        end
        subgraph "Other Config Files"
            Xresources["home/Xresources"]:::config
            Gdbinit["home/gdbinit"]:::config
            Gitconfig["home/gitconfig"]:::config
            Tmuxconf["home/tmux.conf"]:::config
        end
        subgraph "Static Text Assets"
            Quotes["home/txt/daily_quotes.txt"]:::config
        end
    end

    %% Link Operations to Target Home
    LinkEngine -->|"links files"| TargetHome

    subgraph "Target Home ($HOME)"
        BashrcTarget["~/.bashrc"]:::target
        BenvTarget["~/.benv"]:::target
        BaliasesTarget["~/.baliases"]:::target
        BfunctionsTarget["~/.bfunctions"]:::target
        GitignoreTarget["~/.gitignore"]:::target
        VimrcTarget["~/.vimrc"]:::target
        I3configTarget["~/.config/i3/config"]:::target
        I3blocksTarget["~/.config/i3blocks/config"]:::target
        I3statusTarget["~/.config/i3status/config"]:::target
        XinitTarget["~/.xinitrc"]:::target
        XsessionTarget["~/.xsessionrc"]:::target
        BinTarget["~/.local/bin/"]:::target
        XresTarget["~/.Xresources"]:::target
        GdbTarget["~/.gdbinit"]:::target
        GitconfigTarget["~/.gitconfig"]:::target
        TmuxTarget["~/.tmux.conf"]:::target
        QuotesTarget["~/txt/daily_quotes.txt"]:::target
    end

    %% Runtime Phase
    subgraph "Runtime & Sourcing"
        ShellStartup["Login Shell"]:::runtime
        ShellStartup -->|"sources"| BashrcTarget
        BashrcTarget -->|"loads"| BenvTarget
        BashrcTarget -->|"loads"| BaliasesTarget
        BashrcTarget -->|"loads"| BfunctionsTarget
        UserScripts["User invokes scripts"]:::runtime
        UserScripts --> BinTarget
    end

    %% Click Events
    click Installer "https://github.com/lucasbretana/dotfiles/blob/master/install.sh"
    click EnvLoader "https://github.com/lucasbretana/dotfiles/tree/master/env"
    click Benv "https://github.com/lucasbretana/dotfiles/tree/master/home/benv"
    click Baliases "https://github.com/lucasbretana/dotfiles/tree/master/home/baliases"
    click Bfunctions "https://github.com/lucasbretana/dotfiles/tree/master/home/bfunctions"
    click Bashrc "https://github.com/lucasbretana/dotfiles/tree/master/home/bashrc"
    click GitignoreFile "https://github.com/lucasbretana/dotfiles/tree/master/home/gitignore"
    click Vimrc "https://github.com/lucasbretana/dotfiles/tree/master/home/vimrc"
    click I3config "https://github.com/lucasbretana/dotfiles/tree/master/home/i3config"
    click I3blocks "https://github.com/lucasbretana/dotfiles/tree/master/home/i3blocksconfig"
    click I3status "https://github.com/lucasbretana/dotfiles/tree/master/home/i3statusconfig"
    click Xinitrc "https://github.com/lucasbretana/dotfiles/tree/master/home/xinitrc"
    click Xsessionrc "https://github.com/lucasbretana/dotfiles/tree/master/home/xsessionrc"
    click BinDir "https://github.com/lucasbretana/dotfiles/tree/master/home/bin/"
    click Xresources "https://github.com/lucasbretana/dotfiles/tree/master/home/Xresources"
    click Gdbinit "https://github.com/lucasbretana/dotfiles/tree/master/home/gdbinit"
    click Gitconfig "https://github.com/lucasbretana/dotfiles/tree/master/home/gitconfig"
    click Tmuxconf "https://github.com/lucasbretana/dotfiles/blob/master/home/tmux.conf"
    click Quotes "https://github.com/lucasbretana/dotfiles/blob/master/home/txt/daily_quotes.txt"

    %% Styles
    classDef repo fill:#aaddff,stroke:#333,stroke-width:1px
    classDef install fill:#aaffaa,stroke:#333,stroke-width:1px
    classDef config fill:#ffdddd,stroke:#333,stroke-width:1px
    classDef scripts fill:#fff2aa,stroke:#333,stroke-width:1px
    classDef target fill:#dddddd,stroke:#333,stroke-width:1px
    classDef runtime fill:#aaffff,stroke:#333,stroke-width:1px
```
