qimgv icon indicating copy to clipboard operation
qimgv copied to clipboard

human friendly config file

Open Francesco149 opened this issue 7 years ago • 5 comments

at the moment, qimgv keeps rewriting the config file every time it's executed, undoing any formatting or hand editing you might have done to it. it also seems to store stuff that changes on every run like savedPaths

it would be nice if we had a human friendly config file for scripts and keybinds that is at least properly formatted and doesn't change randomly, that way you could cleanly commit it to a git repo like a lot of people do with their dotfiles

i personally much prefer to just edit a text file than click through buttons to rebind stuff, so as long as it doesn't randomly overwrite the config file on me unless i use the gui configurator I'd be happy

Francesco149 avatar Dec 26 '18 18:12 Francesco149

I think i'll have to split the config into 2 files: one for actual settings(which won't be overwritten every time), and other for stuff like saved window geometry, paths etc.

easymodo avatar Dec 26 '18 19:12 easymodo

hm yeah this is looking good, it doesn't seem to mess with my config file now and i can break the controls into multiple lines like this

[Controls]
shortcuts="",\
"prevImage=H",\
"nextImage=L",\
"zoomOut=J",\
"zoomIn=K",\
...

Francesco149 avatar Dec 27 '18 13:12 Francesco149

Everything under [Controls] are all in one line by default, which makes editing and reading inconvenient.

Please also use use a sensible config path/name, i.e. ~/.config/qimgv/qimgv.conf. Both seem like easy fixes and this issue can finally be closed?

rieje avatar Feb 08 '20 08:02 rieje

Hello, any news about this issue? I am trying to implement a NixOS module and I got stuck in the Scripts section. What is this encoding, anyway? script\4\value=@Variant(\0\0\0\x7f\0\0\0\aScript\0\0\0\0\x1c\0g\0m\0i\0\x63\0-\0q\0t\0 \0%\0\x66\0i\0l\0\x65\0%\x1)

hetraeus avatar May 22 '25 18:05 hetraeus

What is this encoding, anyway?

You can feed any object into QSettings and it spews it out as a string into the config file. In this case this is a struct (qstring+bool). I don't remember why I did it this way, I guess it could be rewritten but that would break saved scripts for people when they update

easymodo avatar May 22 '25 19:05 easymodo