# catlinux-utils/dotfiles-catlinux architecture

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

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

## Overview

##### Project Type & Purpose
- This is an open-source “dotfiles” repository for automating the setup of a Linux desktop (Catlinux).
- It contains configuration files, packaging scripts (PKGBUILDS), and installation scripts to deploy a pre-configured Hyprland/Waybar/Oh-My-Zsh environment on an Arch-based system.

##### File-Structure Analysis
- Top-level scripts:
- download-repo.sh / install.sh: fetch and bootstrap the repo
- user-setup.sh: orchestrates user-level configuration
- PKGBUILDS/: custom Arch package build directory + helper scripts (build.sh)
- config/: all user dotfiles under ~/.config plus .zshrc, .vimrc, etc.
- root/: skeleton for root-level files to be deployed to /etc and /usr/share
- setup-scripts/: modular bash scripts (browser-setup.sh, git-setup.sh, system scripts, etc.)

a. Repository (GitHub)
b. Bootstrapper scripts (download-repo.sh, install.sh)
c. Orchestrator (user-setup.sh)
d. Module scripts (setup-scripts/*)
e. Configuration Modules (config/.config/*: Hyprland, Waybar, Dunst, Kitty, Oh-My-Zsh, etc.)
f. Package Builder (PKGBUILDS/, build.sh → pacman/makepkg)
g. Target System:
- User home directories (~/.config, shell rc files)
- Root directories (/etc/sddm, /usr/share/backgrounds, systemd user units)
- Services (systemd, sddm, hyprland, Waybar, dunst)

##### Component Relationships & Data Flow
- Interactions between config modules (e.g., Waybar config reads Hyprland sockets)

##### Architectural Patterns & Design Principles
- Modular structure: each setup task isolated in its own script under setup-scripts/
- Convention over configuration: .config directory mirrors runtime paths
- Idempotent bootstrap: rerunning user-setup.sh safely reapplies configs
- Extensibility: new modules drop into config/.config or setup-scripts/

##### Technologies & Frameworks
- Bash scripting for orchestration
- Arch Linux packaging (PKGBUILD, makepkg, pacman)
- systemd (user and system units)
- Hyprland (Wayland compositor) + Waybar status bar
- Kitty terminal, Dunst notifications, Oh-My-Zsh shell theme

##### Essential Details to Capture
- All script layers (bootstrapper vs. orchestrator vs. modular scripts)
- Separation between user-level and root-level deployment
- The build/install cycle for custom packages
- Activation of systemd units and desktop services (Hyprland, sddm)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    GitHub(["GitHub Repository"]):::external
    ArchRepo(["Arch Linux Repos"]):::external

    %% Bootstrapper Scripts
    subgraph "Bootstrapper Scripts"
        download(["download-repo.sh"]):::script
        install(["install.sh"]):::script
    end

    %% Orchestrator
    orchestrator(["user-setup.sh"]):::script

    %% Modular Setup Scripts
    subgraph "Modular Setup Scripts"
        browser(["browser-setup.sh"]):::script
        gitsetup(["git-setup.sh"]):::script
        gtk(["gtk-setup.sh"]):::script
        vscode(["vscode-setup.sh"]):::script
        zshplugins(["zsh-plugins-setup.sh"]):::script
        uwsm(["uwsm-systemd.sh"]):::script
        subgraph "System Scripts"
            appearance(["apperance-setup.sh"]):::script
            pacmansetup(["pacman-setup.sh"]):::script
            sudo(["sudo-setup.sh"]):::script
            resolver(["systemd-resolver-setup.sh"]):::script
        end
    end

    %% Configuration Modules
    subgraph "User Configuration Modules"
        hyprconfig(["Hyprland Configs"]):::config
        ags(["Waybar (ags) Configs"]):::config
        dunst(["Dunst dunstrc"]):::config
        kitty(["Kitty Config"]):::config
        ohmyzsh(["Oh-My-Zsh Configs"]):::config
        ohmyposh(["Oh-My-Posh catlinux.json"]):::config
        systemduser(["Systemd User Units"]):::config
    end

    %% Package Builder
    subgraph "PKGBUILDS"
        pkgbuildbuild(["build.sh"]):::pkg
        pkgbuildclean(["clean.sh"]):::pkg
        PKG1(["catlinux-backgrounds/PKGBUILD"]):::pkg
        PKG2(["catlinux-hypr-config-skel/PKGBUILD"]):::pkg
        PKG3(["catlinux-hypr-config/PKGBUILD"]):::pkg
    end

    %% Root-Level Skeleton
    subgraph "Root Skeleton"
        sddmconf(["/etc/sddm.conf.d/sddm.conf"]):::root
        backgrounds(["/usr/share/backgrounds/catlinux/"]):::root
        themeconf(["/usr/share/sddm/themes/breeze/theme.conf.user"]):::root
    end

    %% Target System
    subgraph "Target System"
        userHome(["~/.config & Shell RC"]):::target
        rootDirs(["/etc & /usr/share"]):::target
        services(["systemd & Desktop Services"]):::target
        repos(["Pacman Installs"]):::target
    end

    %% Flows
    GitHub -->|clone| download
    download -->|bootstrap| install
    install -->|invoke| orchestrator
    orchestrator -->|runs| browser & gitsetup & gtk & vscode & zshplugins & uwsm
    uwsm -->|calls| appearance & pacmansetup & sudo & resolver

    browser & gitsetup & gtk & vscode & zshplugins -->|writes configs| hyprconfig & ags & dunst & kitty & ohmyzsh & ohmyposh & systemduser
    orchestrator -->|triggers| pkgbuildbuild
    pkgbuildbuild --> pkgbuildclean
    pkgbuildbuild -->|builds| PKG1 & PKG2 & PKG3
    PKG1 & PKG2 & PKG3 -->|installs via pacman| repos

    browser & gitsetup & gtk & vscode & zshplugins & uwsm -->|deploy root files| sddmconf & backgrounds & themeconf

    repos --> userHome & rootDirs
    systemduser --> services

    ArchRepo -->|dependency| repos

    %% Click Events
    click download "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/download-repo.sh"
    click install "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/install.sh"
    click orchestrator "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/user-setup.sh"
    click browser "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/browser-setup.sh"
    click gitsetup "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/git-setup.sh"
    click gtk "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/gtk-setup.sh"
    click vscode "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/vscode-setup.sh"
    click zshplugins "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/zsh-plugins-setup.sh"
    click uwsm "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/uwsm-systemd.sh"
    click appearance "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/system-scripts/apperance-setup.sh"
    click pacmansetup "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/system-scripts/pacman-setup.sh"
    click sudo "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/system-scripts/sudo-setup.sh"
    click resolver "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/setup-scripts/system-scripts/systemd-resolver-setup.sh"
    click hyprconfig "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/config/.config/hypr"
    click ags "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/config/.config/ags"
    click dunst "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/config/.config/dunst/dunstrc"
    click kitty "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/config/.config/kitty/kitty.conf"
    click ohmyzsh "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/config/.config/ohmyzsh"
    click ohmyposh "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/config/.config/ohmyposh/catlinux.json"
    click systemduser "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/config/.config/systemd/user"
    click pkgbuildbuild "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/PKGBUILDS/build.sh"
    click pkgbuildclean "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/PKGBUILDS/clean.sh"
    click PKG1 "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/PKGBUILDS/catlinux-backgrounds/PKGBUILD"
    click PKG2 "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/PKGBUILDS/catlinux-hypr-config-skel/PKGBUILD"
    click PKG3 "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/PKGBUILDS/catlinux-hypr-config/PKGBUILD"
    click sddmconf "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/root/etc/sddm.conf.d/sddm.conf"
    click backgrounds "https://github.com/catlinux-utils/dotfiles-catlinux/tree/main/root/usr/share/backgrounds/catlinux/"
    click themeconf "https://github.com/catlinux-utils/dotfiles-catlinux/blob/main/root/usr/share/sddm/themes/breeze/theme.conf.user"

    %% Styles
    classDef external fill:#c6d5fa,stroke:#5a86ff,color:#000;
    classDef script fill:#d0e8ff,stroke:#3b8edb,color:#000;
    classDef config fill:#e2f7d4,stroke:#44a340,color:#000;
    classDef pkg fill:#ffe4b3,stroke:#d68f00,color:#000;
    classDef root fill:#f5d4d4,stroke:#d12222,color:#000;
    classDef target fill:#e0e0e0,stroke:#888888,color:#000;
```
