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

Clicking on a notification should bring up the terminal this notification came from (Linux) #96

Open
eugene-babichenko opened this issue Jan 4, 2021 · 5 comments

Comments

@eugene-babichenko
Copy link
Contributor

Pretty much as in the description. Switching to the terminal when clicking on the corresponding notification would be nice.

@franciscolourenco
Copy link
Owner

@eugene-babichenko This works on macOS already. Which OS are you using?

@eugene-babichenko
Copy link
Contributor Author

This is needed to be done at least for WSL and Fedora with GNOME 3. Probably other Linux distros.

@ammgws
Copy link
Contributor

ammgws commented Jan 25, 2021

Wouldn't it be dependent on the notification daemon being used? Also the window manager, at least in wayland I imagine the switching part would be different for each compositor?

Just trying to picture what a solution would look like.

@eugene-babichenko
Copy link
Contributor Author

Yes, this is the problem. I tried to write an implementation for GNOME 3 running on Wayland and it was very GNOME-specific.

@franciscolourenco franciscolourenco changed the title Clicking on a notification should bring up the terminal this notification came from Clicking on a notification should bring up the terminal this notification came from (Linux) Jan 10, 2024
@mikelei8291
Copy link

I'm running fish in the terminal emulator "Terminator", so if I change the argument of the --app-name option of the notify-send command it would activate the Terminator app when the notification was clicked.

It's also possible to activate the window with either wmctrl or xdotools commands given that we have the window ID from the function __done_get_focused_window_id:

wmctrl -i -a <window ID>  # note that the order of the options should not be changed
xdotools windowactivate <window ID>

However, I was not able to use the --action option to specify an action on the notification on Ubuntu 22.04LTS, since the option was not added until a newer version.

Therefore, a simple solution would be let the user set an app-name so the app would be activated when the notification was clicked. I could open a PR to add this if you want.

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

No branches or pull requests

4 participants