-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot produce backslash (\) in configuration key #163
Comments
The It sounds like maybe this isn't a KDE config file, but just happens to have a similar-ish syntax? I don't think If you want to test this, use
I think you'll find that it correctly reads the key with a config file generated by the current plasma-manager, and spits out a bunch of "Invalid escape sequence" errors when it tries to read your sample config file. |
Ok, I understand. I guess, this strictly limits the scope to KDE config files, and excludes applications. Maybe a somewhat wider scope would be nice, so that users don't have to implement functionality that already exists in this project, specifically for only updating keys without overwriting the entire file. From a user perspective (ignoring the effort it would take to implement), maybe it would be useful to allow the creation of any key values in the config file, possibly with warnings if the result does not match the KDE config file specification. Or is it perhaps the case (and/or the goal) that anything a user can create must be a valid KDE configuration file? |
There are plenty of applications that use KDE config files and are supported by this module. It just sounds like syncthingtray isn't one of them.
There are tons of different config file formats; it's just a coincidence that the KDE config file format is similar to the standard INI format. If you wanted "to allow the creation of any key values", you would need to support YAML config files, and TOML config files, and sqlite databases, and all the application-specific formats too. This module is designed to support only one config file format, kconfig. I don't think it makes sense to build a generic "mutate this config file in an arbitrary way" feature into plasma-manager. |
Ok, I thought there might be a reasonable superset of the currently allowed syntax, but perhaps there isn't.
Is this valid KDE config file syntax, and if so, can it be produced with |
Yes, that's valid KDE config file syntax (and invalid INI syntax). I believe under the current plasma-manager syntax it's programs.plasma.configFile.powerdevilrc."AC/SuspendAndShutdown".AutoSuspendAction = 0; |
We could maybe add an option down the line preventing plasma-style escapes for individual keys (which could be enabled manually), though it won't be an immediate priority unless someone makes a pr. |
The problem is not writing individual keys, the problem is that the resulting (or perhaps starting) file is already not a valid KDE config file, so you can't parse it correctly to add in the new keys. This would cause problems even if the invalid key is not even mentioned in the Nix config. |
I guess if we would add such an option that it would be toggled manually for non-kde config-files. Configuring non-kde config-files is somewhat out of scope of this project though (though I will admit I use |
There is no obvious way of creating a single backslash in the configuration key of a kde configuration file anymore. This was possible until recently but is now broken - probably since #156 (@quentinmit)
For example, syncthingtray uses backslashes in its configuration. E.g., the file
syncthingtray.ini
has entries like so:Previously, this could be created with
Now this is not possible anymore. For example:
...\1...
produces...1...
....\\1...
produces...\\1...
.There is no obvious way of creating a single backslash.
The text was updated successfully, but these errors were encountered: