Search code examples
shellsshnotify-send

notify-send doesn't work over SSH


I want to use PC A to send a notification to PC B via SSH, but I didn't see the notification on B.

ssh user_name@B_ip 'notify-send hello'

I also tried this: Use SSH on B to login A and then login B back and then send a notification. However it still didn't work. Didn't see the notification on B either.


Solution

  • You have to set DISPLAY variable

    DISPLAY=:0.0 notify-send hello
    

    For some information about this variable see this.