tiramisu icon indicating copy to clipboard operation
tiramisu copied to clipboard

How can I trigger actions?

Open h4m6urg1r opened this issue 2 years ago • 6 comments

I know that i can use gdbus to emit signal but how does that work can I get an example? Please. I wasted my whole day but didn't found anything useful for me.

h4m6urg1r avatar Mar 20 '22 08:03 h4m6urg1r

Action invocations aren't currently supported by tiramisu. Not to say they never will be, but as it stands I've got no idea how I'd implement it.

On the source level, I'd attach a signal handler to the bus, but I don't know what I would do past that. How would the invocation get to the user? STDOUT is already taken. I mean, it could be sent to STDOUT still, but then it may be confusing to the end user which data is actually a notification or an action invocation.

I could do a FIFO, or even a process signal of some sort. Anyways, as of now, invocations aren't possible.

Sweets avatar Mar 22 '22 11:03 Sweets

So I am a newbie in terms of working with DBUS, so can you give me an example of how will i go about it. If you can then please give me an example of how will I trigger the action with notification id, maybe in bash (atleast point me in a direction please). I am currently trying to make a notification panel so if you know anything that can help me please do tell. Thanks and sorry for wasting your time with newbie questions.

h4m6urg1r avatar Mar 23 '22 12:03 h4m6urg1r

I think I misunderstood your question then. It doesn't appear that this is about tiramisu at all, let alone an issue with it.

https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html

You need the given id for a notification and the action identifier string to be able to invoke an action, but you'd emit the org.freedesktop.Notifications.ActionInvoked() signal.

I've not used gdbus, but from a quick google search it looks like

gdbus emit --object-path /org/freedesktop/Notifications --signal org.freedesktop.notifications.ActionInvoked [notification id] [action identifier]

Note that per the spec, there's no guarantee that the receiving server implements actions. In this specific case, tiramisu does not (if that's what you're trying to do to begin with). That being said, the fall-through is the client, meaning it is the clients responsibility to implement the handler for action invocations if the server does not.

Sweets avatar Mar 23 '22 12:03 Sweets

Ok so can you make tiramisu accept action signals? If not then you can close this issue.

Thanks

h4m6urg1r avatar Mar 23 '22 15:03 h4m6urg1r

Hey, I was wondering if it's possible now? As I don't remember if there was "action" filter earlier

h4m6urg1r avatar Dec 27 '22 14:12 h4m6urg1r

Hello! I am looking for a solution to the same problem. I tried using gdbus, but it isn't working for me.

mageowl avatar Dec 02 '23 18:12 mageowl