TranslateProject/sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md
darksun 3c3d25ac60 选题: 20190422 2 new apps for music tweakers on Fedora Workstation
sources/tech/20190422 2 new apps for music tweakers on Fedora Workstation.md
2019-04-23 12:57:14 +08:00

6.3 KiB
Raw Blame History

2 new apps for music tweakers on Fedora Workstation

Linux operating systems are great for making unique customizations and tweaks to make your computer work better for you. For example, the i3 window manager encourages users to think about the different components and pieces that make up the modern Linux desktop.

Fedora has two new packages of interest for music tweakers: mpris-scrobbler and playerctl. mpris-scrobbler tracks your music listening history on a music-tracking service like Last.fm and/or ListenBrainz. playerctl is a command-line music player controller.

mpris-scrobbler is a CLI application to submit play history of your music to a service like Last.fm, Libre.fm, or ListenBrainz. It listens on the MPRIS D-Bus interface to detect whats playing. It connects with several different music clients like spotify-client, vlc, audacious, bmp, cmus, and others.

Last.fm last week in music report. Generated from user-submitted listening history.

Install and configure mpris-scrobbler

mpris-scrobbler is available for Fedora 28 or later, as well as the EPEL 7 repositories. Run the following command in a terminal to install it:

sudo dnf install mpris-scrobbler

Once it is installed, use systemctl to start and enable the service. The following command starts mpris-scrobbler and always starts it after a system reboot:

systemctl --user enable --now mpris-scrobbler.service

Submit plays to ListenBrainz

This article explains how to link mpris-scrobbler with a ListenBrainz account. To use Last.fm or Libre.fm, see the upstream documentation.

To submit plays to a ListenBrainz server, you need a ListenBrainz API token. If you have an account, get the token from your profile settings page. When you have a token, run this command to authenticate with your ListenBrainz API token:

$ mpris-scrobbler-signon token listenbrainz
Token for listenbrainz.org:

Finally, test it by playing a song in your preferred music client on Fedora. The songs you play appear on your ListenBrainz profile.

Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.

playerctl controls your music playback

playerctl is a CLI tool to control any music player implementing the MPRIS D-Bus interface. You can easily bind it to keyboard shortcuts or media hotkeys. Heres how to install it, use it in the command line, and create key bindings for the i3 window manager.

Install and use playerctl

playerctl is available for Fedora 28 or later. Run the following command in a terminal to install it:

sudo dnf install playerctl

Now that its installed, you can use it right away. Open your preferred music player on Fedora. Next, try the following commands to control playback from a terminal.

To play or pause the currently playing track:

playerctl play-pause

If you want to skip to the next track:

playerctl next

For a list of all running players:

playerctl -l

To play or pause whats currently playing, only on the spotify-client app:

playerctl -p spotify play-pause

Create playerctl key bindings in i3wm

Do you use a window manager like the i3 window manager? Try using playerctl for key bindings. You can bind different commands to different key shortcuts, like the play/pause buttons on your keyboard. Look at the following i3wm config excerpt to see how:

# Media player controls
bindsym XF86AudioPlay exec "playerctl play-pause"
bindsym XF86AudioNext exec "playerctl next"
bindsym XF86AudioPrev exec "playerctl previous"

Try it out with your favorite music players

Need to know more about customizing the music listening experience on Fedora? The Fedora Magazine has you covered. Check out these five cool music players on Fedora:

5 cool music player apps

Bring order to your music library chaos by sorting and organizing it with MusicBrainz Picard:

Picard brings order to your music library


Photo by Frank Septillion on Unsplash.


via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/

作者:Justin W. Flory 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出