MPD client inspired by ncmpcpp written in GO with builtin cover art previews.

goMP

MPD client inspired by ncmpcpp written in GO

demo.mp4

Roadmap

  • Add Functionality to Sort out most played songs
  • Add a config parser
  • Image Previews
  • User Key Mappings
  • Querying LastFM API for getting Album Art
  • Fuzzy Searching
  • Visual Mode (like vim) for updating playlists

Setting Up

  • Music Player Daemon must be setup
  • Go Should Be Installed ( for building )
  • Make a YAML/TOML file in $HOME/.config/goMP named config.yml / config.toml
  • Read the sample_config.yml for config options

Installing / Building

git clone https://github.com/aditya-K2/goMP &&
cd goMP &&
go build

Configuration

Key Mappings

Following Keys can be used for Mappings

Keys Using them in Config
a-z a-z
A-Z A-z
{,},(,),[,],<,> {,},(,),[,],<,>
Enter(Return) ENTER/RETURN
Tab TAB
Space SPACE

See config/kMap.go for more information

For mapping a key to some function use the following format:

Function: [ firstMapping, secondMapping, thirdMapping]

for.eg

togglePlayBack : [ "p", "TAB", "[" ] # using the quotes is neccessary.

Following functions are provided :

Functions
showChildrenContent
togglePlayBack
showParentContent
nextSong
clearPlaylist
previousSong
addToPlaylist
toggleRandom
toggleRepeat
decreaseVolume
increaseVolume
navigateToFiles
navigateToPlaylist
navigateToMostPlayed
quit
stop
updateDB
deleteSongFromPlaylist

Getting Album Art from LastFm API

  1. Generate API Key here

    Screenshot from 2021-11-13 21-54-54

  2. Add the api key and api secret to config.yml

GET_COVER_ART_FROM_LAST_FM : "TRUE" # Turn On Getting Album art from lastfm api
LASTFM_API_KEY: "YOUR API KEY HERE"
LASTFM_API_SECRET: "YOUR API SECRET HERE"
  1. Auto correct

Screenshot from 2021-11-13 21-59-46 :

LASTFM_AUTO_CORRECT: 1  # 0 means it is turned off

Tested on following terminals:

  • Alacritty
  • ST
  • URXVT
Owner
Comments
  • album art doesnt show up on any songs even though audio file has an embeded album art

    album art doesnt show up on any songs even though audio file has an embeded album art

    10-49-44-PM_2022-10-22

    i've used ffmpeg to extract the image from audio file, my config

    MPD_PORT : "6600"
    MUSIC_DIRECTORY : "~/Media/music/"
    SEEK_OFFSET : 5
    CACHE_DIR : "~/.config/gomp/.cache/"
    DEFAULT_IMAGE_PATH : "~/.config/gomp/default_art.png"
    

    and the audio i was playing was located in ~/Media/music/nightcore/

  • gomp panic: invalid memory address

    gomp panic: invalid memory address

    Just found this project, looks interesting. Installed it from aur, but ran into this error.

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x563de28a0cf3]
    
    goroutine 6 [running]:
    gitlab.com/diamondburned/ueberzug-go.NewImage({0x0, 0x0}, 0x0?, 0x0?)
    	gitlab.com/diamondburned/[email protected]/ueberzug.go:25 +0x53
    github.com/aditya-K2/gomp/render.OpenImage({0xc000165946, 0x3a}, 0x0?)
    	github.com/aditya-K2/gomp/render/render.go:52 +0x110
    created by github.com/aditya-K2/gomp/render.(*Renderer).Start
    	github.com/aditya-K2/gomp/render/render.go:70 +0x8a
    

    Cloned the git repo, built it from there, same error. Then I checked out to an earlier commit. Same error. Seems it might be something on my side. Here is my config.yml

    MPD_PORT : "6600"
    MUSIC_DIRECTORY : "~/Music"
    DEFAULT_IMAGE_PATH : "~/Pictures/defaultlain.jpg"
    SEEK_OFFSET : 5
    CACHE_DIR : "~/.config/gomp/cache"
    #GET_COVER_ART_FROM_LAST_FM : "TRUE"
    #LASTFM_API_KEY : "4e316e10a94a2eef30b605fc3db04cf1"
    #LASTFM_API_SECRET : "d95f07d336316312a81e34680c6d5bb2"
    

    Please advise. Also, sorry for making an empty issue and then editing it later. Was about to type this up when I misclicked and then something came up.

  • Panic: dial tcp

    Panic: dial tcp

    error:

    Could Not Connect to MPD Server
    Make Sure You Mention the Correct MPD Port in the config file.
    panic: dial tcp [::1]:6600: connect: connection refused
    
    goroutine 1 [running]:
    main.main()
    	github.com/aditya-K2/gomp/main.go:29 +0x21cf
    

    My config.yml

    MUSIC_DIRECTORY: "~/Music/"
    ADDITIONAL_PADDING_X : 9
    ADDITIONAL_PADDING_Y : 17
    IMAGE_WIDTH_EXTRA_X  : -1.1
    IMAGE_WIDTH_EXTRA_Y  : -3.75
    MPD_PORT : "6600"
    togglePlayBack : [ "p", "SPACE", "]" ]
    CACHE_DIR : "~/.config/gomp/cache/"
    

    My mpd.conf

    music_directory "~/Music"
    playlist_directory "~/.config/mpd/playlists"
    db_file "~/.config/mpd/mpd.db"
    log_file "~/.config/mpd/mpd.log"
    pid_file "~/.config/mpd/mpd.pid"
    state_file "~/.config/mpd/mpdstate"
    
    audio_output {
            type "pulse"
            name "pulse audio"
    }
    
    audio_output {
    	type                    "fifo"
    	name                    "my_fifo"
    	path                    "/tmp/mpd.fifo"
    	format                  "44100:16:2"
    }
    
    bind_to_address "127.0.0.1"
    port "6600"
    
  • panic: runtime error: invalid memory address or nil pointer dereference

    panic: runtime error: invalid memory address or nil pointer dereference

    Steps to build the latest version : 1/ go build on master branch 2/ get default version https://github.com/aditya-K2/goMP/blob/master/sample_config.yml to .config/$USER/goMP/config.yml and change MUSIC_DIRECTORY

    The program needs a local mpd configuration file : No config File for mpd Found panic: open $USER/.config/mpd/mpd.conf: no such file or directory but i'm using config file at /etc/mpd.conf (why not add an option to set config file path ?)

    ./goMP
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x78d5fb]
    
    goroutine 3 [running]:
    main.getImagePath({0xc0000280c6, 0x38})
            /home/user/goMP/render.go:94 +0x5bb
    main.openImage({0xc0000280c6, 0x38}, 0x0)
            /home/user/goMP/render.go:47 +0x6f
    created by main.(*Renderer).Start
            /home/user/goMP/render.go:67 +0x8f
    
  • Runtime Error

    Runtime Error

    Building the project works fine, but when running the executable, I get this message :

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x5b0a33]
    
    goroutine 23 [running]:
    gitlab.com/diamondburned/ueberzug-go.NewImage({0x0, 0x0}, 0x0, 0x0)
            /home/luc/.local/share/go/pkg/mod/gitlab.com/diamondburned/[email protected]/ueberzug.go:25 +0x53
    main.openImage({0xc0000e29c0, 0xc0000c04c0}, 0x1)
            /home/luc/repos/externals/goMP/render.go:45 +0x6c
    created by main.(*Renderer).Start
            /home/luc/repos/externals/goMP/render.go:63 +0x8f
    

    (The repository is cloned at /home/luc/repos/externals)

  • panic: EOF

    panic: EOF

    how to corret it :

      Could Not Generate the File Map
      Make Sure You Mention the Correct MPD Port in the config file.
      panic: EOF
    
      goroutine 1 [running]:
      main.main()
          .../gomp/main.go:65 +0x2112
      exit status 2
    
  • Image not placed correctly

    Image not placed correctly

    (I used a random image as the default, please pay no attention) image The first terminal (up) is st, the second one (down) is alacritty. I also tested with urxvt and got the same issue.

    Sidenote : What are the naming conventions, so the album picture is read ?

  • panic: runtime error: invalid memory address or nil pointer dereference

    panic: runtime error: invalid memory address or nil pointer dereference

    I haven't had any success getting gomp to run to this point. I decided to try troubleshooting a little bit and have a slightly better understanding of why now. It looks like Notify is nil when GetImagePath is executed.

    I added fmt.Println(Notify) here and this is what I see.

    $ go build && ./gomp
    <nil>
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x13a10ea]
    
    goroutine 4 [running]:
    github.com/aditya-K2/gomp/render.GetImagePath({0xc0000280f6, 0x3e})
    	/Users/johna/tmp/gomp/render/render.go:106 +0x38a
    github.com/aditya-K2/gomp/render.OpenImage({0xc0000280f6, 0x3e}, 0x0?)
    	/Users/johna/tmp/gomp/render/render.go:59 +0x6f
    created by github.com/aditya-K2/gomp/render.(*Renderer).Start
    	/Users/johna/tmp/gomp/render/render.go:79 +0x8a
    

    Unfortunately, I have very little experience with Go, otherwise, I'd try to troubleshoot further.

    Some further information. I'm running on macOS and building from source. I'm using Kitty and not really expecting imagine rending to work at this point.

  • Performance with larger lists really bad

    Performance with larger lists really bad

    I'm running gomp on a pretty powerful machine, yet with a larger playlist of over 1k entries the TUI feels awfully sluggish. Pressing arrow down for a few seconds and letting it go makes the selection continue to advance for several seconds before it stops.

  • goMP PKGBUILD

    goMP PKGBUILD

    If you're using Arch Linux, here's how i build package

    pkgname=goMP
    pkgver=0.1
    pkgrel=1
    pkgdesc='MPD client inspired by ncmpcpp written in GO.'
    arch=('any')
    url="https://github.com/aditya-K2/goMP"
    license=('GPL')
    depends=('go')
    makedepends=('go')
    source=("https://github.com/aditya-K2/goMP/archive/refs/heads/master.zip")
    sha256sums=('SKIP')
    
    build() {
        cd "${pkgname}-master"
        go build
    }
    
    package() {
        cd "${pkgname}-master"
        install -Dm 655 goMP -t "${pkgdir}/usr/bin"
    }
    
  • Change config directory to XDG environment variable

    Change config directory to XDG environment variable

    Gomp should look at the $XDG_CONFIG_HOME environment variable for where to place its configuration file. More information: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html/#basics

  • Support SubSonic API

    Support SubSonic API

    Hey all,

    Gomp looks supremely awesome and I would love to use it, but I don't run mpd anymore and have moved to gonic for music streaming server I'm not sure how difficult it would be, or whether you'd want to support this, so this is just a suggestion :)

Simple HTTP view of an MPD server

mpd-web This repository contains a simple HTTP-server which allows basic control of an mpd server running upon localhost: Move to the next track. Move

Apr 10, 2022
πŸŒ• Server application for storing doujinshi, manga, art collections and other galleries with API and user control. Written in Go.

?? Server application for storing doujinshi, manga, art collections and other galleries with API and user control. Written in Go.

Dec 31, 2022
A suite of tools for NFT generative art.

nftool A suite of tools for NFT generative art. Features Traits/Attributes/Properties Generation Configure custom rarity Generate collection attribute

Dec 15, 2022
Archiving Street Art in a distributed manner
Archiving Street Art in a distributed manner

Graffiti Repository provides a tool for graffiti community to keep track and preserving street artwork in their areas. Features Distributed storage Th

Oct 27, 2022
An easy HTTP client for Go. Inspired by the immortal Requests.

rek An easy HTTP client for Go inspired by Requests, plus all the Go-specific goodies you'd hope for in a client. Here's an example: // GET request re

Sep 20, 2022
Inspired by go-socks5,This package provides full functionality of socks5 protocol.
Inspired by go-socks5,This package provides full functionality of socks5 protocol.

The protocol described here is designed to provide a framework for client-server applications in both the TCP and UDP domains to conveniently and securely use the services of a network firewall.

Dec 16, 2022
A terminal UI for tshark, inspired by Wireshark
A terminal UI for tshark, inspired by Wireshark

Termshark A terminal user-interface for tshark, inspired by Wireshark. V2.2 is out now with vim keys, packet marks, a command-line and themes! See the

Jan 9, 2023
Extensible network application framework inspired by netty

GO-NETTY 中文介绍 Introduction go-netty is heavily inspired by netty Feature Extensible transport support, default support TCP, UDP, QUIC, KCP, Websocket

Dec 28, 2022
Inspired by Have I Been Pwnd
Inspired by Have I Been Pwnd

Have I Been Redised Check it out at RedisPwned and Have I Been Redised How it works We scan the internet for exposed Redis databases broadcasting to t

Nov 14, 2021
Advanced Network Pinger inspired by paping.
Advanced Network Pinger inspired by paping.

itcp Advanced Network Pinger with various options. Why use itcp? TCP and ICMP support Hostname Lookup Threads Timeout ISP lookup Small showcase of itc

Jun 26, 2022
πŸ›  A test fixtures replacement for Go, support struct and ent, inspired by factory_bot/factory_boy

carrier - A Test Fixtures Replacement for Go Statically Typed - 100% statically typed using code generation Developer Friendly API - explicit API with

Jan 23, 2022
USENET-inspired decentralized internet discussion system
USENET-inspired decentralized internet discussion system

===============================================================================

Jan 6, 2023
PlanB: a HTTP and websocket proxy backed by Redis and inspired by Hipache.

PlanB: a distributed HTTP and websocket proxy What Is It? PlanB is a HTTP and websocket proxy backed by Redis and inspired by Hipache. It aims to be f

Mar 20, 2022
Prisma Client Go is an auto-generated and fully type-safe database client

Prisma Client Go Typesafe database access for Go Quickstart β€’ Website β€’ Docs β€’ API reference β€’ Blog β€’ Slack β€’ Twitter Prisma Client Go is an auto-gene

Jan 9, 2023
The Dual-Stack Dynamic DNS client, the world's first dynamic DNS client built for IPv6.

dsddns DsDDNS is the Dual-Stack Dynamic DNS client. A dynamic DNS client keeps your DNS records in sync with the IP addresses associated with your hom

Sep 27, 2022
Go Substrate RPC Client (GSRPC)Go Substrate RPC Client (GSRPC)

Go Substrate RPC Client (GSRPC) Substrate RPC client in Go. It provides APIs and types around Polkadot and any Substrate-based chain RPC calls. This c

Nov 11, 2021
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021
Godaddy-domains-client-go - Godaddy domains api Client golang - Write automaticly from swagger codegen

Go API client for swagger Overview This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you c

Jan 9, 2022
Tailscale-client-go - A client implementation for the Tailscale HTTP API

tailscale-client-go A client implementation for the Tailscale HTTP API Example p

Sep 8, 2022