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

How can I trigger actions? #47

Open
h4m6urg1r opened this issue Mar 20, 2022 · 6 comments
Open

How can I trigger actions? #47

h4m6urg1r opened this issue Mar 20, 2022 · 6 comments

Comments

@h4m6urg1r
Copy link

h4m6urg1r commented Mar 20, 2022

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.

@Sweets
Copy link
Owner

Sweets commented Mar 22, 2022

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.

@h4m6urg1r
Copy link
Author

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.

@Sweets
Copy link
Owner

Sweets commented Mar 23, 2022

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.

@h4m6urg1r
Copy link
Author

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

Thanks

@h4m6urg1r
Copy link
Author

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

@mageowl
Copy link

mageowl commented Dec 2, 2023

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

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