Closed xeruf closed 3 years ago
This already works with one minor change: the configs should be in a subfolder config
.
See https://www.chordpro.org/beta/chordpro-configuration-presets/#user-library
On Linux, CHORDPRO_LIB already defaults to ~/.config/chordpro (if it exists).
That's great, thank you :)
I placed a file at ~/.config/chordpro/config/twocolumn.json
and created a song-specific config file containing:
{
"include": ["twocolumn"]
}
But this does not work. Is the feature not live in 5.982?
Yes, but 5.982 song-specific configs do not yet support "include".
You may try ChordPro from git.
Using the dev branch it still does not seem to work with the setup described above :/
What does chordpro say when you add --verbose to the command?
❯ chordpro touchdown.cho --verbose
Writing output to touchdown.pdf
Adding config for userconfig
Config[0]: <builtin>
Config[1]: /usr/share/perl5/site_perl/App/Music/ChordPro/res/config/guitar.json
Config[2]: /usr/share/perl5/site_perl/App/Music/ChordPro/res/config/modern1.json
Config[3]: /home/janek/.config/chordpro/chordpro.json
Parsers at start of touchdown.cho: *common
Config[song]: touchdown.json
This doesn't seem to be the dev version.
Please cd to the directory where you checked out ChordPro from git, make sure you are on the dev
branch, and try
perl script/chordpro.pl --ident --verbose touchdown.cho
(You'll need to adjust the location for your song, or copy it).
❯ cat ~/.config/chordpro/config/twocolumn.json
{
"settings": {
"columns": 2,
},
"pdf": {
"diagrams": {
"show": "bottom"
},
},
}
❯ perl script/chordpro.pl --ident --verbose ~/data/2-standards/music/scores/touchdown.cho
This is ChordPro version 5.982_010
Writing output to /home/janek/data/2-standards/music/scores/touchdown.pdf
Adding config for userconfig
Config[0]: <builtin>
Config[1]: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Config[2]: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Config[3]: /home/janek/.config/chordpro/chordpro.json
Parsers at start of /home/janek/data/2-standards/music/scores/touchdown.cho: *common
Config[song]: /home/janek/data/2-standards/music/scores/touchdown.json
Unrecognized config type: twocolumn
at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 311.
App::Music::ChordPro::Config::get_config("twocolumn") called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 334
App::Music::ChordPro::Config::prep_configs(HASH(0x557aab536a28), "/home/janek/data/2-standards/music/scores/touchdown.json") called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 157
App::Music::ChordPro::Songbook::parse_song(App::Music::ChordPro::Songbook=HASH(0x557aab392620), ARRAY(0x557aa9eb92c8), SCALAR(0x557aaa15ad40), HASH(0x557aaa541818)) called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 108
App::Music::ChordPro::Songbook::parse_file(App::Music::ChordPro::Songbook=HASH(0x557aab392620), "/home/janek/data/2-standards/music/scores/touchdown.cho", undef) called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 190
App::Music::ChordPro::chordpro() called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 90
App::Music::ChordPro::main() called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 84
main::run() called at script/chordpro.pl line 45
Strange, Can you git pull
and retry?
no change
Very puzzling. This is what I get:
$ cat ~/.config/chordpro/config/twocolumn.json
{ "settings" : { "columns" : 2 } }
$ cat touchdown.json
{ "include": ["twocolumn"] }
$ perl script/chordpro.pl --ident --verbose touchdown.cho
This is ChordPro version 5.982_011
Writing output to touchdown.pdf
Config[0]: <builtin>
Config[1]: /home/jv/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Parsers at start of touchdown.cho: *common
Config[song]: touchdown.json
Config[song*]: /home/jv/.config/chordpro/config/twocolumn.json
Config[song*]: touchdown.json
Processing song...
Processed song...
...etc...
You don't have CHORDPRO_LIB defined?
What is in your /home/janek/.config/chordpro/chordpro.json
?
❯ cat ~/.config/chordpro/chordpro.json
{
"include": ["modern1"],
"settings": {
"notenames": true,
},
"contents": [],
"chords": [
{
"name": "C/E",
"base": 1,
"frets": [0, 3, 2, 0, 1, 0]
}
],
"metadata": {
"separator": " | ",
},
"pdf": {
"even-odd-pages": 0,
"pagealign-songs": 0,
"diagrams": {
"show": "right"
},
"fonts" : {
"subtitle" : {
"name" : "HelveticaOblique",
},
"comment" : {
"background": "",
},
"comment_box" : {
"name": "HelveticaBold",
"frame": 0,
},
},
"chorus" : {
"indent" : 0,
"bar" : {
"width" : 0,
},
"recall" : {
"type" : "comment_box",
},
},
"formats" : {
"default" : {
"footer" : [ "%{title}", "", "%{page}" ]
},
"title" : {
"subtitle" : [ "%{subtitle}", "%{artist}", "" ]
},
},
},
}
❯ echo $CHORDPRO_LIB
Can you pull again, this should yield 5.982_016.
What is the output of
perl script/chordpro.pl --debug ~/data/2-standards/music/scores/touchdown.cho |& grep RSC
Using _018
now
The command yields no output
Can you send the full output?
❯ perl script/chordpro.pl --debug ~/data/2-standards/music/scores/touchdown.cho
Writing output to /home/janek/data/2-standards/music/scores/touchdown.pdf
Reading: <builtin>
Reading: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Adding config for userconfig
Reading: /home/janek/.config/chordpro/chordpro.json
Reading: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Config[0]: <builtin>
Config[1]: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Config[2]: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Config[3]: /home/janek/.config/chordpro/chordpro.json
Process: <builtin>
Process: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Chords: Created parser for common
Processed 418 chord entries
Totals: 573 config chords
Process: /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Process: /home/janek/.config/chordpro/chordpro.json
Chords: Created parser for common
Processed 1 chord entries
Totals: 575 config chords
Parsers:
common (active)
Parsers at start of /home/janek/data/2-standards/music/scores/touchdown.cho: *common
Config[song]: /home/janek/data/2-standards/music/scores/touchdown.json
Reading: /home/janek/data/2-standards/music/scores/touchdown.json
Reading: twocolumn
Unrecognized config type: twocolumn
at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 311.
App::Music::ChordPro::Config::get_config("twocolumn") called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 334
App::Music::ChordPro::Config::prep_configs(HASH(0x559be15a9230), "/home/janek/data/2-standards/music/scores/touchdown.json") called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 157
App::Music::ChordPro::Songbook::parse_song(App::Music::ChordPro::Songbook=HASH(0x559be1404df8), ARRAY(0x559bdff2daa0), SCALAR(0x559be01ce928), HASH(0x559be09ea798)) called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 108
App::Music::ChordPro::Songbook::parse_file(App::Music::ChordPro::Songbook=HASH(0x559be1404df8), "/home/janek/data/2-standards/music/scores/touchdown.cho", undef) called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 190
App::Music::ChordPro::chordpro() called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 90
App::Music::ChordPro::main() called at /home/janek/data/2-standards/dev/aur/chordpro-dev-git/src/chordpro/script/../lib/App/Music/ChordPro.pm line 84
main::run() called at script/chordpro.pl line 45
This is not 5.892_16 or later. Pull again and make sure you are on the 'dev' branch.
❯ perl script/chordpro.pl --debug ~/data/2-standards/music/scores/touchdown.cho
This is ChordPro core 5.983
Writing output to /home/janek/data/2-standards/music/scores/touchdown.pdf
Reading: <builtin>
RSC1: ./guitar.json
RSC2: ./config/guitar.json
RSC3: guitar.json
Reading: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Adding config for userconfig
Reading: /home/janek/.config/chordpro/chordpro.json
RSC1: ./modern1.json
RSC2: ./config/modern1.json
RSC3: modern1.json
Reading: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Config[0]: <builtin>
Config[1]: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Config[2]: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Config[3]: /home/janek/.config/chordpro/chordpro.json
Process: <builtin>
Process: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/guitar.json
Chords: Created parser for common
Processed 418 chord entries
Totals: 573 config chords
Process: /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/res/config/modern1.json
Process: /home/janek/.config/chordpro/chordpro.json
Chords: Created parser for common
Processed 1 chord entries
Totals: 575 config chords
Parsers:
common (active)
Parsers at start of /home/janek/data/2-standards/music/scores/touchdown.cho: *common
Config[song]: /home/janek/data/2-standards/music/scores/touchdown.json
Reading: /home/janek/data/2-standards/music/scores/touchdown.json
RSC1: ./twocolumn.json
RSC2: ./config/twocolumn.json
RSC3: twocolumn.json
Reading: twocolumn
Unrecognized config type: twocolumn
at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 316.
App::Music::ChordPro::Config::get_config("twocolumn") called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/Config.pm line 339
App::Music::ChordPro::Config::prep_configs(HASH(0x5566eb400440), "/home/janek/data/2-standards/music/scores/touchdown.json") called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 159
App::Music::ChordPro::Songbook::parse_song(App::Music::ChordPro::Songbook=HASH(0x5566eb25fc18), ARRAY(0x5566e9d63640), SCALAR(0x5566e9fea588), HASH(0x5566eb3355a0)) called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro/Songbook.pm line 110
App::Music::ChordPro::Songbook::parse_file(App::Music::ChordPro::Songbook=HASH(0x5566eb25fc18), "/home/janek/data/2-standards/music/scores/touchdown.cho", undef) called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro.pm line 190
App::Music::ChordPro::chordpro() called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro.pm line 90
App::Music::ChordPro::main() called at /home/janek/data/2-standards/dev/music/chordpro/script/../lib/App/Music/ChordPro.pm line 84
main::run() called at script/chordpro.pl line 45
What does perl script/chordpro.pl --about
say?
Do you happen to have XDG_CONFIG_HOME
set?
I have XDG_CONFIG_HOME
set to $HOME/.config
Then another pull will solve the problem.
Finally! Thank you :)
Thank you for finding this nasty issue, and helping solve it.
Describe the bug
I would like to create custom themes, but not include them by their absolute path all the time
Expected behavior
I can include a custom preset in a local config file, such as
"include" : [ "custom" ]
, and ChordPro searches for a corresponding config file at~/.config/chordpro/custom.json
and~/.chordpro/custom.json
System information