An authentic, modular, and safe way to deploy Linux configurations. This script acts as a professional Profile Manager that allows you to manage multiple dotfile setups, handles distribution-specific dependencies for Arch, Fedora, openSUSE, and Ubuntu, and uses an intelligent symlinking system with automated backups.
You can find all installation options in the documentation of the ML4W Dotfiles Installer here:
https://ml4w.com/dotfiles-installer/
- Distro Agnostic: Detects your package manager (Pacman, DNF, Zypper, or APT) automatically.
- Safe Sandbox: Dotfiles are first copied to a local folder before being symlinked to
$HOME. - Proactive Symlinking: Automatically detects if a symlink points to a different ID and replaces it.
- Automated Backups: Full profile snapshots and symlink backups organized by Project ID and Timestamp.
- Developer Friendly: Supports local
.dotinstfiles and local repository sources for rapid testing. - Test Mode: Verify package installation and setup logic without touching your files.
- User Overrides: Support for individual user
post.shscripts per profile. - Clean Output: Package installation output is hidden and written to a logfile.
To install the installer script to your local system:
- Clone the repository.
git clone https://github.com/mylinuxforwork/ml4w-dotfiles-installer
- Run the installation:
cd ml4w-dotfiles-installer
make install
- Ensure your PATH includes local bins:
Make sure
~/.local/binis in your environment$PATH.
To install a dotfiles profile using a remote URL:
ml4w-dotfiles-installer --install https://raw.githubusercontent.com/user/repo/main/profile.dotinst
To test a local configuration file during development:
ml4w-dotfiles-installer --install ~/Projects/dotfiles/dev.dotinst
Run the entire installation process—including package installation and pre/post scripts—without staging files or creating symlinks in your home directory. This is ideal for testing dependency logic on new distros:
ml4w-dotfiles-installer --install ~/Projects/dotfiles/dev.dotinst --testmode
The output of all package installations is hidden and written to a logfile, while a spinner shows the current progress. Each run creates a new logfile, and the last 10 are kept:
~/.local/state/ml4w-dotfiles-installer/logs/install-YYYYMMDD_HHMMSS.log
If a package fails to install, the installer continues and lists all failed packages at the end. Check the logfile for details. To show the installation output in the terminal as well, use --verbose:
ml4w-dotfiles-installer --install ~/Projects/dotfiles/dev.dotinst --verbose
{
"name": "ML4W Hyprland Stable",
"id": "com.ml4w.hyprland",
"version": "2.10.1",
"author": "Stephan Raabe",
"homepage": "https://ml4w.com",
"source": "https://github.com/mylinuxforwork/dotfiles.git",
"subfolder": "dotfiles",
"restore": [
{
"title": "Hyprland Settings",
"source": ".config/hypr/settings.conf"
}
]
}
The installer looks for an optional setup/ folder in the root of your dotfiles repository. All files are optional, and $distro is the detected distribution (arch, fedora, opensuse or ubuntu):
setup/
├── preflight.sh # Runs on all distributions
├── preflight-$distro.sh # Runs only on the matching distribution
├── dependencies/
│ ├── packages # Packages for all distributions
│ └── packages-$distro # Distribution-specific packages
├── packages/
│ ├── packages # Initial installation only: all distributions
│ └── packages-$distro # Initial installation only: distribution-specific
├── post.sh # Runs on all distributions
└── post-$distro.sh # Runs only on the matching distribution
Execution order:
preflight.sh→preflight-$distro.shdependencies/packages→dependencies/packages-$distropackages/packages→packages/packages-$distro(initial installation only)post.sh→post-$distro.sh- User
post.sh(see Personal Overrides)
Dependencies are checked and installed on every run, including updates. Use them for packages the dotfiles need to work. Packages in packages/ are installed only on the initial installation and skipped on updates (when the profile already exists in the target directory). Use them for suggested applications such as a browser or editor, so users can uninstall or replace them without an update reinstalling them.
General scripts always run before their distribution-specific counterparts, so a distro script can adjust or override what the general script did. All scripts are sourced, so variables and functions defined in a general script are available in the distro script.
Setup scripts run with visible output. To hide the output of a command and write it to the installer logfile instead, use run_logged (with an optional spinner title):
ensure_sudo # ask for the sudo password up front, before the output is hidden
run_logged --title "Installing yay..." makepkg -si --noconfirmTip: Keep
preflight.shlimited to checks, backups and prompts. Anything that installs software (e.g. an AUR helper or extra repositories) belongs inpreflight-$distro.sh.
Users can define their own personal post-installation steps that run after the repository's standard scripts. This allows for system-specific tweaks (like enabling local services or setting hardware-specific drivers) without modifying the original dotfiles.
To add an override:
- Create the profile config folder:
mkdir -p ~/.config/ml4w-dotfiles-installer/[PROFILE_ID] - Create your script:
nano ~/.config/ml4w-dotfiles-installer/[PROFILE_ID]/post.sh - Make it executable:
chmod +x ~/.config/ml4w-dotfiles-installer/[PROFILE_ID]/post.sh
The installer will detect this script and run it at the very end of the setup logic.
The blacklist allows you to prevent specific files in a profile from being overwritten during an update. This is useful for configuration files you want to manage manually or keep strictly local.
Example:
To prevent the installer from overwriting your local monitor setup or a specific theme file, add them to ~/.config/ml4w-dotfiles-installer/[PROFILE_ID]/blacklist:
# Blacklist Example
.config/hypr/conf/monitors.conf
.config/waybar/style.css
# You can also blacklist entire directories
.config/my-private-app/
Files listed here will be skipped during the staging process, preserving your local versions.
- Automatic Profile Backup: Before updates, your profile folder is backed up to
~/.mydotfiles/backups/profile-updates/[PROJECT_ID]/[TIMESTAMP]. - Selective Restoration: Interactive menu via
gumto select which custom configurations to keep. - Intelligent Merge: Selected items are merged into the new source before deployment.
The installer uses a highly organized backup system. All backups are stored in the backups folder of the dotfiles directory (~/.mydotfiles by default, or the directory set with --target):
- Symlink Backups: If a file or folder in
$HOMEor$HOME/.configis replaced by a symlink, it is moved to~/.mydotfiles/backups/[PROJECT_ID]/[TIMESTAMP]. - Active Replacement: If the installer detects an existing symlink pointing to a different project ID, it proactively recreates the link to point to the currently active profile.
The logic is separated into utils.sh and colors.sh. Feel free to add new utility functions or installation modules.