Code Monkey home page Code Monkey logo

mpq's Introduction

screenshot of mpq

With mpq you can view and manipulate songs in the mpd queue. These are the default key bindings; customize by modifying keys.go:

$ mpq -h
Key bindings:
q         : quit
enter     : play highlighted song
space     : toggle play/pause
up, k     : highlight previous song
down, j   : highlight next song
alt+up/k  : move highlighted song up
alt+down/j: move highlighted song down
left, h   : seek backwards 5s
right, l  : seek forwards 5s
d         : remove song from queue
c         : clear queue

Installation

git clone [email protected]:codesoap/mpq.git
cd mpq
go install

# The binary is now at ~/go/bin/mpq. Add ~/go/bin to your $PATH to run
# go programs easily:
mpq

Adding songs to the queue

I use a little script called mqa (music queue add). It requires mpc and fzf; use tab to select songs and enter to add them to the queue:

#!/usr/bin/env sh

alias mpc='mpc -f "%file%\t[%artist% - ][%album% [#[##%track%#] ]- ][%title%|%file%]"'
songs=$(mpc listall | sort -V)
printf '%s\n' "$songs" \
| awk -F'\t' '{print $2}' \
| fzf --no-sort --reverse -m \
| while read selection
do
	printf '%s\n' "$songs" | awk -F'\t' "\$2==\"$selection\" {print \$1; exit}"
done | mpc add

Utilizing songmem

songmem is another tool I wrote to store and analyze the songs I listen to. It can be used, for example, to find recommendations for the last heard song and add them to the queue with a script like this:

#!/usr/bin/env sh

selection=$(songmem --suggestions "$(songmem | head -n1)" | fzf)
artist="$(printf '%s' "$selection" | awk -F ' - ' '{print $1}')"
title="$(printf '%s' "$selection" | awk '{i=index($0, " - "); print substr($0, i+3)}')"
mpc findadd artist "$artist" title "$title"

Configuring mpd

Other tasks, like disabling the repeat mode, I just do with mpc. My config is usually this:

mpc consume on
mpc crossfade 0
mpc random off
mpc repeat off
mpc replaygain album
mpc single off
mpc volume 100

mpq's People

Contributors

aarya-bhatia avatar codesoap avatar lvan- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mpq's Issues

mpq disconnects from mpd

Very rarely (I think twice in maybe a few hundred hours of use) mpq seems to disconnect from mpd. mpq then does not register when the song changes, play/pause is toggled or anything else. I'm not sure how to reproduce this and if it even is a problem of mpq or rather one of mpd, since I occasionally have seemingly similar problems with mpc current --wait.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.