|
| 1 | +# DFM - Dotfile Manager |
| 2 | + |
| 3 | +A GTK4/Adwaita GUI application for managing dotfiles on Arch Linux. |
| 4 | + |
| 5 | +**DFM does not move or centralize your dotfiles.** Each config file stays in its original location (`~/.bashrc`, `~/.config/hypr/hyprland.conf`, etc.). DFM detects them, lets you edit in place through a friendly GUI, and creates automatic backups before any change. |
| 6 | + |
| 7 | +## Screenshots |
| 8 | + |
| 9 | +<!-- Para adicionar screenshots: |
| 10 | + 1. Rode o app: python -m dfm.main |
| 11 | + 2. Tire screenshots e salve na pasta screenshots/ |
| 12 | + 3. Descomente as linhas abaixo correspondentes |
| 13 | +--> |
| 14 | + |
| 15 | +<!--  --> |
| 16 | +*All Dotfiles — overview page with toggle switches to enable/disable each dotfile* |
| 17 | + |
| 18 | +<!--  --> |
| 19 | +*Config page — smart fields generated from the config file (toggles, sliders, color pickers, text fields)* |
| 20 | + |
| 21 | +<!--  --> |
| 22 | +*Raw text viewer — syntax highlighted view of the dotfile with copy and line wrap* |
| 23 | + |
| 24 | +<!--  --> |
| 25 | +*GitHub Sync — push/pull dotfiles to a GitHub repo, share as Gist* |
| 26 | + |
| 27 | +<!--  --> |
| 28 | +*Analyzer & Debugger — unified diagnostics for all dotfiles with severity badges and fix hints* |
| 29 | + |
| 30 | +> **Nota:** substitua os placeholders acima pelas screenshots reais. Salve as imagens em `screenshots/` e descomente as linhas `![...]`. |
| 31 | +
|
| 32 | +## Features |
| 33 | + |
| 34 | +### In-Place Editing |
| 35 | + |
| 36 | +DFM edits your dotfiles where they live — no symlinking, no moving files into a bare git repo. When you change a value in the GUI, DFM writes directly to the original file. A versioned backup is created automatically before every write, so you can always roll back. |
| 37 | + |
| 38 | +### Smart Config Parsing |
| 39 | + |
| 40 | +Automatically scans your system for known dotfiles and config directories (`~/.config/*`), analyzes each file, and generates the appropriate UI controls: |
| 41 | + |
| 42 | +- Toggle switches for boolean values (`true`/`false`, `yes`/`no`, `on`/`off`) |
| 43 | +- Sliders for numeric values (opacity, gaps, borders, etc.) |
| 44 | +- Color pickers for hex color values |
| 45 | +- Text fields for strings |
| 46 | +- Path selectors with file browser for file paths |
| 47 | +- Spin buttons for numeric values |
| 48 | +- Font fields |
| 49 | +- Keybind display for keyboard shortcuts |
| 50 | +- Section headers parsed from comments |
| 51 | + |
| 52 | +### Raw Text Viewer |
| 53 | + |
| 54 | +Built-in viewer for inspecting dotfiles without leaving the app: |
| 55 | + |
| 56 | +- Syntax highlighting (comments, keys, values, colors, booleans) |
| 57 | +- Copy to clipboard |
| 58 | +- Line wrap toggle |
| 59 | +- Reload button |
| 60 | +- File stats (line count, file size) |
| 61 | + |
| 62 | +### Backup & Versioning |
| 63 | + |
| 64 | +- Automatic backup before every edit |
| 65 | +- Versioned history stored in `~/.local/share/dfm/backups/` |
| 66 | +- Restore any previous version from the UI |
| 67 | + |
| 68 | +### Profiles & Templates |
| 69 | + |
| 70 | +- Save and switch between configuration profiles (e.g. "desktop", "laptop", "minimal") |
| 71 | +- Built-in templates for common setups |
| 72 | +- Configuration wizard for quick initial setup |
| 73 | + |
| 74 | +### Analyzer & Debugger |
| 75 | + |
| 76 | +A dedicated diagnostics page that scans all your dotfiles at once and reports issues grouped by severity (errors, warnings, info). Accessible from the sidebar or the Tools menu. |
| 77 | + |
| 78 | +**Per-file checks:** |
| 79 | +- Syntax validation for known formats (JSON, TOML, YAML, INI, shell, Xresources) |
| 80 | +- Broken symlinks and missing referenced files (`source ~/.zsh_custom` pointing to nothing) |
| 81 | +- Duplicate keys that silently shadow earlier values |
| 82 | +- Empty values that may be unintentional |
| 83 | +- Insecure permissions on sensitive files (world-readable `.netrc`, etc.) |
| 84 | +- Deprecated or problematic patterns (double PATH append, eval ssh-agent) |
| 85 | +- Missing required and optional package dependencies (checked via pacman) |
| 86 | + |
| 87 | +**Cross-file conflict detection:** |
| 88 | +- Environment variables set to different values across shells (e.g. `EDITOR` in `.bashrc` vs `.zshrc`) |
| 89 | +- Aliases defined differently in multiple shell configs |
| 90 | +- Multiple window managers enabled simultaneously (i3 + Hyprland) |
| 91 | +- Multiple notification daemons active (Dunst + Mako) |
| 92 | +- Multiple status bars enabled (Waybar + Polybar) |
| 93 | + |
| 94 | +**UI features:** |
| 95 | +- Summary cards showing total files scanned, errors, warnings, and healthy count |
| 96 | +- Color-coded severity badges (terracotta for errors, gold for warnings, azure for info) |
| 97 | +- Fix hints with one-click copy (e.g. `sudo pacman -S hyprland`, `chmod 600 ~/.netrc`) |
| 98 | +- Navigate directly from an issue to the dotfile's config page |
| 99 | + |
| 100 | +### File Change Monitoring |
| 101 | + |
| 102 | +- Real-time detection of external edits to tracked dotfiles |
| 103 | +- Toast notifications with one-click reload |
| 104 | + |
| 105 | +### GitHub Sync |
| 106 | + |
| 107 | +Sync your dotfiles with GitHub using the community-standard dedicated repo approach (`~/.dotfiles`). **This is the only feature that copies files** — it copies enabled dotfiles into `~/.dotfiles` for pushing to GitHub, but your originals stay in place. |
| 108 | + |
| 109 | +- **Push**: copies enabled dotfiles into the repo, commits, and pushes |
| 110 | +- **Pull**: pulls from GitHub and installs to home (existing files are backed up) |
| 111 | +- **Create Repo**: creates a new private `dotfiles` repo on GitHub and clones it locally |
| 112 | +- **Clone Repo**: clones your existing dotfiles repo from GitHub |
| 113 | +- **Share as Gist**: upload an individual dotfile as a GitHub Gist (secret or public) for quick sharing |
| 114 | + |
| 115 | +All GitHub features use the `gh` CLI for authentication, so no tokens are stored by DFM. |
| 116 | + |
| 117 | +### Import / Export |
| 118 | + |
| 119 | +Export your dotfiles as a `.tar.gz` archive with a manifest and import them on another machine. Existing files are backed up before overwriting. |
| 120 | + |
| 121 | +### Stoa-Themed UI |
| 122 | + |
| 123 | +- Classical dark theme inspired by [Stoa Linux](https://github.com/VictorGSchneider/StoaLinux) — marble, bronze, parchment, and stone tones |
| 124 | +- Sidebar navigation listing all detected dotfiles with icons and categories |
| 125 | +- Right panel with configuration fields grouped by section |
| 126 | +- **All Dotfiles** overview page with toggle switches, grouped by category |
| 127 | +- **Analyzer & Debugger** page for unified diagnostics |
| 128 | +- GitHub Sync status and controls integrated into the overview page |
| 129 | + |
| 130 | +## Supported Dotfiles |
| 131 | + |
| 132 | +| Category | Examples | |
| 133 | +|---|---| |
| 134 | +| Shells | `.bashrc`, `.zshrc`, `.profile`, Fish | |
| 135 | +| Window Managers | i3, Sway, Hyprland, BSPWM, Awesome, Openbox, Herbstluftwm | |
| 136 | +| Terminals | Alacritty, Kitty, Foot, WezTerm | |
| 137 | +| Status Bars | Waybar, Polybar | |
| 138 | +| Launchers | Rofi, Wofi | |
| 139 | +| Notifications | Dunst, Mako | |
| 140 | +| Editors | Vim, Neovim, Nano | |
| 141 | +| Media | MPV, CAVA, PipeWire, PulseAudio | |
| 142 | +| Appearance | GTK 3/4, Qt5/6, Fontconfig | |
| 143 | +| Development | Git | |
| 144 | +| System | Starship, Ranger, LF, Btop, Htop, Neofetch, Fastfetch, and more | |
| 145 | + |
| 146 | +80+ known config files and directories are detected automatically. |
| 147 | + |
| 148 | +## Dependencies |
| 149 | + |
| 150 | +- Python 3.10+ |
| 151 | +- GTK 4 |
| 152 | +- libadwaita |
| 153 | +- PyGObject |
| 154 | +- GitHub CLI (`gh`) — optional, required for GitHub sync features |
| 155 | + |
| 156 | +### Install on Arch Linux |
| 157 | + |
| 158 | +```bash |
| 159 | +# Required |
| 160 | +sudo pacman -S python python-gobject gtk4 libadwaita |
| 161 | + |
| 162 | +# Optional (for GitHub sync) |
| 163 | +sudo pacman -S github-cli |
| 164 | +gh auth login |
| 165 | +``` |
| 166 | + |
| 167 | +## Usage |
| 168 | + |
| 169 | +```bash |
| 170 | +# Run directly |
| 171 | +python -m dfm.main |
| 172 | + |
| 173 | +# Or install and run |
| 174 | +pip install -e . |
| 175 | +dfm |
| 176 | +``` |
| 177 | + |
| 178 | +## Project Structure |
| 179 | + |
| 180 | +``` |
| 181 | +dfm/ |
| 182 | +├── main.py # Entry point, application class, CSS |
| 183 | +├── core/ |
| 184 | +│ ├── scanner.py # Auto-detection of dotfiles on the system |
| 185 | +│ ├── parser.py # Config file parser with smart field type inference |
| 186 | +│ ├── backup.py # Versioned backup system |
| 187 | +│ ├── profiles.py # Profile management (save/switch configs) |
| 188 | +│ ├── templates.py # Built-in config templates |
| 189 | +│ ├── wizard.py # Initial setup wizard |
| 190 | +│ ├── validator.py # Syntax validation for config files |
| 191 | +│ ├── conflicts.py # Conflict detection between configs |
| 192 | +│ ├── analyzer.py # Unified analyzer (syntax, refs, dupes, deps, security) |
| 193 | +│ ├── monitor.py # File change monitoring |
| 194 | +│ ├── diff_utils.py # Diff utilities for comparing versions |
| 195 | +│ ├── notes.py # Per-dotfile user notes |
| 196 | +│ ├── dependencies.py # Dependency checking for detected tools |
| 197 | +│ ├── exporter.py # Import/export as .tar.gz archives |
| 198 | +│ └── github_sync.py # GitHub repo sync and gist sharing via gh CLI |
| 199 | +└── ui/ |
| 200 | + ├── window.py # Main window with sidebar + content panel |
| 201 | + ├── window_sidebar.py # Sidebar navigation |
| 202 | + ├── window_config_page.py # Smart config editing page |
| 203 | + ├── window_all_dotfiles.py # All Dotfiles overview page |
| 204 | + ├── window_analyzer.py # Analyzer & Debugger diagnostics page |
| 205 | + ├── window_dialogs.py # Dialogs (backup, profiles, templates, etc.) |
| 206 | + ├── window_sync.py # GitHub sync UI |
| 207 | + └── viewer.py # In-app raw text viewer with syntax highlighting |
| 208 | +``` |
| 209 | + |
| 210 | +## How It Works |
| 211 | + |
| 212 | +1. **Scan** — DFM scans `~/` and `~/.config/` for known dotfiles |
| 213 | +2. **Parse** — Each file is analyzed to infer field types (booleans, numbers, colors, paths, etc.) |
| 214 | +3. **Display** — A GUI is generated with appropriate widgets for each field |
| 215 | +4. **Analyze** — The Analyzer checks syntax, references, duplicates, dependencies, permissions, and cross-file conflicts |
| 216 | +5. **Edit** — Changes are written directly to the original file (backup created first) |
| 217 | +6. **Sync** (optional) — Copies to `~/.dotfiles` for GitHub push/pull |
| 218 | + |
| 219 | +Your dotfiles never leave home. |
| 220 | + |
| 221 | +## License |
| 222 | + |
| 223 | +GPL-3.0 |
0 commit comments