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

Overview

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
Issues
  • 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
    
    opened by DavidHenryThoreau 9
  • 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)

    opened by Luc-Saccoccio 5
  • 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 ?

    bug 
    opened by Luc-Saccoccio 4
  • 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.

    opened by johnallen3d 3
  • 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"
    }
    
    opened by DavidHenryThoreau 2
  • Opening a song with unknown duration crashes goMP

    Opening a song with unknown duration crashes goMP

    Creating this Issue as a reference. Might be helpful if someone runs into the same issue. This is happening due to the duration is by default set to zero by mpd which means we can't find the percentage and which makes the slice go out of bound.

    opened by aditya-K2 1
  • Implementing Search Functionality

    Implementing Search Functionality

    Simple Implementation for Fuzzy Searching [ sort of fuzzy ] I am still working on the algorithm. The Searching is functional but there are some bugs. I will merge this in master once I think it is stable. Till then you can try out the search branch. The Build Instructions are the same.

    opened by aditya-K2 1
  • Implementing Simple Buffer Searching

    Implementing Simple Buffer Searching

    Searching the Global Database although is enough but I have felt a need to have a quick and fast search option to search the current buffer.

    I am thinking of making it global ( i.e can be used to search any buffer right now it only searches the file browser buffer )

    https://user-images.githubusercontent.com/51816057/147699253-2a859e7e-04f0-45fb-92cd-a33f50194ada.mp4

    opened by aditya-K2 0
  • Fixes #12

    Fixes #12

    This fixes The Issue when a song with unknown duration was played then the percentage was calculated wrong and the slice was getting out of bound.

    fix : I have added a check for the duration.

    opened by aditya-K2 0
  • Survey: Is the Documentation of `gomp` helpful in setting up `gomp` on your PC?

    Survey: Is the Documentation of `gomp` helpful in setting up `gomp` on your PC?

    Have you successfully set up gomp on your PC? Is the documentation that has been provided enough for you to setup gomp? If yes please react with πŸ‘ to this message. Or else drop your feedback. It would be really helpful πŸ™

    opened by aditya-K2 0
  • 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"
    
    opened by raj23689 9
  • 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
    
    opened by cumulus13 3
  • 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.

    opened by mrusme 2
Owner
Aditya Kurdunkar
Aditya Kurdunkar
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

Steve Kemp 5 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.

null 12 Aug 15, 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

Aleph Retamal 137 Jul 13, 2022
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

Roman Blanco 5 Feb 2, 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

Luc Perkins 384 Jul 22, 2022
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.

Zhangliu 69 Aug 15, 2022
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

Graham Clark 7.4k Aug 10, 2022
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

The Go-Netty Project 318 Aug 2, 2022
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

Michael Blum 4 Nov 14, 2021
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

Yariya 1 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

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

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

β—€β—’β—€β—’β—€β—’β—€β—’ 361 Aug 4, 2022
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

vinay badhan 1 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

Prisma 1.3k Aug 12, 2022
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

Ryan Young 12 Aug 10, 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

Chino Chang 1 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

Joram Wambugu 0 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

Mickael Stanislas 0 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

David Bond 10 Jun 29, 2022