2024-02-05 17:12:29 +03:00
# yandex-music-linux
## About
Native YandexMusic client for Linux. Built using repacking of Windows client (Electron app).
2024-11-09 14:15:41 +03:00
## Screenshots
![image ](https://github.com/cucumber-sp/yandex-music-linux/assets/100789522/ab2f69ee-efc4-4a33-8110-131b4c4ff4de )
![image ](https://github.com/cucumber-sp/yandex-music-linux/assets/100789522/de618654-15d1-4103-a323-faa00086d0a2 )
2024-02-05 17:12:29 +03:00
## Table of content
- [Screenshots ](#screenshots )
- [Installation ](#installation )
- [Arch Linux ](#arch-linux )
- [Debian/Ubuntu ](#debianubuntu )
2024-04-24 20:26:39 +03:00
- [RPM-based ](#rpm-based )
- [Configuration ](#configuration )
- [Configuration file ](#configuration-file )
- [Custom Electron binary ](#custom-electron-binary )
- [Electron arguments ](#electron-arguments )
- [Tray mode ](#tray-mode )
2024-10-03 19:30:23 +03:00
- [Dev tools ](#dev-tools )
- [Custom title bar ](#custom-title-bar )
2024-02-05 17:12:29 +03:00
- [Manual Build ](#manual-build )
- [Prerequisites ](#prerequisites )
- [Extract app only ](#extract-app-only )
- [ASAR archive ](#asar-archive )
- [Arch Linux ](#arch-linux-1 )
- [Debian/Ubuntu ](#debianubuntu-1 )
2024-09-03 09:47:50 +03:00
- [RPM-based ](#rpm-based-1 )
2024-02-04 13:55:06 +03:00
- [Run with nix ](#run-with-nix )
2024-09-03 09:47:50 +03:00
- [NixOS unstable ](#nixos-unstable )
- [Run from unstable channel with flakes ](#run-from-unstable-channel-with-flakes )
- [Install from unstable channel ](#install-from-unstable-channel )
- [Overriding ](#overriding )
- [Built-in module ](#built-in-module )
- [Run with flakes ](#run-with-flakes )
- [Run old style ](#run-old-style )
- [Install to NixOS ](#install-to-nixos )
2024-10-14 21:20:00 +03:00
- [Star History ](#star-history )
2024-02-05 17:12:29 +03:00
## Installation
### Arch Linux
#### AUR
2024-02-14 14:07:10 +03:00
You can obtain the latest version of package from `AUR` using one of the [AUR Helpers ](https://wiki.archlinux.org/title/AUR_helpers ). Then install it with `yandex-music` as package name.
2024-02-05 17:12:29 +03:00
For this example I will use [yay ](https://github.com/Jguer/yay )
2024-02-29 18:05:13 +03:00
```bash
2024-02-14 14:07:10 +03:00
yay -S yandex-music
2024-02-05 17:12:29 +03:00
```
#### Binary package file
Download prebuilt binary package from [Releases ](https://github.com/cucumber-sp/yandex-music-linux/releases ) section.
Then you can install it with the following command
2024-02-29 18:05:13 +03:00
```bash
2024-02-14 14:07:10 +03:00
pacman -U yandex-music-< version > -any.pkg.tar.zst
2024-02-05 17:12:29 +03:00
```
***
### Debian/Ubuntu
#### APT
2024-05-18 15:40:19 +03:00
Download key and add repository to mirror list
```bash
curl -fsSL https://apt.cucumber-space.online/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/cucumber-space.key.gpg
2024-05-18 16:00:23 +03:00
echo 'deb [signed-by=/etc/apt/keyrings/cucumber-space.key.gpg] https://apt.cucumber-space.online ./' | sudo tee /etc/apt/sources.list.d/cucumber-space.list > /dev/null
2024-05-18 15:40:19 +03:00
sudo apt update
```
Then you can install app with
```bash
sudo apt install yandex-music
```
2024-02-05 17:12:29 +03:00
#### Binary package file
Download prebuilt binary package from [Releases ](https://github.com/cucumber-sp/yandex-music-linux/releases ) section.
Then you can install it with the following command
2024-02-29 18:05:13 +03:00
```bash
2024-02-14 14:07:10 +03:00
dpkg -i yandex-music_< version > _< arch > .deb
2024-02-05 17:12:29 +03:00
```
***
2024-04-24 20:26:39 +03:00
### RPM-based
#### DNF
2024-04-27 20:10:35 +03:00
Package is currently unavailable at DNF. If you'd like to help us with publishing, feel free to open new issue.
2024-04-24 20:26:39 +03:00
#### Binary package file
Download prebuilt binary package from [Releases ](https://github.com/cucumber-sp/yandex-music-linux/releases ) section.
Unfortunatelly, we only provide packages for x64 architecture. If you need package for different architecture, you can build it manually.
Then you can install it with the following command
```bash
rpm -i yandex-music-< version > -1.x86_64.rpm
```
***
## Configuration
### Configuration file
You can find configuration file at `HOME/.config/yandex-music.conf` . It's a simple `key=value` file that's sourced before launching the app. This means you can set environment variables and other options there.
***
### Custom Electron binary
You can set path to custom Electron binary with `ELECTRON_CUSTOM_BIN` option. For example:
```bash
ELECTRON_CUSTOM_BIN=/usr/bin/electron
```
***
### Electron arguments
You can set custom Electron flags with `ELECTRON_ARGS` option. By default it's set to `--no-sandbox` . For example:
```bash
ELECTRON_ARGS="--no-sandbox --trace-warnings"
```
***
### Tray mode
Tray mode is disabled by default. It allows program to be minimized to tray instead of closing. To enable it set `TRAY_ENABLED` option to `1` .
![image ](https://github.com/cucumber-sp/yandex-music-linux/assets/100789522/5998ba7f-9ee7-4725-9d51-fbe5510a799d )
***
2024-08-05 00:04:05 +03:00
### Dev tools
Chromium developer/debug tools can be enabled by setting `DEV_TOOLS` option to `1` .
***
2024-10-03 19:30:23 +03:00
### Custom title bar
Yandex Music's custom Windows-styled titlebar can be enabled by setting `CUSTOM_TITLE_BAR` option to `1` . Also makes the window frameless.
2024-10-03 19:31:38 +03:00
![image ](https://github.com/user-attachments/assets/b3fa91f9-6ef6-44ec-9418-4ae8bf1be99b )
2024-10-03 19:30:23 +03:00
***
2024-02-05 17:12:29 +03:00
## Manual Build
### Prerequisites
That's the list of packages you might need to install to be able to manually build the app. However, you should remember that it might be different for your distro/machine.
```
- nodejs
- npm
- jq
- 7z (p7zip)
- unzip
2024-02-13 13:09:14 +03:00
- python
2024-02-05 17:12:29 +03:00
```
In addition you will need to install [Asar ](https://github.com/electron/asar ) tool with `npm` . I recommend install it globally with the following command
2024-02-29 18:05:13 +03:00
```bash
2024-02-05 17:12:29 +03:00
npm install -g @electron/asar
```
2024-02-09 15:07:50 +03:00
Last step is to download original client `.exe` file. You can get it yourself or take link to the latest version from `./utility/version_info.json` file.
2024-02-05 17:12:29 +03:00
***
### Extract app only
If you only want to get extracted app project with applied patches, you can use the following command:
2024-02-29 18:05:13 +03:00
```bash
2024-03-02 14:55:37 +03:00
bash repack.sh -x [-o OUTPUT_DIR default=./app] < YM.exe >
2024-02-05 17:12:29 +03:00
```
***
### ASAR archive
`.asar` is archive file that containes all electron app resources and information, but doesn't hold Electron binaries. If you have `.asar` file you can launch app using `electron <app>.asar` . You can build this archive with the following command:
2024-02-29 18:05:13 +03:00
```bash
2024-03-02 14:55:37 +03:00
bash repack.sh [-o OUTPUT_DIR default=./app] < YM.exe >
2024-02-05 17:12:29 +03:00
```
***
### Arch Linux
You can build `pacman` package file manually using `PKGBUILD` file from the this repository. Run following commands in folder with `PKGBUILD` file inside to get `.pkg.tar.zst` package:
2024-02-29 18:05:13 +03:00
```bash
2024-02-05 17:12:29 +03:00
pacman -S electron libpulse
makepkg
```
***
### Debian/Ubuntu
You can build `.deb` binary package using the following command:
2024-02-29 18:05:13 +03:00
```bash
2024-03-02 14:55:37 +03:00
bash build_deb.sh [-a < x64 | armv7l | arm64 | all > default=x64]
2024-02-05 17:12:29 +03:00
```
2024-02-04 13:55:06 +03:00
***
2024-04-24 20:26:39 +03:00
### RPM-based
You can build `.rpm` binary package using the following command:
```bash
bash build_rpm.sh [-a < x64 | armv7l | arm64 | all > default=x64]
```
2024-02-04 13:55:06 +03:00
## Run with nix
2024-02-14 14:07:10 +03:00
The `yandex-music` package has unlicensed license, so you need to have
2024-02-04 13:55:06 +03:00
`allowUnfree` option enabled.
2024-09-03 09:47:50 +03:00
### NixOS unstable
The `yandex-music` package is
[available ](https://github.com/NixOS/nixpkgs/pull/337425 ) at nixos-unstable
channel.
#### Run from unstable channel with flakes
```bash
nix run github:NixOS/nixpkgs/nixos-unstable#yandex-music
```
#### Install from unstable channel
Add next to your configuration:
```nix
environment.systemPackages = with pkgs; [ yandex-music ];
```
#### Overriding
There is several option of package available to override:
```nix
yandex-music.override {
trayEnabled = true; # Whenether to enable tray support
electronArguments = ""; # Extra arguments to electron executable
}
```
### Built-in module
This repository contains its own nix-related receipts.
#### Run with flakes
2024-02-04 13:55:06 +03:00
Execute next to build and run yandex music directly from github
2024-02-29 18:05:13 +03:00
```bash
2024-02-04 13:55:06 +03:00
nix run github:cucumber-sp/yandex-music-linux
```
2024-09-03 09:47:50 +03:00
#### Run old style
2024-02-04 13:55:06 +03:00
2024-02-14 14:07:10 +03:00
Execute next in this repository to build yandex-music package without using
2024-02-04 13:55:06 +03:00
flakes.
2024-02-29 18:05:13 +03:00
```bash
2024-02-04 13:55:06 +03:00
nix-build --expr '(import < nixpkgs > {}).callPackage ./nix {}'
```
2024-09-03 09:47:50 +03:00
#### Install to NixOS
2024-02-04 13:55:06 +03:00
2024-02-29 18:05:13 +03:00
1. Add input in your flake.nix
```nix
inputs = {
yandex-music.url = "github:cucumber-sp/yandex-music-linux";
};
```
2024-05-22 14:23:12 +03:00
2. Import module in your `configuration.nix` :
2024-02-29 18:05:13 +03:00
```nix
imports = [
2024-05-22 14:23:12 +03:00
yandex-music.nixosModules.default
2024-02-29 18:05:13 +03:00
];
```
2024-05-22 14:23:12 +03:00
or in `home-manager.nix` :
2024-02-29 18:05:13 +03:00
```nix
2024-05-22 14:23:12 +03:00
imports = [
yandex-music.homeManagerModules.default
2024-02-29 18:05:13 +03:00
];
```
2024-05-22 14:23:12 +03:00
3. Enable `yandex-music`
2024-02-29 18:05:13 +03:00
```nix
2024-05-22 14:23:12 +03:00
programs.yandex-music.enable = true;
programs.yandex-music.tray.enable = true; # to enable tray support
2024-02-29 18:05:13 +03:00
```
2024-10-14 21:20:00 +03:00
## Star History
< a href = "https://star-history.com/#cucumber-sp/yandex-music-linux&Timeline" >
< picture >
< source media = "(prefers-color-scheme: dark)" srcset = "https://api.star-history.com/svg?repos=cucumber-sp/yandex-music-linux&type=Timeline&theme=dark" / >
< source media = "(prefers-color-scheme: light)" srcset = "https://api.star-history.com/svg?repos=cucumber-sp/yandex-music-linux&type=Timeline" / >
< img alt = "Star History Chart" src = "https://api.star-history.com/svg?repos=cucumber-sp/yandex-music-linux&type=Timeline" / >
< / picture >
< / a >