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

Doesn't find URL #144

Closed
nazar-pc opened this issue May 4, 2024 · 6 comments
Closed

Doesn't find URL #144

nazar-pc opened this issue May 4, 2024 · 6 comments

Comments

@nazar-pc
Copy link

nazar-pc commented May 4, 2024

Just compiled from 19b8896 and notifications from Firefox when clicked are not opening Firefox tab with this printed in logs:

Was requested to open a url but couldn't find one in the specified string

@Toqozz
Copy link
Owner

Toqozz commented May 4, 2024

What does the notification string look like?

@nazar-pc
Copy link
Author

nazar-pc commented May 5, 2024

Here is Slack notification for example:

method call time=1714882726.475586 sender=:1.44 -> destination=:1.22 serial=326 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Nightly"
   uint32 0
   string ""
   string "New message from Slackbot"
   string "What do you know, it works?"
   array [
      string "default"
      string "Activate"
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "Firefox"
      )
      dict entry(
         string "suppress-sound"
         variant             boolean false
      )
      dict entry(
         string "sender-pid"
         variant             int64 9962
      )
   ]
   int32 -1

@Toqozz
Copy link
Owner

Toqozz commented May 6, 2024

Sorry, where is the url in that notification? The shortcut you're using searches for urls in notification text, but I can't see any there.

@nazar-pc
Copy link
Author

nazar-pc commented May 6, 2024

No sure, I didn't work with this kind of stuff before, but I guess sender-pid is what might be somehow used for sending a signal back?

@Toqozz
Copy link
Owner

Toqozz commented Jun 5, 2024

Right, I think I understand what you're saying now.

To open firefox from the notification, firefox will need to define some actions -- it seems like it does define a default action to activate the window (result from stdout using the debug config option):

[src/manager.rs:146] &notification = Notification: {
	id: 1,
	app_name: Firefox,
	summary: Notification #1,
	body: This is the text body of the notification.
Pretty cool, huh?,
	actions: {"default": "Activate"},
	app_image: false,
	hint_image: true,
	urgency: Normal,
	percentage: None,
	time: 2024-06-05 20:33:37.653046405 +10:00,
	timeout: Milliseconds(100000)
}

You'll need to add a ButtonBlock to your config to be able to use these. Take a look at https://github.com/Toqozz/wired-notify/wiki/ButtonBlock for the documentation, or have a look at some configs others have done..

@nazar-pc
Copy link
Author

Hm... looks like what I wanted is to not add button block, but rather assign notification_action1 to 1 instead of notification_interact. Not sure what "Interacts with a block within a notification" means, but apparently it wasn't what I needed.

@nazar-pc nazar-pc closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2024
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

2 participants