Only add/modify what's in .src.ini, leaving all the rest untouched #97
Replies: 8 comments 8 replies
-
Hi, Your suggested behaviour is indeed a different behaviour than what is implemented. The approach currently is "merge everything unless rules say otherwise". After thinking for a couple of minutes about the different approaches it isn't obvious to me that one is better than the other, with one exception: With "only handle some sections", it becomes difficult to handle re-adding files from the system to update the chezmoi source state. This is something that currently works fairly well and transparently with only minor annotations needed for when you are doing things with Your suggested workaround of manually ignoring sections could work, but sounds annoying to maintain to be honest. It would be compatible with re-adding files though, so that is a plus. So I'm wondering why you want to only manage some sections instead of just ignoring only the problematic sections (like recently opened files or window positions). Is there a reason why you think that approach is better? (I'm not necessarily arguing against you, I'm interested to learn and see if there is potential for improvement.) |
Beta Was this translation helpful? Give feedback.
-
Hi! Maybe I'm biased by my current Ansible approach, where I only specify my customizations. I haven't considered the re-adding feature (which is a cool feature of chezmoi itself), so, if re-adding would be hard to implement in my view, then it's not worthwhile to investigate it further. I was thinking about customizing shortcuts: I'd only want to specify my custom ones without having in the source the full list (e.g., see I guess it's just a matter of excluding the known sections that KDE applications continuously modify. The number of ignored sections shouldn't be long (I also looked at your documentation and examples). I'll try to port my dotfiles accordingly. I only started the discussion to be sure I hadn't missed such a feature. |
Beta Was this translation helpful? Give feedback.
-
The merging semantics implemented by Chezmoi_modify_manager (chmm for short, I should have picked a shorter name in retrospect):
There are additionally a few corner cases in the actual implementation (keys before the first section, sections entirely missing, etc) that are properly handled to do the "obviously expected thing". I do believe this qualifies as a merging algorithm.
Chmm has special support for adding new and readding existing ini-files. Use
Take a look at https://github.com/VorpalBlade/chezmoi_modify_manager/blob/main/doc/examples.md in general for examples of how to configure many KDE settings (not really updated for KDE 6 yet though, but so far I found that not much changed there with regards to ignores, the bigger issue is when you have a mix of KDE 5 and KDE 6 systems, see #98 for more thoughts on that). My approach for shortcuts specifically is to just manage the entire file. If there is a KDE upgrade that changes things, I just re-add the file to update it in the My current file looks like:
This does trigger a warning currently: |
Beta Was this translation helpful? Give feedback.
-
I started with Dolphin. [MainWindow]
MenuBar=Enabled
ToolBarsMovable=Disabled
[Open-with settings]
CompletionMode=1
[VersionControl]
enabledPlugins=Dropbox and I had to do
maybe it's just a matter of doing the hard work the first time ;) |
Beta Was this translation helpful? Give feedback.
-
And it's still giving me headaches: after opening Dolphin, if I try to re-apply I always get: --- a/.config/dolphinrc
+++ b/.config/dolphinrc
@@ -21,6 +21,7 @@
[MainWindow]
ToolBarsMovable=Disabled
+MenuBar=Enabled
[Open-with settings]
CompletionMode=1
History=kate so I guess I have to disable that section completely as in the example; but maybe that's one of the things I'd want to keep ;) |
Beta Was this translation helpful? Give feedback.
-
I think the problem with menubar is that the default value is true, so it's always removed if I set that property to true (in the original file it was set to false). I guess that's the default behavior of KDE not to set properties to have their default values. So it's not a problem I'd say: it's just a matter of not specifying that property in my source and everything's fine (I want the menu bar) |
Beta Was this translation helpful? Give feedback.
-
I'm doing some other experiments with Plasma 6. On a fresh VM, it looks like the rc files in |
Beta Was this translation helpful? Give feedback.
-
Another example: if I only want to set the fixed font, I can write the "modify_..." as follows:
|
Beta Was this translation helpful? Give feedback.
-
Hi
I've just started exploring chezmoi_modify_manager to handle my KDE dotfiles (currently, I'm using the Ansible-specific ini module).
What I'd like to do is have a
.src.ini
file with only my custom sections and key-values; I'd like these to be merged into the target (if they don't exist, then add them; if they exist, then replace them). So, what's missing in my.src.ini
should not be removed from the target. I think this would be a real merging behavior.I seem to understand that's not currently possible, is that?
I should manually ignore all the sections I don't want to handle (and that's easy: just ignore a whole section); however, for single key-values in a section I should ignore them one by one, is that right?
Or am I missing something?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions