mpd-notification icon indicating copy to clipboard operation
mpd-notification copied to clipboard

Showing song length and elapsed time in notification

Open Poroing opened this issue 5 years ago • 1 comments

I wanted to know easily the length and the elapsed time of the song I am currently listening to. Therefore I modified the code to show the length of the song when mpd state changed and to show elapsed time and length of the song when the signal SIGHUP is sent to mpd-notification.

The information on the length and elapsed time of the song is not shown by default. It can be activated in the configuration file with show-time = true.

Since the notification object was not updated when a signal was sent to mpd-notification, I factorized out of the main function the update of the notification object and called the newly created function from the signal handler. This way, the correct elapsed time is shown when a signal is sent to the process. Some variable, such as music_dir, were made global to make them accessible from the function that update the notification.

If something must be changed in my code, I will gladly modify it.

Poroing avatar Aug 26 '18 12:08 Poroing

I've made the pull request ready for merge in the base branch again.

@eworm-de I hope you can go over it and tell me what needs to be changed or what you don't like about the change. Would you like me to change the README.md in the pull request to let the user know about this change?

Poroing avatar Apr 19 '20 07:04 Poroing