nefelim4ag / Ananicy

Ananicy - is Another auto nice daemon, with community rules support (Use pull request please)
GNU General Public License v3.0
568 stars 78 forks source link

rules not read in a stable order #274

Closed baodrate closed 3 years ago

baodrate commented 3 years ago

Given that the included rules are stored in a directory named 00-default, I assumed that ananicy would use the file names to order the rule files. I had my overriden rules in a directory named 10-overrides. This worked for a while but I didn't realize it ananicy just parses the files in the order the filesystem returns them. So currently, there doesn't seem to be a stable way to override the supplied rules for any given application (#265) since you can't be sure that the provided rules won't be loaded last.

Would a PR to walk the config directory in lexical order by welcome?

edit: actually, now that I'm actually reading through the code I think this is a 1-line change. sorting entries in find_files should do the trick, I think