toml-bombadil icon indicating copy to clipboard operation
toml-bombadil copied to clipboard

[FEATURE] OS specific profiles

Open dnaka91 opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe.

I'm using toml-bombadil on both Linux and macOS and currently solve differences by having a separate macos profile with different variables and different dot locations.

With #141, I could omit several of those settings (mostly differences in font sizes). But that doesn't cope for different settings locations. For example, for Visual Studio Code the user settings are located in ~/.config/Code/User/settings.json on Linux, but in ~/Library/Application Support/Code/User/settings.json.

It would be great to have some way to define different targets for different OSs.

Describe the solution you'd like

Eventually having some pre-defined profiles that are auto-enabled depending on the OS? That would mean we perhaps have profile.windows, profile.macos and Linux being the default profile. Then, depending on whether Windows or macOS are detected, they'd be automatically be added to the enabled profiles.

That would potentially break some templates, as people might already have profiles with the same name. Could get around that by making a special category like profile.os.*, to make clear these aren't user-defined profiles, but pre-defined.

Describe alternatives you've considered

Nothing else really. My current solution with the macos profile works well, but easy to forget to enable the profile.

Additional context

A basic idea how the settings could be defined:

dotfiles_dir = "Projects/dotfiles"

[settings]
vars = ["vars/colors.toml", "vars/font.toml"]

[settings.dots]
vscode = { source = "editor/vscode.json", target = ".config/Code/User/settings.json" }

# Auto-enabled profile when on macOS
[profiles.os.macos]
vars = ["profiles/macos/vars/font.toml"]

[profiles.os.macos.dots]
vscode = { target = "Library/Application Support/Code/User/settings.json" }

# Auto-enabled profile when on Windows
[profiles.os.windows]
# Something Windows-specific here

dnaka91 avatar Jan 11 '23 03:01 dnaka91