Client for spotify's apt repository in Rust for Arch Linux

Overview

spotify-launcher

Spotify has a free linux client but prohibits re-distribution, so this is a freely distributable opensource program that manages a spotify installation in your home folder from the official spotify release server.

If you work for spotify please reach out so we can talk. ๐Ÿ‘‰๐Ÿ‘ˆ

Configuration

spotify-launcher is going to look for a configuration file at the following locations (in this order):

  • ${XDG_CONFIG_HOME:-$HOME/.config}/spotify-launcher.conf
  • /etc/spotify-launcher.conf

If no config is found it's going to start with default settings. Your configuration file may look like this:

[spotify]
## Pass extra arguments to the spotify executable
## You can test this with `spotify-launcher -v --skip-update --no-exec`
#extra_arguments = []
## On HiDPI displays spotify doesn't pick up the scale factor automatically
#extra_arguments = ["--force-device-scale-factor=2.0"]
## On wayland you might need
#extra_arguments = ["--enable-features=UseOzonePlatform", "--ozone-platform=wayland"]

License

GPLv3+

Comments
  • ZFS: Error: Failed to update directories

    ZFS: Error: Failed to update directories

    When I run spotify-launcher, the following error will occur:

    username> spotify-launcher
    [2022-08-26T18:30:21Z INFO  spotify_launcher::config] Loading configuration file at "/etc/spotify-launcher.conf"
    [2022-08-26T18:30:21Z INFO  spotify_launcher::apt] Downloading release file...
    [2022-08-26T18:30:22Z INFO  spotify_launcher::apt] Downloading signature...
    [2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Verifying pgp signature...
    [2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Signature verified successfully!
    [2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Downloading package index...
    [2022-08-26T18:30:24Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
    [2022-08-26T18:30:24Z INFO  spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819")
    [2022-08-26T18:30:56Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
    [2022-08-26T18:30:59Z INFO  spotify_launcher] Extracting to "/home/username/.local/share/spotify-launcher/install-new"...
    [2022-08-26T18:30:59Z INFO  spotify_launcher] Setting new directory active
    Error: Failed to update directories "/home/username/.local/share/spotify-launcher/install" and "/home/username/.local/share/spotify-launcher/install-new"
    
    Caused by:
        0: Could not exchange paths: Invalid argument
        1: Invalid argument
    
    opened by mingcenwei 8
  • Missing key E27409F51D1B66337F2D2F417A3A762FAFD4A51F

    Missing key E27409F51D1B66337F2D2F417A3A762FAFD4A51F

    [2023-01-17T13:11:45Z INFO  spotify_launcher::config] Loading configuration file at "/etc/spotify-launcher.conf"
    [2023-01-17T13:11:45Z INFO  spotify_launcher::apt] Downloading release file...
    [2023-01-17T13:11:45Z INFO  spotify_launcher::apt] Downloading signature...
    [2023-01-17T13:11:45Z INFO  spotify_launcher::apt] Verifying pgp signature...
    Missing key E27409F51D1B66337F2D2F417A3A762FAFD4A51F, which is needed to verify signature.
    Error: Verification of pgp signature didn't succeed
    
    opened by ugjka 5
  • Pass arguments + flags to `spotify` executable

    Pass arguments + flags to `spotify` executable

    Is it possible to send arguments + flags to the spotify executable?

    E.g. for wayland support it is necessary to start spotify like this

    spotify --enable-features=UseOzonePlatform --ozone-platform=wayland
    
    opened by tfachmann 4
  • Error: Broken pipe (os error 32)

    Error: Broken pipe (os error 32)

    spotify-launcher 2023-02-25T15:24:21Z INFO spotify_launcher::config] Loading configuration file at "/etc/spotify-launcher.conf" [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Downloading release file... [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Downloading signature... [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Verifying pgp signature... [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Signature verified successfully! [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Downloading package index... [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Verifying with sha256sum hash... [2023-02-25T15:24:21Z INFO spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819-2_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819-2")

    (process:32167): Gtk-WARNING **: 17:24:21.981: Locale not supported by C library. Using the fallback 'C' locale. This option is not available. Please see --help for all possible usages. Error: Broken pipe (os error 32)

    opened by BlackDiamondIce 3
  • M1 mac arch linux error: exec format error

    M1 mac arch linux error: exec format error

    When I run spotify-launcher I get the following

    `spotify-launcher [2023-06-11T12:40:04Z INFO spotify_launcher::config] Loading configuration file at "/etc/spotify-launcher.conf" [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Downloading release file... [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Downloading signature... [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Verifying pgp signature... [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Signature verified successfully! [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Downloading package index... [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Verifying with sha256sum hash... [2023-06-11T12:40:04Z INFO spotify_launcher::apt] Downloading deb file for "spotify-client_1.2.11.916.geb595a67_amd64.deb" version="spotify-client" ("1:1.2.11.916.geb595a67") [2023-06-11T12:40:32Z INFO spotify_launcher::apt] Verifying with sha256sum hash... [2023-06-11T12:40:32Z INFO spotify_launcher::extract] Extracting to "/home/arthur/.local/share/spotify-launcher/install-new"... [2023-06-11T12:40:34Z INFO spotify_launcher::extract] Atomically swapping new directory at "/home/arthur/.local/share/spotify-launcher/install-new" with "/home/arthur/.local/share/spotify-launcher/install"... Error: Failed to exec "/home/arthur/.local/share/spotify-launcher/install/usr/bin/spotify"

    Caused by: ENOEXEC: Exec format error `

    I'm running arch on a M1 mac so I'm using the aarch64 architecture, your program has an ARM version (https://archlinuxarm.org/packages/aarch64/spotify-launcher) which I think is fantastic, but I guess this end result "ENOEXEC" is probably because the spotify client that gets downloaded isn't aarch64? If so is this a problem that can be helped (by e.g specifying the architecture in config) or is this entirely due to spotify not having an ARM linux client?

    Kind regards

    opened by arthuradriaens-code 2
  • Keyboard shortcuts doesn't work?

    Keyboard shortcuts doesn't work?

    I'm not sure I might have configured something wrong but I cant get keyboard shortcuts to work like the official Spotify packages, at least for Windows where I come from, e.g Ctrl+Right for next track, or Ctrl+Up for increase volume. Is this a known bug?

    opened by ludverse 2
  • Authorization

    Authorization

    When I try to open it from the terminal by "sudo spotify-launcher" it opens a blank window and in the terminal it spams "Authorization required but no protocol specified". I don't know what I might have done wrong, please help!

    opened by istipisti113 2
  • Adding image to README

    Adding image to README

    hello! It would be nice if you could add an image of spotify-launcher so others could see the interface and how to interact with it before downloading it :)

    opened by TornaxO7 2
  • Insane update timeout

    Insane update timeout

    According to src/http.rs#L15, the default timeout for updating is 1 hour. This is quite insane, as who's prepared to wait an hour to download an update? My current network blocks spotify, however allows the connection to open - this means that spotify-launcher hangs for an hour before giving up, unless --skip-update is passed (which isn't ideal when I'm only on this network 4 out of 7 days of the week, for a few hours each day).

    Are there any plans to allow the timeout to be configurable, or at the very least lowered?

    opened by EEKIM10 2
  • Add configuration of env vars

    Add configuration of env vars

    This PR adds configuring environment variables in the config file, which is useful for specifying LD_PRELOAD for using e.g. https://github.com/dasJ/spotifywm.

    It allows specifying extra_env_vars = ["K1=V1", "K2=V2" ] and calls set_var before the execv. However, I'd like your feedback on whether this approach or using execve would be better.

    opened by AidanGG 2
  • Error stop downloading spotify app

    Error stop downloading spotify app

    Hello,

    While spotify-launcher is downloading the spotify app, it stop itself

    [2022-06-14T16:36:05Z INFO spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819") [2022-06-14T16:36:05Z DEBUG spotify_launcher::http] Downloading "http://repository.spotify.com/pool/non-free/s/spotify-client/spotify-client_1.1.84.716.gc5f8b819_amd64.deb"... This option is not available. Please see --help for all possible usages. Error: Broken pipe (os error 32)

    Idk what happend, i use arch

    btw, nice project

    opened by gotha-homester 2
  • Add support for opening URIs in existing instance

    Add support for opening URIs in existing instance

    Right now if we open Spotify URLs (for example via Spotify Web -> "Open in Desktop App"), it will always open a new Spotify instance, even if there is already one running and playing music already.

    This patch uses Spotify's org.mpris.MediaPlayer2.Player.OpenUri dbus method to open the link in the existing instance instead.

    If this dbus call fails for whatever reason, it falls back to opening a new instance (like the old behaviour). Obviously we also first check if an instance already exists, before attempting to call OpenUri.

    opened by vimpostor 4
  • Unclosable window on launch

    Unclosable window on launch

    When launching the program (including the first launch when it installs), my spotify will open and function normally, but there is also a completely black window that I can't close. Once I close the functioning window, the other will remain until I send it a KILL signal or use ^C if I am running it in the terminal. Here is my config and my logs:

    [spotify]
    extra_arguments = ["--enable-features=UseOzonePlatform", "--ozone-platform=wayland"]
    
    $ spotify-launcher -v
    [2022-11-20T19:45:18Z DEBUG spotify_launcher::config] Searching for configuration file at "/home/ally/.config/spotify-launcher.conf"
    [2022-11-20T19:45:18Z DEBUG spotify_launcher::config] Found configuration file at "/home/ally/.config/spotify-launcher.conf"
    [2022-11-20T19:45:18Z INFO  spotify_launcher::config] Loading configuration file at "/home/ally/.config/spotify-launcher.conf"
    [2022-11-20T19:45:18Z DEBUG spotify_launcher] Using install path: "/home/ally/.local/share/spotify-launcher/install"
    [2022-11-20T19:45:18Z DEBUG spotify_launcher::paths] Reading state file from "/home/ally/.local/share/spotify-launcher/state.json"...
    [2022-11-20T19:45:18Z DEBUG spotify_launcher::paths] Loaded state: Ok(State { version: "1:1.1.84.716.gc5f8b819-2", last_update_check: SystemTime { tv_sec: 1668973127, tv_nsec: 975117554 } })
    [2022-11-20T19:45:18Z DEBUG spotify_launcher] Last update check was 0 days and 0 hours ago
    [2022-11-20T19:45:18Z INFO  spotify_launcher] No update needed
    [2022-11-20T19:45:18Z DEBUG spotify_launcher] Assembled command: ["spotify", "--enable-features=UseOzonePlatform", "--ozone-platform=wayland"]
    spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by spotify)
    /home/ally/.local/share/spotify-launcher/install/usr/share/spotify/spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /home/ally/.local/share/spotify-launcher/install/usr/share/spotify/spotify)
    /home/ally/.local/share/spotify-launcher/install/usr/share/spotify/spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /home/ally/.local/share/spotify-launcher/install/usr/share/spotify/spotify)
    [libprotobuf ERROR ../core/vendor/protobuf3/src/google/protobuf/wire_format_lite.cc:577] String field 'spotify.event_sender.proto.DroppedEvents.DroppedEventsBySequenceIdEntry.key' contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
    /proc/self/exe: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /proc/self/exe)
    ^C[1]    26478 segmentation fault (core dumped)  spotify-launcher -v
    
    opened by allys7 1
  • Configure pulseaudio application icon name

    Configure pulseaudio application icon name

    Spotify registers as pulseaudio stream with application name spotify but no application icon is shown within volume controls (e.g. pavucontrol).

    An easy way to adjust is to provide the icon name directly via an environment variable.

    # Configure icon name via env
    $ env PULSE_PROP_application.icon_name=spotify-launcher spotify-launcher
    # Check the setting
    $ pw-dump spotify |grep -F -e application.name -e application.icon-name
            "application.name": "spotify",
            "application.icon-name": "spotify-launcher",
    

    This works within the DesktopEntry as well

    [Desktop Entry]
    Type=Application
    Name=Spotify (Launcher)
    GenericName=Music Player
    Icon=spotify-launcher
    TryExec=spotify-launcher
    Exec=env PULSE_PROP_application.icon_name=spotify-launcher spotify-launcher %U
    Terminal=false
    MimeType=x-scheme-handler/spotify;
    Categories=Audio;Music;Player;AudioVideo;
    StartupWMClass=spotify
    

    Would be nice to include the environment variable in the DesktopEntry to show the Spotify icon.

    (This is different from #11, where the DesktopEntry is actually parsed for the icon name.)

    opened by bbx0 2
  • Rename DesktopEntry file to `spotify.desktop`

    Rename DesktopEntry file to `spotify.desktop`

    First, thanks for making this cool wrapper. :)

    Spotify exposes its own DesktopEntry as spotify during runtime as part of the MPRIS specification. This can be used to show further details like the Icon in other applications or the system tray (e.g. by mpris-indicator-button). Currently this would fail as the launcher is installed as spotify-launcher.desktop and not spotify.desktop, so the advertised value is different from the actual DesktopEntry.

    # Query the advertised DesktopEntry from DBus
    $ dbus-send --session --print-reply=literal --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2 string:DesktopEntry
       variant       spotify
    

    Can you rename the file spotify-launcher.desktop to spotify.desktop to be consistent with the self-advertised value of Spotify?

    Unfortunately the DBus property seems read-only when Spotify is running and I had no luck in manually changing it from outside.

    A simple workaround is to rename the DesktopEntry locally.

    # Link locally with the advertised name and hide the global system entry
    $ ln -s /usr/share/applications/spotify-launcher.desktop ~/.local/share/applications/spotify.desktop
    $ cat ~/.local/share/applications/spotify-launcher.desktop
    [Desktop Entry]
    Type=Application
    Name=Spotify (Launcher)
    Hidden=true
    
    opened by bbx0 0
Releases(v0.5.0)
Owner
I'm good at proving my binaries haven't been tampered with. I volunteer as an Arch Linux package maintainer. I like to do things without computers.
null
For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

Aarush Gupta 3 Oct 9, 2022
Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size

Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size (-D_FORTIFY_SOURCE=3 compatibility)

null 3 Sep 9, 2023
TMM is a Linux native game modding tool. it allows to install and depoly mods for Linux native and wine games.

Tux Mod Manager TMM is a Linux native mod manager made with the Tauri toolkit. It can install, load, remove and deploy mods for both Linux native and

Mathiew May 119 Dec 27, 2022
This repository presents a numbers vizualizer in a polar base. This small project has been entirely made in Rust !

NumbersRepresentation This repository presents a numbers vizualizer in a polar base. This small project has been entirely made in Rust ! This is an id

Lilian 'S3l4h' Schall 3 Apr 12, 2022
A command line tool, manage your hundreds of repository, written with Rust

A command line tool, manage your hundreds of repository, written with Rust

Axetroy 4 Aug 16, 2022
๐Ÿฆ€ Temporary repository for the rewrite of Smoothie in Rust

Warning As with a lot of projects, this one is also a WIP, expect broken code ?? smoothie-rs Temporary repository hosting the code for Smoothie's futu

Couleur Tweak Tips 6 Jan 22, 2023
A companion repository for my Rust Talk.

Building a microservice in rust This project is a companion to my talk at ConFoo about building a rust project. You should checkout a fully fleshed ou

Vagmi 4 Feb 27, 2023
This repository brings together my studies in the Rust language.

Studying_Rust This repository brings together my studies in the Rust language. Study schedule in 90 days start date: 7/24 end date: 10/24 Each topic w

Dรฉbora Marim 5 Aug 8, 2023
RustRedOps is a repository dedicated to gathering and sharing advanced techniques and malware for Red Team, with a specific focus on the Rust programming language. (In Construction)

RustRedOps In Construction.... The project is still under development Overview RustRedOps is a repository that houses various tools and projects relat

Joรฃo Victor 17 Dec 14, 2023
Provides a mock Ambi client that emulates real sensor hardware such as an Edge client

ambi_mock_client Provides a mock Ambi client that emulates real sensor hardware such as an Edge client. Usage You must have Rust installed to build am

Rust Never Sleeps 2 Apr 1, 2022
Repository containing assets for the Holium CLI tutorial

Welcome to getting-started ?? In this repository you can find all necessary assets for the Holium CLI tutorial ?? Homepage The tutorial that reference

Polyphene 2 Mar 11, 2022
Repository with my Advent of Code 2021 puzzle solutions ๐ŸŽ„

?? Advent of Code 2021 ?? I decided to stick with Rust this year and try to improve a bit on it, I basically haven't used it since last year's AoC, so

fratorgano 2 Dec 1, 2022
Official repository for v3's backend

RoChat This repository holds the official source code for RoChat's new backend. Previously, the old backend was written in PHP. The newer one, coming

null 1 Apr 24, 2022
The official command-line interface for the makedeb Package Repository

mpr-cli This is the repository for the MPR CLI, the official command-line interface for the makedeb Package Repository. Installation Users have a few

makedeb 38 Jan 2, 2023
A git sub-command to view your git repository in the web browser

git-view A git sub-command to view your git repository in the web browser! About Are you also frustrated from moving your hands away from the keyboard

Hamothy 5 Sep 26, 2022
Copy files from Git repository to local.

gitcp Copy files from Git repository to local. Install We are planning to add some installers support in the future. e.g. homebrew winget debian packa

Ryo Nakamura 3 Aug 9, 2022
๐Ÿš€ Yet another repository management with auto-attaching profiles.

?? ghr Yet another repository management with auto-attaching profiles. ?? Motivation ghq is the most famous solution to resolve stress of our reposito

Naoki Ikeguchi 29 Dec 2, 2022
Repository for solving adventofcode.com puzzles

Advent Of Code ?? This is a repository for any Otovista that wants to participate in the advent of code christmas calendar challenges. Advent of Code

Otovo 4 Dec 20, 2022
This is a placeholder repository for Ludum Dare 52. We'll add more soon!

Ludum Dare 52 This is a placeholder repository for Ludum Dare 52. How to play TBD Developing Only Rust (edition 2021) is required to develop and build

Matan Lurey 4 Jan 9, 2023