Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am working in a multi-workspace multi-window configuration. I am constantly running scripts behind the scenes.

It would save me a lot of time and context switching if I could kick off a script on another server and have a message popup (growl notify or w/e) on my desktop letting me know that the command finished.

Is there a way to do that in Ubuntu 10?

share|improve this question

1 Answer 1

Here's one way to do it, assuming you have password-less SSH set up:

ssh my-graphical-workstation 'env DISPLAY=$(w -s $USER | grep -m 1 " :" | awk "{print \$3}") notify-send "Done processing."'

You'll need libnotify-bin Install libnotify-bin installed on my-graphical-workstation.

Adjust it as necessary.

share|improve this answer
    
Why not simply use ssh server command && notify-send "Done processing.", run (of course) from the workstation where the notification should go? –  loevborg Jun 8 '11 at 18:39
    
@loevborg This can be integrated into scripts that reside on the remote machine, does not require the SSH connection to be maintained while the job is processing, and is convenient to use from within GNU Screen. –  ændrük Jun 8 '11 at 20:17
    
this sounds great! Except I am not getting popups. Libnotify is of course installed. I rummaged in my system settings to try and get an event source configured, but I didn't see any "notify-send" or "read stuff from CLI" source. –  Paul Nathan Jun 8 '11 at 21:36
    
@Paul To troubleshoot, first confirm that notifications appear when you run just notify-send "Done processing." on the graphical workstation. Then, on the remote machine, check what happens if you use echo env in place of env in the full SSH command. You should see output that's similar to env DISPLAY=:0.0 notify-send Done processing. Confirm that the value of DISPLAY in that output matches one of the values in the FROM column of w -s on the graphical workstation. –  ændrük Jun 8 '11 at 22:39
    
Yeah, my workstation doesn't show it. :-/ –  Paul Nathan Jun 8 '11 at 22:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.