franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
770 stars 70 forks source link

It's doing nothing with SSH + Byobu + Fish #36

Closed BarbzYHOOL closed 3 years ago

BarbzYHOOL commented 6 years ago

I don't know what the plugin is supposed to do but I type "sleep 6" and nothing happens.

I made my tests by connecting on a debian 9 server, logging in SSH, in Byobu, installing fisherman and "done" aand typing "sleep 6" and switching window or not.

franciscolourenco commented 6 years ago

The plugin does not work over SSH, only on local. Do you have any ideas to make it work over SSH?

BarbzYHOOL commented 6 years ago

No, sorry

BarbzYHOOL commented 6 years ago

Here a link that talks about SSH https://codeyarns.com/2013/06/29/how-to-get-notification-on-long-duration-command-completion-in-fish/

franciscolourenco commented 6 years ago

@BarbzYHOOL does it work for you over SSH without using Byobu?

BarbzYHOOL commented 6 years ago

I didn't test because I made my own notification script and still haven't tried with X11 forwarding but it should work fine as long as it opens a GUI program on your home computer, like notify-send (as I've already opened a GUI program once with it)

franciscolourenco commented 6 years ago

If you could confirm that it is working, that would narrow it down to Byobu.

BarbzYHOOL commented 6 years ago

I'll do some tests in the future (I promise).

I took time to create my own notification and used "xdotool" to get the active window and then I looked at the code of this plugin and was like "why the hell did I spend time on this -__-" (I just was on oh my fish at that time and it was not possible to install it)

BarbzYHOOL commented 6 years ago

Ok I did some tests but I haven't managed to make all that shit work BECAUSE I can't install "notify-send" on my debian server -___-

EDIT: I installed it with libnotify-bin but it's not working at all. At least the command exists but when i type "notify-send hello" it does nothing while "xeyes" works with SSH forwarding

EDIT2: here are some links https://unix.stackexchange.com/questions/147036/notify-send-not-working-under-ssh And a perl script that looks really annoying to set up https://github.com/itsamenathan/libnotify-over-ssh

franciscolourenco commented 5 years ago

@BarbzYHOOL did you configure X11 forwarding on the server? Are you connecting with ssh -X?

https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely

BarbzYHOOL commented 5 years ago

yeah

ammgws commented 4 years ago

@BarbzYHOOL What's the goal here?

SSH into another machine that has fish shell and done installed, and you want the notifications to appear on the local machine?

Or SSH into another machine that has fish shell and done installed, and you want the notifications to appear on the remote machine's monitor?

frederickjh commented 4 years ago

Instead of creating a new issue, I am going comment on this one. If I should create a new one let me know, but I think this along the same lines.

Looking at the done code there are numerous checks to make sure that the terminal window is not in the foreground and that this is not a SSH session.

Done also appears to have the option to run a custom command to notify, but it seems no way to pass the done message to that custom command.

Here is my idea to get notifications while ssh into a remote server.

  1. Add a variable that can be set to disable foreground checking
  2. Add a variable that can disable SSH checking
  3. Add a way to pass the done message to the custom command

My thinking here is there are push and chat services such as PushBullet and Telegram that have API that allow one to quickly put together a function that sends out a message, however I sometimes forget to add the notification function command after my long running command, ie. sleep 300; telegram-me.

Getting notification message to popup on remote machines is problematic at best. Trying to support every push and chat service out there would also be a big undertaking, but maybe this could be done with plugins.

In any case it is just an idea, but thanks for considering it.

ammgws commented 4 years ago

@frederickjh I'm not quite sure I follow:

How does the notification get to the local machine?

franciscolourenco commented 4 years ago

@ammgws I think you have a good understanding. The last part is that the user configures 3rd party service as a proxy to deliver a some stor of notification to the local machine. That 3rd party service could be a chat like Telegram, or a generic push notification app like PushBullet.

@frederickjh If I understood correctly, could you please open a new issue for this? Thanks!

frederickjh commented 4 years ago

How does the notification get to the local machine?

@ammgws Via either a push or chat service's API. The Done message would be passed to an external command that would deliver the message.

ammgws commented 4 years ago

Ah OK.

This can be done by adding config options for disabling SSH and the window checks, as you mentioned. For passing the message to your custom command you can do it like this:

set -U __done_notification_command "yourcommand --subject \$title --body \$message myphone"

Perhaps it could be documented.

frederickjh commented 4 years ago

@ammgws While you were posting your last comment I created the new issue #80. Can you re-post your last comment on issue #80, please? As I think this is helpful information for that issue.

frederickjh commented 4 years ago

Perhaps it could be documented.

:+1:

franciscolourenco commented 3 years ago

Closing due to inactivity, please re-open if necessary.