The Guide to getting LilyPond Point and Click going with Atom under
Fedora 33
--------------------------------------------------------------------------------------------------------------
The NR leaves out some important information about how to configure a Ubuntu
system to use Gvim for point and click from Lilypond PDF files. Where
the NR is
substantially correct, that information is copied here.
Requirements
------------
Fedora 33
Document Viewer (evince)
Atom 1.52.0
[assumes bash shell]
Setting the EDITOR variable
---------------------------
Lilypond uses the environment variable EDITOR to select which editor to
use to
display point and click links. For Atom, simply use the value 'atom':
export EDITOR=gvim
Setting LYEDITOR is not required.
You can start evince from a terminal command to view a PDF. But if you
want to
click on a PDF in GNOME Nautilus to view it then just exporting this
variable
from the various bash startup files is inadequate. Gnome is started by
Xsession
in X11 before terminals and shells. Therefore it is unable to see
environment
variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
recall that Xsession uses the startup file $HOME/.xsessionrc. For
environment
variables that are to be shared between GNOME applications and terminal
shells,
do the following. Create a file for variable declarations, of arbitrary
name.
Add the EDITOR setting to that file:
$ echo 'export EDITOR=atom' > ~/.my_env_vars
Then edit ~/.xsessionrc to contain:
if [ -f ~/.my_env_vars ]; then
. ~/.my_env_vars
fi
Now also add these same lines to ~/.bashrc. Some like to use
.bash_profile or
other mechanisms, but the principle is the same. Manage any shared variables
that Nautilus and a bash shell both need in this third file. To make
this take
effect, logout and login again so that a new Xsession is started.
Installing Atom
---------------
Atom is not in the standard repository for Fedora.
# dnf install $(curl -sL
"https://api.github.com/repos/atom/atom/releases/latest" | grep
"https.*atom.x86_64.rpm" | cut -d '"' -f 4)
Configuring the GNOME 3 Desktop
-------------------------------
Create the file 'lilypond-invoke-editor.desktop':
[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true
Run:
$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
$ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit
Check that this works using xdg-open.
$ xdg-open textedit:///etc/issue:1:0:0
If all is correct lilypond-invoke-editor will run and display the file
in Atom, with the cursor
at the right point.