Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 06ec2fe1 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

DOC: Change error message for lkt when unable to connect to lektord + update README

Be more explicit about the need for lektord to be launched before using
the lkt client.

Also update the readme:
- add the update procedure
- 80 col formated text
parent 545a6e10
Branches
Aucune étiquette associée trouvée
1 requête de fusion!160DOC: Change error message for lkt when unable to connect to lektord + update README
Pipeline #2229 réussi avec des avertissements
...@@ -19,10 +19,11 @@ A Karaoke player made to replace the old bash scripts on Sakura. ...@@ -19,10 +19,11 @@ A Karaoke player made to replace the old bash scripts on Sakura.
### Prerequisites ### Prerequisites
- [autotools](https://www.gnu.org/software/autoconf/), libtool, autoconf, automake, etc - [autotools](https://www.gnu.org/software/autoconf/), libtool,
autoconf, automake, etc
- a C compiler with C11 support - a C compiler with C11 support
- the [sqlite3](https://www.sqlite.org/) development library, version 3.31.0 or newer for - the [sqlite3](https://www.sqlite.org/) development library, version
[generated columns](https://www.sqlite.org/gencol.html) support 3.31.0 or newer for [generated columns](https://www.sqlite.org/gencol.html) support
- a POSIX.1-2008 compatible system (i.e. not MS Windows) - a POSIX.1-2008 compatible system (i.e. not MS Windows)
For the module sdl2, you will need the folowing prerequisites: For the module sdl2, you will need the folowing prerequisites:
...@@ -41,36 +42,40 @@ To build Klkt, you will need: ...@@ -41,36 +42,40 @@ To build Klkt, you will need:
- qmake and Qt5 developpement libraries (Qt5Core Qt5Gui Qt5Network Qt5Widgets) - qmake and Qt5 developpement libraries (Qt5Core Qt5Gui Qt5Network Qt5Widgets)
- don't forget the qt5dxcb-plugin (xcb plugin for qt5) when compiling - don't forget the qt5dxcb-plugin (xcb plugin for qt5) when compiling
You will also need the following executables, with their path setted in the configuration file: You will also need the following executables, with their path setted in
the configuration file:
- mkvpropedit from [mkvtoolnix](https://gitlab.com/mbunkus/mkvtoolnix) - mkvpropedit from [mkvtoolnix](https://gitlab.com/mbunkus/mkvtoolnix)
- the bourn shell again: [bash](https://git.savannah.gnu.org/cgit/bash.git) - the bourn shell again: [bash](https://git.savannah.gnu.org/cgit/bash.git)
- the command line tool xxd, is distributed in the - the command line tool xxd, is distributed in the
[vim](https://www.archlinux.org/packages/extra/x86_64/vim/) and [vim](https://www.archlinux.org/packages/extra/x86_64/vim/) and
[gvim](https://www.archlinux.org/packages/extra/x86_64/gvim/) packages on archlinux, seems to be [gvim](https://www.archlinux.org/packages/extra/x86_64/gvim/) packages
distributed in its own package on debian: [xxd](https://packages.debian.org/sid/xxd) on archlinux, seems to be distributed in its own package on debian:
[xxd](https://packages.debian.org/sid/xxd)
If you use the configure with the `--with-depends` option (needed on debian 10), you will need the If you use the configure with the `--with-depends` option (needed on
following dependencies: debian 10), you will need the following dependencies:
- the [curl](https://curl.haxx.se/) command line utility. It can be replaced by the wget command - the [curl](https://curl.haxx.se/) command line utility. It can be
line utility. replaced by the wget command line utility.
- the [wget](https://www.gnu.org/software/wget/) command line utility. Can be replaced by curl - the [wget](https://www.gnu.org/software/wget/) command line utility.
command line utility. Can be replaced by curl command line utility.
- the [git](https://git-scm.com/) command line utility - the [git](https://git-scm.com/) command line utility
Note that because of the use of `curl` and `get`, building behind a proxy may be challenging. Note that because of the use of `curl` and `get`, building behind a
proxy may be challenging.
If you are developping for lektor, you will need: If you are developping for lektor, you will need:
- the [astyle](http://astyle.sourceforge.net/) command line utility, for a beautifull and uniform - the [astyle](http://astyle.sourceforge.net/) command line utility, for
coding style for C code. a beautifull and uniform coding style for C code.
- the [clang-format](https://releases.llvm.org/download.html) command line utility, for a - the [clang-format](https://releases.llvm.org/download.html) command
beautifull and uniform C++ code style. [Here](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) line utility, for a beautifull and uniform C++ code style.
is the list of all the options to put in the `.clang-format` file. [Here](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) is
the list of all the options to put in the `.clang-format` file.
> If you are having problems build lektor (AC macros not defined), try copy the > If you are having problems build lektor (AC macros not defined), try
> `.m4` files from `/usr/share/aclocal` to `config/m4`. copy the `.m4` files from `/usr/share/aclocal` to `config/m4`.
### Building instructions ### Building instructions
...@@ -98,72 +103,95 @@ The recommended `configure` command is the following: ...@@ -98,72 +103,95 @@ The recommended `configure` command is the following:
CC=clang CXX=clang++ # I prefer clang over gcc CC=clang CXX=clang++ # I prefer clang over gcc
``` ```
The sqlite database and the config file will be created automatically if needed, i.e. on the first The sqlite database and the config file will be created automatically if
run. If you are upgrading lektor, the config might not be correct. You can delete the config file needed, i.e. on the first run. If you are upgrading lektor, the config
or use the `lkt admin config` to generate the config file again. might not be correct. You can delete the config file or use the `lkt
admin config` to generate the config file again.
> **Important note**: Upgrading the config or the database scheme automatically is not supported
yet. If you are experiencing weird things with lektord, please try first to delete the database > **Important note**: Upgrading the config or the database scheme
and config and regenerate them. There are currently no way of doing a backup of playlists and > automatically is not supported
stickers with lektor, this is WIP. yet. If you are experiencing weird things with lektord, please try first
to delete the database and config and regenerate them. There are
If you are using special modules or are compiling lektor without static modules, you may set their currently no way of doing a backup of playlists and stickers with
**absolute path** inside the lektor's config file. lektor, this is WIP.
To generate AppImages, add `--enable-appimage` to the `configure` line. Note If you are using special modules or are compiling lektor without static
that the only supported distribution methode is AppImage. modules, you may set their **absolute path** inside the lektor's config
file.
> **Important note**: if you are building using WSL, `lektord` will likely not launch, because
`XDG_RUNTIME_DIR` is not defined here. This folder is important, this is where most of your To generate AppImages, add `--enable-appimage` to the `configure` line.
deamons are puttings theirs sockets and so. Blame Microsoft for that. A workaround is to export Note that the only supported distribution methode is AppImage.
one: `export XDG_RUNTIME_DIR=$(mktemp -d)` before launching lektord. Be aware that you will have
issues with sound and videos becouse you will need to set up a X server... > **Important note**: if you are building using WSL, `lektord` will
likely not launch, because `XDG_RUNTIME_DIR` is not defined here. This
> Currently, supported compilers are: `icc` 19.1.2.254 and above, `gcc` 8.3.0 and above, folder is important, this is where most of your deamons are puttings
`clang` 7.0.1 and above. It compiles on debian, thus it must compiles on your system (apport from theirs sockets and so. Blame Microsoft for that. A workaround is to
CentOS, because I never tested on it, and it no longer exists...). export one: `export XDG_RUNTIME_DIR=$(mktemp -d)` before launching
lektord. Be aware that you will have issues with sound and videos
becouse you will need to set up a X server...
> Currently, supported compilers are: `icc` 19.1.2.254 and above, `gcc`
8.3.0 and above, `clang` 7.0.1 and above. It compiles on debian, thus it
must compiles on your system (apport from CentOS, because I never tested
on it, and it no longer exists...).
## Preparing a kara for lektor ## Preparing a kara for lektor
The ideal way of populating lektor is using *Kurisu*. The `update` and `rescan` commands are here The ideal way of populating lektor is using *Kurisu*. The `update` and
for that. To import the favorites and playlists from *Kurisu*, use the `import` command. `rescan` commands are here for that. To import the favorites and
playlists from *Kurisu*, use the `import` command.
## How to use lektor ## How to use lektor
### Launch instructions ### Launch instructions
To run lektor, you can simply run the binary like: `./lektord`. If lektord did not exited normally To run lektor, you can simply run the binary like: `./lektord`. If
(i.e. without the `lkt adm kill` command), the database will still store the fact that lektord is lektord did not exited normally (i.e. without the `lkt adm kill`
running. To by-pass it, you will need to launch lektord with the `-F` (forced) option, like `lektord -F`. command), the database will still store the fact that lektord is
running. To by-pass it, you will need to launch lektord with the `-F`
(forced) option, like `lektord -F`.
It is not recommended to launch always lektord with the `-F` option,
because that way you could launch multiple instances of the lektod
daemon, which could results in undefined behaviours.
Lektor will use specialized software (hwdec set to yes), if you have an
nvidia card with optimus (in almose every laptop), please use `optirun`
or `primusrun`: `optirun ./lektord`
It is not recommended to launch always lektord with the `-F` option, because that way you could launch ### How to update the lektord database
multiple instances of the lektod daemon, which could results in undefined behaviours.
Lektor will use specialized software (hwdec set to yes), if you have an nvidia card with optimus (in To update the lektor database, you first need to launch `lektord`, then
almose every laptop), please use `optirun` or `primusrun`: `optirun ./lektord` use the `lkt adm update` to update the database and `lkt adm import` to
import users' favorite lists as playlists.
### How to send commands to lektor ### How to send commands to lektor
Lektor is compatible with mpd, which means that you can use any client (only mpc is tested) to interact Lektor is compatible with mpd, which means that you can use any client
with lektor. Some functions are not *really* compatible (somme work to be done) because mpc *really* (only mpc is tested) to interact with lektor. Some functions are not
makes some assumptions. The ideal way is to use `lkt`. *really* compatible (somme work to be done) because mpc *really* makes
some assumptions. The ideal way is to use `lkt`.
### How to configure lektor ### How to configure lektor
Lektor configuration is done with an INI file. Modules' configuration is also done by the same INI Lektor configuration is done with an INI file. Modules' configuration is
file using diferent sections. Lektor searches for the configuration file in that order: also done by the same INI file using diferent sections. Lektor searches
for the configuration file in that order:
1. `$PWD/lektor.ini` 1. `$PWD/lektor.ini`
2. if `XDG_CONFIG_HOME` defined? `$XDG_CONFIG_HOME/lektor/lektor.ini` : `$HOME/.config/lektor/lektor.ini` 2. if `XDG_CONFIG_HOME` defined? `$XDG_CONFIG_HOME/lektor/lektor.ini` :
`$HOME/.config/lektor/lektor.ini`
3. `/opt/lektor/lektor.ini` 3. `/opt/lektor/lektor.ini`
4. `/usr/local/etc/lektor.ini` 4. `/usr/local/etc/lektor.ini`
5. `/etc/lektor.ini` 5. `/etc/lektor.ini`
To get the default config file, you can use the `lkt adm conf` command. If no config file is found, To get the default config file, you can use the `lkt adm conf` command.
lektord will try to create the `$HOME/.config/lektor/lektor.ini` config file with the default content. If no config file is found, lektord will try to create the
`$HOME/.config/lektor/lektor.ini` config file with the default content.
Be aware that if the home directory or the `XDG_CONFIG_HOME` are too long they will be ignored and Be aware that if the home directory or the `XDG_CONFIG_HOME` are too
truncated. You may then get uncomprehensible errors. long they will be ignored and truncated. You may then get
uncomprehensible errors.
## Contributing ## Contributing
...@@ -171,7 +199,8 @@ Please, refer to the [CONTRIBUTING](CONTRIBUTING.md) file. ...@@ -171,7 +199,8 @@ Please, refer to the [CONTRIBUTING](CONTRIBUTING.md) file.
## MPD ## MPD
Lektor is almost MPD compatible, at least it uses the same protocol, which can be gotten Lektor is almost MPD compatible, at least it uses the same protocol,
[here](https://www.musicpd.org/doc/html/protocol.html#). The full support for MPD clients (like mpc which can be gotten
and ncmpc) is still WIP. For the MPD compatibility list, see the [here](https://www.musicpd.org/doc/html/protocol.html#). The full
[CONTRIBUTING](CONTRIBUTING.md) file. support for MPD clients (like mpc and ncmpc) is still WIP. For the MPD
compatibility list, see the [CONTRIBUTING](CONTRIBUTING.md) file.
...@@ -285,7 +285,7 @@ create_socket(const char *host, const char *port) ...@@ -285,7 +285,7 @@ create_socket(const char *host, const char *port)
/* Common part */ /* Common part */
cx = socket(domain, SOCK_STREAM, 0); cx = socket(domain, SOCK_STREAM, 0);
FAIL_IF(cx <= 0 || connect(cx, ptr_sock, sock_len), "Connect to socket failed"); FAIL_IF(cx <= 0 || connect(cx, ptr_sock, sock_len), "Connect to socket failed, is lektord launched?");
socket_desc = fdopen(cx, "r+"); socket_desc = fdopen(cx, "r+");
FAIL_IF(!socket_desc, "Failed to connect to lektord"); FAIL_IF(!socket_desc, "Failed to connect to lektord");
return socket_desc; return socket_desc;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter