sdushantha / kunst

Download and display album art or display embedded album art
MIT License
310 stars 28 forks source link

Added dunstify, now you can send notifications :) #58

Open FrenzyExists opened 3 years ago

FrenzyExists commented 3 years ago

So I wanted notifications on ncmpcpp when I changd song, here's my implementation. I use dunst, if there's a way to generalize that would be cool. Reason i use dunst: replaces notifications via the id thing. I tried to make it as customizable as possible

image

Here's how it looks on my end. Hope this would be useful for anyone!

TorchedSammy commented 3 years ago

if there's a way to generalize that would be cool.

use notify-send to not be dunst specific

FrenzyExists commented 3 years ago

I wanted, but notify-send doesn't have IDs per se, if i use notify-send the prev music notif won't be updated, rather put right after. And yeah I checked and I couldn't find that notify-send had nor the Appname option nor the ID option

TorchedSammy commented 3 years ago

do you want general compatibility for anyone with a notification daemon or dunst specifics?

sdushantha commented 3 years ago

notify-send does not have the capability to replace another notification by it's ID. But after doing some Googling, I found out that someone had created a patch for it: https://launchpadlibrarian.net/105791133/print-and-replace-id-v3.patch

So this might be something of interest to you. But since not everyone will be using the patched version of notify-send it might be wise to check if the user has the patched version or not. If they do, replace the notification or else, send it as a separate notification.

I unfortunately no longer use kunst as I don't download my music anymore and stream it instead. Therefore, I cant really test out the code. But I'll have a good look at it and try to catch any mistakes.

FrenzyExists commented 3 years ago

@TorchedSammy Some compatibility would be nice, using dunst is currently my option. What I would do is the patch sdushantha mentioned. I'll try the patch and replace dunst :+1: