AvengeMedia / AvengeMedia/DankMaterialShell

Support config includes

Open
#1,732 1 comment 11 reactions 0 assignees View on GitHub
feature request
Dominant language
QML
Stars
8.1k
Forks
515
Avg merge
1d 8h
Merged PRs (30d)
102

Description

### Feature Description

Separate device-specific config settings from static ones.

See possible proposed solutions below.

### Use Case

I've multiple systems that use DMS and share common dotfiles via Git.
As I don't want to click through same settings/theme on all my machines, I also store DMS `settings.json` in a Git repo.

The problem is that some machine-specific configs, such as, selected backlight device or at what displays to show the bar, are also saved in the same file.

This makes sharing a mutual DMS config problematic as I have to manually "git stash" the device-specific settings, add the desired shared ones before committing changes.

### Compositor(s)

- [x] All compositors
- [ ] Niri
- [ ] Hyprland
- [ ] MangoWC (dwl)
- [ ] Sway
- [ ] Other (specify below)

### Proposed Solutions

One of solutions to the problem can be config include/extend support.

Any parameters declared in the `settings.json` file will override the extended config(s) options.

Here are possible solutions:

#### `"include"` in JSON

Add `"include"` parameter support to include one or more configs.

```json
{
"include": [
"file1.json",
"file2.json"
],
...
}
```

**Pros:**

File load order is explicitly set by user.

**Cons:**

Unfortunately this will require a one-time manual intervention from a user to add an include to the config file.

#### Autoload directory

Before loading the main `settings.json` config, DMS will autoload all config files from the `~/.config/DankMaterialShell/config.d` directory (if exists).

**Pros:**

Unlike previous option, this doesn't require any user intervention, except dropping shared config files into a designated `config.d` directory.

**Cons:**

When file load order matters (probably very rare case) - user has to explicitly name files in an ordered way.

### Alternatives/Existing Solutions

Many WMs or any other configurable projects support includes in config files.

Directory autoloads (`config.d`) approach is used in udev, NetworkManager, OpenSSH, NVIDIA driver, and another.

Contributor guide

Open the contributing guide

Research direction

Start by locating the code that loads settings.json and checking how the proposed config.d directory or include entries would fit that load path. Compare the two documented approaches, then define the merge and override behavior and verify that shared and device-specific settings can be separated; no test or implementation file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.