Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound hint #529

Closed
kopr12 opened this issue Jul 7, 2018 · 11 comments
Closed

Sound hint #529

kopr12 opened this issue Jul 7, 2018 · 11 comments

Comments

@kopr12
Copy link

kopr12 commented Jul 7, 2018

Any chance for implementing sound hint ?

For example
notify-send "Sound test" --hint=string:sound-file:/path/to/sound.wav

this works in most notification daemons.

@ghost
Copy link

ghost commented Jul 7, 2018

I have the following in my dunstrc

dunstrc

[play_sound]
summary = "*"
script = ~/bin/alert.sh

alert.sh

#!/bin/sh
splay /home/gregf/.sounds/beep.mp3

As a quick solution.

@kopr12
Copy link
Author

kopr12 commented Jul 7, 2018

Little tedious but works, thanks!

@kopr12 kopr12 closed this as completed Jul 7, 2018
@bebehei
Copy link
Member

bebehei commented Jul 8, 2018

Well, there is the sound-file hint in the notification spec.

But I think I can speak for us both: We don't want to implement it and neither maintain it.

@kopr12
Copy link
Author

kopr12 commented Jul 8, 2018

The whole thing is maybe 10 lines of code, max.

Was thinking of making a PR but if there's no interest for it I'm not gonna bother.

@tsipinakis
Copy link
Member

I'd gladly accept a PR if you want to implement it.

@kopr12
Copy link
Author

kopr12 commented Jul 8, 2018

I'll try, might take a few days to see how dunst functions.
But basically, it just needs canberra-gtk.h and ca_gtk_play_for_widget function from it.
Grab filename from the sound-file hint and pass it to that function to play it.

@tsipinakis
Copy link
Member

I'd propose we just use the infrastructure available with the scripts and let the user provide a command to run, e.g. sound_cmd = mpv.

Everyone has at least some one audio player installed and I'd rather avoid adding any more dependencies.

@kopr12
Copy link
Author

kopr12 commented Jul 8, 2018

Sure, that works just fine, I just didn't know about it, installed dunst yesterday for the first time, must say I like it, the only thing that was confusing was that sound hint thing, not confusing but missing actually.

Using scripts is fine, that's why I closed this issue once I found out about it.

Playing sound from the code without adding more dependencies is not doable, I think.

@kopr12
Copy link
Author

kopr12 commented Jul 8, 2018

I'm using aplay, part of alsa-utils.

IMHO, the best solution would be to take the hint and play it with command specified in dunstrc, option to turn sound on or off would also be there.

@tsipinakis
Copy link
Member

IMHO, the best solution would be to take the hint and play it with command specified in dunstrc, option to turn sound on or off would also be there.

Sorry if I wasn't clear, that's exactly what I was suggesting :p

@kopr12
Copy link
Author

kopr12 commented Jul 8, 2018

You was clear, dunno why I said it like that :)

Guess I wanted to say that I would be happy to see that implemented that way :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants