dbrgn / orochi

Orochi is an interactive command line client for 8tracks.com.
GNU General Public License v3.0
84 stars 17 forks source link

Log the currently playing song to a file. #72

Closed Kshitij-Banerjee closed 8 years ago

Kshitij-Banerjee commented 8 years ago

I needed the currently playing song in a different program (tmux-powerline).
This helps me show the currently playing song in my status bar. (by making tmux read the file if present)

Logging it to a file, so that it can be read by any other program. This is similar to terminal title request.

Kshitij-Banerjee commented 8 years ago

image

dbrgn commented 8 years ago

Hi! First of all, welcome and thanks for your contribution.

Hm, I'm not sure if logging to a file is a good approach. You do polling, right?

I guess I'll accept this for now, as I see the value of providing the currently played song for other programs, and if we need more IPC we might move to something like DBUS in the future :) I'll add some comments to the code though.

dbrgn commented 8 years ago

I left some feedback. If you have any remaining questions, let me know. Or contact me through some chat program, you'll find some channels here.

Kshitij-Banerjee commented 8 years ago

Also, apologies for the multitude of commits .. Tried squashing them but seemed to only increase them :)

Kshitij-Banerjee commented 8 years ago

Incorporated everything, except multiline attributes since I do a cat in powerline :)

dbrgn commented 8 years ago

See my comments about the help text and the format. The goal is to have a format that works for most people :) And don't worry about the commits, if you want I can squash them for you when merging.

Kshitij-Banerjee commented 8 years ago

Done.

dbrgn commented 8 years ago

Thanks!

Kshitij-Banerjee commented 8 years ago

Also, did relevant changes to powerline @ https://github.com/erikw/tmux-powerline/pull/210

dbrgn commented 8 years ago

Ah, I didn't realize that the now playing file was a tmux-powerline feature :)

Kshitij-Banerjee commented 8 years ago

:D yeah. thats how I started figuring this, to enable powerline. I added the feature to tmux-powerline as a different pull request https://github.com/erikw/tmux-powerline/pull/209

dbrgn commented 8 years ago

Merged in 7b1a9f5ae6af5544870820e4b0799941ab4d3501. Thanks @Kshitij-Banerjee!

I also added code to remove the current song file when the playback stops. Otherwise the status would still show a song playing, even if it has ended or the playback has been stopped.

Kshitij-Banerjee commented 8 years ago

Great. was planning on doing that later infact !

dbrgn commented 8 years ago

Any other pull requests planned? If not, I'll probably do a release soon!

Kshitij-Banerjee commented 8 years ago

Nopes. Im good. :)