sed -i 's/^M//g' file sed -i 's/\r//g' file
absh color pgm -> wrap it up https://stackoverflow.com/a/33206814
mklink C:\Users\{username}\Documents\WindowsPowerShell\profile.ps1 D:\linx\.sysman\windows\powershell\profile.ps1
mklink /d C:\Users\user\AppData\Local\nvim D:\.sysman\links\shared\config\nvim# 🛠️ Sysman - Setup System
A cross-platform, host-aware, extensible dotfiles system designed to configure development environments for:
- 🐧 Linux (Arch, Debian, Ubuntu, etc.)
- 🍏 macOS
- 🪟 Windows WSL
- 🧑💻 Root or alternate users
- 🎯 Multiple hosts (laptop, desktop, VM, etc.)
## 📁 Directory Structure
```text
dotfiles/
├── setup.sh # Main entrypoint
├── config/ # Shared ~/.config files
│ ├── nvim/
│ └── tmux/
├── home/ # Files linked directly to ~/
│ └── .bashrc
├── custom/ # Custom-mapped files (paths hardcoded in setup)
│ └── somedir/special.conf
├── platform/ # Platform specific overrides
│ ├── ubuntu/
│ │ └── config/
│ ├── macos/
│ │ └── config/
├── tools/
│ ├── ubuntu.txt
│ ├── macos.txt
│ └── wsl.txt
├── hooks/ # Pre and Post Hooks
│ ├── platform/
│ │ ├── ubuntu.pre.sh
│ │ └── macos.post.sh
│ └── host/
│ ├── my-laptop.pre.sh
│ └── work-desktop.post.sh
└── README.md # This Readme file./setup.sh [--verbose] [--debug] [--user USERNAME]| Flag | Description |
|---|---|
--debug |
Show raw command output (stdout/stderr) on terminal |
--dry-run |
Test without making changes |
--verbose / -v |
Show human-readable status logs on terminal |
--user USER |
Target a different user (e.g., root, deploy) |
--help / -h |
Print usage instructions |
home/*→~/.filenameconfig/*→~/.config/dirnamecustom/*→ Hardcoded destinationsplatform/*/config/*→ Overrides for matching OS
If a file already exists, it is moved with a timestamp:
.bashrc → .bashrc.backup.20250522094530Supported:
debian,arch, etc.macoswsl- Default fallback:
linux,unknown
Reads from:
tools/debian.txt
tools/macos.txt
tools/wsl.txt
Installs using the first available package manager:
apt,dnf,pacman,brew,apk
Custom per-environment setup:
hooks/platform/debian.sh # Runs for Debian
hooks/host/my-laptop.sh # Runs for specific hostnameAll runs are logged to:
~/.dotfiles-setup.log| Mode | Terminal Output | Log Output |
|---|---|---|
| default | silent | ✅ |
-v |
info messages | ✅ |
--debug |
full stdout/stderr | ✅ |
Create or edit:
tools/debian.txt
tools/macos.txt
tools/wsl.txtOne tool per line.
| Target directory | Symlinks to |
|---|---|
home/xyz |
~/.xyz |
config/abc/ |
~/.config/abc/ |
platform/*/config/ |
Platform-specific .config overrides |
Add files under custom/ and define paths directly in setup.sh:
symlink_file "$DOTFILES_DIR/custom/somedir/special.conf" "/etc/special.conf"# New platform
touch hooks/platform/arch.pre.sh
# New host
touch hooks/host/hostname123.post.sh- ✅ Update
tools/<platform>.txtas the setup evolves - ✅ Keep overrides minimal — most config should be shared
Test the setup without making changes:
./setup.sh --dry-run --verbose
## 💡 Tips
* Run as root to configure root user too:
```bash
sudo ./setup.sh --user root --verbose