Lektor
A Karaoke player made to replace the old bash scripts on Sakura.
The lektord and related binaries and source code are under the MIT license. Please, refer to the CONTRIBUTING file for any contributions.
Table of content
Building the player
Prerequisites
- rust compiler with version >= 1.70
- cmake at least the version 3.18
- C++ compiler with C++17 support
- mpv development library
- Qt6 development library: QtCore, QtWidgets, QtOpenGL, QtOpenGLWidgets.
To visualize dependencies of the rust part of lektor, you can call the script print-cargo-deps.bash from the workspaces. You will also need to have dot utility from the graphviz package to be installed for that script to work.
Building instructions
The manual way of installing and setting up lektor. We will suppose that cargo will place all the
binaries inside the target
folder and that you have all the libraries installed correctly.
cargo build --release
install -CD -m 0755 utils/scripts/kagary.py $HOME/.local/bin/kagary
cp target/release/{lektord,liblektor_c.so,lkt,amadeus} $HOME/.local/bin/
To develop, you can use cargo run --bin $BINARY
to run the desired binary without installing it.
To change the used c++ compiler, you must export the CXX
variable that indicates the correct
compiler: CXX=clang++ cargo build --release
. By default the build artifacts for the c++ code are
placed in the .build
folder at the root of the project. If you specify another compiler they will
be placed in the .build.$(basename "$CXX")
folder.
You can use podman (must be configured) or docker, with podman you don't need a root daemon and
privileges, it will run as your current user. In the former case your container registry config file
/etc/containers/registries.conf
must contains the following content:
[registries.search]
registries = ['docker.io']
When everything is configured you can run the following commands, using either docker or podman:
# AppImage build
podman build -t lektor_appimage -f Dockerfile.appimage
podman run -v $PWD/build:/build -v $PWD:/src lektor_appimage
# Windows build
podman build -t lektor_windows -f Dockerfile.windows
podman run -v $PWD/build:/build -v $PWD:/src lektor_windows
Note that the generated AppImages won't be signed, you can signed them by extracting them, and repacking them with you gpg key, here with Amadeus as an example. You will need to have downloaded the appimage utility.
./Amadeus-x86_64.AppImage --appimage-extract
mv squashfs-root Amadeus
appimagetool --comp xz --sign --sign-key $YOUR_SIGN_KEY Amadeus
How to use lektor
Important note: Upgrading the database from version 2.4 to version 3 is not possible. You need to delete the database and re-dl all the karas from kurisu.
Launch instructions
To run lektor, you can simply run the binary. Be sure to place the liblektor_c.so shared library next to the lektord binary before executing it. If lektord did not exit normally. 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.
How to update the lektord database
To update the lektor database, you first need to launch lektord, then use the lkt -Au
to update
the database and import users' favorite lists as playlists. You can also perform the update action
from the amadeus client, in the search section.
While connected to kurisu, you need to obtain a token, it can be achieved by visiting the page
https://kurisu.iiens.net/api/download.php?token while being connected. You must copy this token in
the token
field of the repo
section. For amadeus
you can also use the link in the settings
section.
How to send commands to lektor
To send commands to lektor, you can use lkt or build your own by calling directly the REST API with curl or other things. For graphical things, you can use amadeus which is a client written in iced.
The lektord daemon and the amadeus client implements the MPRIS Specification. As such you can use any MPRIS-able client to control them (playerctl, directly calling dbus things, etc.) By default lektord enables MPRIS while amadeus doesn't, this behaviour can be changed in the config files.
How to configure lektor
Lektor uses a single configuration file per tool, you will find those files in the folder:
-
$XDG_CONFIG_HOME/lektor
ifXDG_CONFIG_HOME
is defined -
$HOME/.config/lektor
otherwise
The default configuration file will be created on the first launch of the tool. In this
configuration folder the lektord program will store its configuration in lektord.toml
, lkt in
lkt.toml
, amadeus in amadeus.toml
, etc.
For amadeus, you can edit its configuration file in the settings section.