diff --git a/helix.sh b/helix.sh index f6d3aac..0833bf6 100644 --- a/helix.sh +++ b/helix.sh @@ -1,3 +1,9 @@ #!/bin/sh -HELIX_RUNTIME=/usr/lib64/helix/runtime exec /usr/lib64/helix/hx "$@" +if [ "$USER" == "root" ] +then + HELIX_RUNTIME=/usr/lib64/helix/runtime exec /usr/lib64/helix/hx "$@" +else + mkdir -p "$HOME/.config/helix/runtime" + exec /usr/lib64/helix/hx "$@" +fi diff --git a/helix.spec b/helix.spec index 2e231d1..1b67834 100644 --- a/helix.spec +++ b/helix.spec @@ -59,11 +59,11 @@ install -Dm755 %{SOURCE3} %{buildroot}%{_bindir}/%{name} %post -p /bin/bash MESSAGE="The launcher binary is renamed as 'helix', alias hx='helix' if you were using 'hx'. - Helix also needs its runtime files so make sure to copy/symlink the runtime/ directory into the config directory (for example ~/.config/helix/runtime). - Runtime directory is found in '/usr/lib64/helix/runtime'. - Then run 'helix --grammar fetch' then 'helix --grammar build' to install the grammars. - To customize language-specific settings, you can copy '/usr/share/doc/packages/helix/languages.toml' - to '~/.helix/' or '~/.config/helix'. More information can be found in https://docs.helix-editor.com/languages.html" +Helix also needs its runtime files so make sure to copy/symlink the runtime/ directory into the config directory (for example ~/.config/helix/runtime). +If you see an error when launching helix, copy the runtime directory. Runtime directory is found in '/usr/lib64/helix/runtime'. +Then run 'helix --grammar fetch' then 'helix --grammar build' to install the grammars. +To customize language-specific settings, you can copy '/usr/share/doc/packages/helix/languages.toml' +to '~/.helix/' or '~/.config/helix'. More information can be found in https://docs.helix-editor.com/languages.html" echo -e "${MESSAGE}" %files