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