# khuei/dotfiles architecture

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

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

## Overview

This project is a collection of dotfiles—a centralized repository of configuration files for various Unix-based tools and applications. The design’s purpose is to enable a user (or multiple users) to configure and theme their environment consistently across different applications such as the shell (Zsh), the text editor (Neovim), terminal emulator (kitty), media players (MPD and ncmpcpp), compositor (picom), window manager setups (hypr), and file manager (vifm), among others.

##### Main Components
- Shell Configuration:
- Editor Setup:
- Terminal Emulator:
- “kitty” folder holding the kitty.conf file.
- Window Manager/Specialized UI:
- “hypr” directory containing hyprland and hyprpaper configurations.
- Compositor:
- “picom” directory with its config file.
- Media and Music Player:
- “mpd” and “ncmpcpp” directories which include configurations for the MPD music daemon and its ncurses client.
- Git and Other Miscellaneous Configurations:
- Global git configuration files (.gitconfig and .gitmodules) and additional miscellaneous customizations like tmux configuration, user directories, and vifm settings.

##### Relationships and Interactions
- The install script acts as an orchestrator that applies all these settings on a new system. It likely handles linking or copying these dotfiles to the correct locations in the user’s home directory.
- Each component is mostly independent, but they work together to produce a cohesive and customizable user environment. For instance:

##### Architectural Patterns or Design Principles
- Modularity: Every aspect of the user’s environment is segmented by function (shell, editor, etc.), making it easier to update or replace individual parts.
- Extensibility: The directories (such as those providing bundle support for Neovim and zsh plugins) indicate an architecture that accommodates future extensions or configurations.

##### Relevant Technologies, Frameworks, and Tools
- Zsh: with robust plugin support including autosuggestions and syntax highlighting.
- Kitty Terminal: for terminal emulation.
- Hyprland: a dynamic window manager with its configuration laid out in its dedicated folder.
- MPD and Ncmpcpp: for managing and playing music.
- Picom: providing compositor services.
- Vifm: a console file manager using Vim-like keybindings.
- Git: for version controlling these configuration files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Install Script"]:::install

    %% Left Branch: System Interface Configurations
    subgraph "System Interface Configurations"
        S["Shell (Zsh)"]:::shell
        MISC["Git & Misc Configs"]:::misc
    end

    %% Center Branch: Application-specific Configurations
    subgraph "Application Configurations"
        E["Editor (Neovim)"]:::editor
        T["Terminal Emulator (Kitty)"]:::terminal
        F["File Manager (Vifm)"]:::filemgr
    end

    %% Right Branch: Specialized Configurations
    subgraph "Specialized Configurations"
        W["Window Manager (Hyprland)"]:::window
        P["Compositor (Picom)"]:::compositor
        M["Media Player (MPD)"]:::media
        N["Music Client (ncmpcpp)"]:::media
    end

    %% Connections from Install Script to major components
    A --> S
    A --> MISC
    A --> E
    A --> T
    A --> F
    A --> W
    A --> P
    A --> M
    A --> N

    %% Subcomponents for Shell (Zsh)
    S --> S_zshrc["File: .zshrc"]:::shellText
    S --> S_zprofile["File: .zprofile"]:::shellText
    S --> S_zdir["Directory: .zsh"]:::shellText

    %% Subcomponents for Git & Misc Configs
    MISC --> G_gitconfig["File: .gitconfig"]:::miscText
    MISC --> G_gitmodules["File: .gitmodules"]:::miscText
    MISC --> G_tmux["File: .tmux.conf"]:::miscText
    MISC --> G_userdirs_conf["File: user-dirs.conf"]:::miscText
    MISC --> G_userdirs_dirs["File: user-dirs.dirs"]:::miscText

    %% Subcomponents for Editor (Neovim)
    E --> N_init["File: init.lua"]:::editorText
    E --> N_colors["Directory: colors"]:::editorText
    E --> N_ft["Directory: ftplugin"]:::editorText
    E --> N_pack["Directory: pack"]:::editorText

    %% Subcomponents for Terminal Emulator (Kitty)
    T --> K_conf["File: kitty.conf"]:::terminalText

    %% Subcomponents for File Manager (Vifm)
    F --> V_vifmrc["File: vifmrc"]:::filemgrText
    F --> V_colors["Directory: colors"]:::filemgrText

    %% Subcomponents for Window Manager (Hyprland)
    W --> H_hyprland["File: hyprland.conf"]:::windowText
    W --> H_hyprpaper["File: hyprpaper.conf"]:::windowText

    %% Subcomponents for Compositor (Picom)
    P --> P_conf["File: picom.conf"]:::compositorText

    %% Subcomponents for Media Player (MPD)
    M --> MP_conf["File: mpd.conf"]:::mediaText

    %% Subcomponents for Music Client (ncmpcpp)
    N --> NC_conf["Config: ncmpcpp"]:::mediaText

    %% Shared Theme Node
    ST["Shared Theme (Base16)"]:::theme
    %% Dashed connections indicating shared theme usage
    S_zdir ---|"uses"| ST
    N_colors ---|"uses"| ST

    %% Click Events for Shell Configuration
    click S_zshrc "https://github.com/khuei/dotfiles/blob/master/.zshrc"
    click S_zprofile "https://github.com/khuei/dotfiles/blob/master/.zprofile"
    click S_zdir "https://github.com/khuei/dotfiles/blob/master/.zsh"

    %% Click Events for Editor Setup (Neovim)
    click E "https://github.com/khuei/dotfiles/tree/master/nvim"
    click N_init "https://github.com/khuei/dotfiles/blob/master/nvim/init.lua"
    click N_colors "https://github.com/khuei/dotfiles/tree/master/nvim/colors"
    click N_ft "https://github.com/khuei/dotfiles/tree/master/nvim/ftplugin"
    click N_pack "https://github.com/khuei/dotfiles/tree/master/nvim/pack"

    %% Click Events for Terminal Emulator (Kitty)
    click T "https://github.com/khuei/dotfiles/tree/master/kitty"
    click K_conf "https://github.com/khuei/dotfiles/blob/master/kitty/kitty.conf"

    %% Click Events for Window Manager (Hyprland)
    click W "https://github.com/khuei/dotfiles/tree/master/hypr"
    click H_hyprland "https://github.com/khuei/dotfiles/blob/master/hypr/hyprland.conf"
    click H_hyprpaper "https://github.com/khuei/dotfiles/blob/master/hypr/hyprpaper.conf"

    %% Click Events for Compositor (Picom)
    click P "https://github.com/khuei/dotfiles/tree/master/picom"
    click P_conf "https://github.com/khuei/dotfiles/blob/master/picom/picom.conf"

    %% Click Events for Media Player (MPD)
    click M "https://github.com/khuei/dotfiles/blob/master/.mpd"
    click MP_conf "https://github.com/khuei/dotfiles/blob/master/.mpd/mpd.conf"

    %% Click Events for Music Client (ncmpcpp)
    click N "https://github.com/khuei/dotfiles/tree/master/ncmpcpp"
    click NC_conf "https://github.com/khuei/dotfiles/tree/master/ncmpcpp/config"

    %% Click Events for Git & Miscellaneous Configurations
    click G_gitconfig "https://github.com/khuei/dotfiles/blob/master/.gitconfig"
    click G_gitmodules "https://github.com/khuei/dotfiles/blob/master/.gitmodules"
    click G_tmux "https://github.com/khuei/dotfiles/blob/master/.tmux.conf"
    click G_userdirs_conf "https://github.com/khuei/dotfiles/blob/master/user-dirs.conf"
    click G_userdirs_dirs "https://github.com/khuei/dotfiles/blob/master/user-dirs.dirs"

    %% Click Events for File Manager (Vifm)
    click F "https://github.com/khuei/dotfiles/tree/master/vifm"
    click V_vifmrc "https://github.com/khuei/dotfiles/tree/master/vifm/vifmrc"
    click V_colors "https://github.com/khuei/dotfiles/tree/master/vifm/colors"

    %% Styling Classes
    classDef install fill:#AEC6CF,stroke:#000,stroke-width:2px
    classDef shell fill:#C1E1C1,stroke:#000,stroke-width:2px
    classDef misc fill:#D1C4E9,stroke:#000,stroke-width:2px
    classDef editor fill:#FFB347,stroke:#000,stroke-width:2px
    classDef terminal fill:#FDFD96,stroke:#000,stroke-width:2px
    classDef filemgr fill:#FF6961,stroke:#000,stroke-width:2px
    classDef window fill:#B39EB5,stroke:#000,stroke-width:2px
    classDef compositor fill:#77DD77,stroke:#000,stroke-width:2px
    classDef media fill:#F49AC2,stroke:#000,stroke-width:2px
    classDef theme fill:#CFCFC4,stroke:#000,stroke-dasharray: 5 5,stroke-width:2px

    classDef shellText fill:#E0F7E9,stroke:#000,stroke-width:1px
    classDef miscText fill:#EDE7F6,stroke:#000,stroke-width:1px
    classDef editorText fill:#FFEBCD,stroke:#000,stroke-width:1px
    classDef terminalText fill:#FFFACD,stroke:#000,stroke-width:1px
    classDef filemgrText fill:#FFD1DC,stroke:#000,stroke-width:1px
    classDef windowText fill:#E6E6FA,stroke:#000,stroke-width:1px
    classDef compositorText fill:#D0F0C0,stroke:#000,stroke-width:1px
    classDef mediaText fill:#FADADD,stroke:#000,stroke-width:1px
```
