picom icon indicating copy to clipboard operation
picom copied to clipboard

config: try to convert legacy parameters to rules

Open Monsterovich opened this issue 1 year ago • 5 comments

Monsterovich avatar Aug 27 '24 00:08 Monsterovich

hmm, this is an interesting idea. but i think it doesn't actually simplify the code. or perhaps you have some other goals in mind?

yshui avatar Aug 27 '24 02:08 yshui

@yshui

hmm, this is an interesting idea. but i think it doesn't actually simplify the code. or perhaps you have some other goals in mind?

The goal is not to rewrite the whole config, at least for *-exclude parameters, if you need to add some rule in “rules”.

The program does it itself, by the way conky does the same thing with old configs and they still work.

Monsterovich avatar Aug 27 '24 02:08 Monsterovich

Okay, I've added a conversion for "wintypes". It works.

The remaining options are:

[ 27.08.2024 04:50:52.099 log_warn_both_style_of_rules WARN ] Option "inactive-opacity-override" is set along with "rules". "rules" will take precedence, and "inactive-opacity-override" will have no effect.
[ 27.08.2024 04:50:52.099 log_warn_both_style_of_rules WARN ] Option "mark-wmwin-focused" is set along with "rules". "rules" will take precedence, and "mark-wmwin-focused" will have no effect.
[ 27.08.2024 04:50:52.099 log_warn_both_style_of_rules WARN ] Option "mark-ovredir-focused" is set along with "rules". "rules" will take precedence, and "mark-ovredir-focused" will have no effect.
[ 27.08.2024 04:50:52.099 log_warn_both_style_of_rules WARN ] Option "focus-exclude" is set along with "rules". "rules" will take precedence, and "focus-exclude" will have no effect.

...there's probably no way to convert them properly, so I'll leave them as they are.

Monsterovich avatar Aug 27 '24 02:08 Monsterovich

It is one of the expressed goals to not allow mixing of new and old rule options. I think it would be better if you turn your effort into a tool that will automatically update user's config file. e.g. when the user runs picom --migrate-rules, all the old *-exclude options get rewritten as rules.

yshui avatar Aug 27 '24 03:08 yshui

@yshui

It is one of the expressed goals to not allow mixing of new and old rule options.

You'll have to, because compatibility is more important, especially when you can make it 1:1 or very close to it.

I think it would be better if you turn your effort into a tool that will automatically update user's config file. e.g. when the user runs picom --migrate-rules, all the old *-exclude options get rewritten as rules.

The problem is that you've changed the approach of how configs worked, which has been around for probably 10 years before you? Especially since the global selector is rarely necessary in reality, 95% of people will probably use “*-exclude” just like before. The issue with the requirement for "rules" option is that there is no exclude parameter for animations. And if you use rules, it breaks the whole config.

If you want decent user-experience and less whining in issues that rules breaks the config, do like in conky, which is this PR.

Monsterovich avatar Aug 27 '24 03:08 Monsterovich