Coder Social home page Coder Social logo

asvvvad1 / cply Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 31 KB

Search and copy lyrics from your terminal

License: GNU General Public License v3.0

Go 100.00%
terminal lyrics-fetcher lyrics-search lyrics genius command-line golang go go-cli cross-platform

cply's Introduction

cply

Search and copy lyrics from your terminal This version is a rewrite of my PHP script in Go

Requirements/Platforms

I only tested it on a ubuntu based distro but it work on all others including BSD and MacOS and Windows

Linux users need xclip or xsel to be installed for the copying to work

Wayland users need wl-clipboard

It should work on Termux but not tested.

Install

If you use a Linux based OS with amd64 architecture you can download a pre-build and min-sized binary from releases

First, generate an api token for the search functionality (required): https://genius.com/api-clients

Then, set it in the environment variable $CPLY_TOKEN which you should keep in your ~/.profile

To do that add: export CPLY_TOKEN=access_token_here to end of that file

changes to that file will only happen when you log out and log in againbut you can run source ~/.profile in the shell to test it

Finally just run this command

go install github.com/asvvvad/cply

Usage:

  • cply song name and/or artist search for "song name and/or artist" and gives you results to select from (max. 10)

    • To select a song simply type its number in the input and press enter, to choose the first one press enter directly or:
  • cply -first|-1 song name and/or artist search for "song name and/or artist" then fetch and copy the first result directly

    • This can be made default by setting the $CPLY_FIRST variable
  • cply -print|-p song name and/or artist search for "song name and/or artist" print the lyrics instead of just copying

    • This can be made default by setting the $CPLY_PRINT variable
    • cply -print|-p -no-color|-n song name and/or artist print without highlighting (Making the [Chorus] ect yellow)
      • This can be made default by setting the $CPLY_NOCOLOR variable
  • cply -1 -p song name and/or artist search, select first result (if there is), copy it and print.

ASCIICAST

asciicast

Modules used:

cply's People

Contributors

asvvvad1 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

cply's Issues

Panic on MacOS

After following the steps in the README, every execution of cply (except printing the help screen) causes a panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x126fd1c]

goroutine 1 [running]:
github.com/tsirysndr/go-genius.(*SearchService).Get(0xc000066198, 0xc00001a588, 0x8, 0x0, 0x0, 0xc00001a588, 0x8, 0xc000100000)
	/Users/xxx/go/pkg/mod/github.com/tsirysndr/[email protected]/search.go:46 +0x13c
main.main()

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.