Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 15 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# spotify-cli-linux

[![Build](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/build.yml)
[![Deploy](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/deploy.yml/badge.svg)](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/deploy.yml)
[![Version](https://img.shields.io/pypi/v/spotify-cli-linux.svg?style=flat-square)](https://pypi.python.org/pypi/spotify-cli-linux/)
[![Build](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/build.yml)
[![Deploy](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/deploy.yml/badge.svg)](https://github.com/pwittchen/spotify-cli-linux/actions/workflows/deploy.yml)
[![Version](https://img.shields.io/pypi/v/spotify-cli-linux.svg?style=flat-square)](https://pypi.python.org/pypi/spotify-cli-linux/)

A command line interface to [Spotify](https://www.spotify.com/) on Linux.

If you're using macOS, see [spotify-cli-macos](https://github.com/pwittchen/spotify-cli-macos).

installation
------------
## installation

```
pip install spotify-cli-linux
Expand All @@ -27,17 +26,15 @@ cd spotify-cli-linux
sudo cp spotifycli/spotifycli.py /usr/local/bin/spotifycli
```

upgrade
-------
## upgrade

```
pip install spotify-cli-linux --upgrade
```

for the upgrade, you can apply the same hints like for installation

usage
-----
## usage

start the official Spotify desktop app

Expand Down Expand Up @@ -69,15 +66,15 @@ use one of the following parameters:
--playpause plays or pauses the song (toggles a state)
--next plays the next song
--prev plays the previous song
--clear clear the terminal
--songuri OPENURI plays the track at the provided Uri
--listuri OPENURI plays the playlist at the provided Uri
--client CLIENT sets client's dbus name
```

if you don't use any parameters, you'll enter the shell mode, where you'll be able to use all commands mentioned above

solving problems
----------------
## solving problems

### lyriq

Expand All @@ -87,22 +84,19 @@ When, you're missing `lyriq` dependency, run the following command:
pip install lyriq
```

usage with tmux
---------------
## usage with tmux

If you want to use this script in your tmux panel, you can check [tmux-plugin-spotify](https://github.com/pwittchen/tmux-plugin-spotify).

development
-----------
## development

to install necessary tools for code formatting, static code analysis and releasing, run:

```
make requirements
```

code formatting
---------------
## code formatting

Source code should be formatted according to [PEP8](https://www.python.org/dev/peps/pep-0008/) style guides.

Expand All @@ -118,17 +112,15 @@ to verify code formatting, type:
make checkformat
```

static code analysis
--------------------
## static code analysis

To run static code analysis, execute:

```
make lint
```

docs
----
## docs

to update docs on `gh-pages`, type:

Expand All @@ -137,6 +129,7 @@ make docs
```

to run docs locally, type:

```
git checkout gh-pages && ./serve.sh
```
Expand All @@ -145,8 +138,7 @@ and view page with docs at: 0.0.0.0:8000

view it on-line at https://pwittchen.github.io/spotify-cli-linux

releasing
---------
## releasing

currently release is automated via `deploy.yml` GitHub Action, but it can be done manually too

Expand Down
7 changes: 7 additions & 0 deletions spotifycli/spotifycli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def main():
show_lyrics()
elif args.arturl:
show_art_url()
elif args.clear:
clear_cli()
elif args.play:
perform_spotify_action("Play")
elif args.pause:
Expand Down Expand Up @@ -156,6 +158,7 @@ def get_arguments():
("--lyrics", "shows the lyrics for the song"),
("--next", "plays the next song"),
("--prev", "plays the previous song"),
("--clear", "clear the terminal"),
("--songuri", "plays the track at the provided Uri", True),
("--listuri", "plays the playlist at the provided Uri", True),
]
Expand All @@ -165,6 +168,10 @@ def show_version():
print("2.0.0")


def clear_cli():
os.system('cls' if os.name == 'nt' else 'clear')


def get_song():
metadata = get_spotify_property("Metadata")
artist = ", ".join(metadata['xesam:artist'][1])
Expand Down