notify-send not working under ssh

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
10
down vote

favorite
3












Maybe this is answered somewhere else, but I didn't see it.



I am running Ubuntu 14.04. When I SSH into my machine, for example:



ssh <user>@<machineip> notify-send "Hello"


I don't see anything on the monitor where I am logged into the machine.
If I prefix notify-send with DISPLAY=:0.0 or DISPLAY=:0 nothing different happens. I just never see any notification on the current session.



Is there some trick/switch to getting this working?



In case this isn't clear, allow me to reiterate:
From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.










share|improve this question























  • For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
    – Mark
    Aug 3 '15 at 8:16














up vote
10
down vote

favorite
3












Maybe this is answered somewhere else, but I didn't see it.



I am running Ubuntu 14.04. When I SSH into my machine, for example:



ssh <user>@<machineip> notify-send "Hello"


I don't see anything on the monitor where I am logged into the machine.
If I prefix notify-send with DISPLAY=:0.0 or DISPLAY=:0 nothing different happens. I just never see any notification on the current session.



Is there some trick/switch to getting this working?



In case this isn't clear, allow me to reiterate:
From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.










share|improve this question























  • For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
    – Mark
    Aug 3 '15 at 8:16












up vote
10
down vote

favorite
3









up vote
10
down vote

favorite
3






3





Maybe this is answered somewhere else, but I didn't see it.



I am running Ubuntu 14.04. When I SSH into my machine, for example:



ssh <user>@<machineip> notify-send "Hello"


I don't see anything on the monitor where I am logged into the machine.
If I prefix notify-send with DISPLAY=:0.0 or DISPLAY=:0 nothing different happens. I just never see any notification on the current session.



Is there some trick/switch to getting this working?



In case this isn't clear, allow me to reiterate:
From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.










share|improve this question















Maybe this is answered somewhere else, but I didn't see it.



I am running Ubuntu 14.04. When I SSH into my machine, for example:



ssh <user>@<machineip> notify-send "Hello"


I don't see anything on the monitor where I am logged into the machine.
If I prefix notify-send with DISPLAY=:0.0 or DISPLAY=:0 nothing different happens. I just never see any notification on the current session.



Is there some trick/switch to getting this working?



In case this isn't clear, allow me to reiterate:
From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.







ssh libnotify






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 mins ago









GAD3R

23.7k1648100




23.7k1648100










asked Jul 28 '14 at 17:27









aikeru

16517




16517











  • For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
    – Mark
    Aug 3 '15 at 8:16
















  • For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
    – Mark
    Aug 3 '15 at 8:16















For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
– Mark
Aug 3 '15 at 8:16




For other people who find this as top result through Google, DISPLAY=:0 notify-send 'hello' worked for me (not for aikeru), try that before more complicated steps.
– Mark
Aug 3 '15 at 8:16










1 Answer
1






active

oldest

votes

















up vote
7
down vote



accepted










I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the $DISPLAY is how X11 sends the output from an application to another for displaying purposes, but the notify-send is sending an actual message to the notification daemon. This message is send using the libnotify library.



excerpt


libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.




Source: https://developer.gnome.org/libnotify/



Per app approach



One method for joining the notify-send messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.



Tunneling libnotify over SSH



For a more general solution libnotify-over-ssh may be more what you're looking for.



excerpt


This is a client server perl script I wrote so that my server could
essentially send libnotify messages to my local machine. I use this
mainly with weechat but has a feature to make it more general. When
calling the client with the weechat tag the server checks the name of
the current focused window. If it starts with weechat, notifications
are suppressed if not notify-send is called.




Displaying on the remote server



If on the otherhand you're simply trying to use notify-send to display messages on a remote server that you've used ssh to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.



To get notify-send working I had to set this variable with the appropriate value from the remote system's desktop environment.



$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wzrbFpDUZQ,guid=82e5bffe1f819506faecc77a53d3ba73


On my system I was able to make use of a file that's maintained for this exact purpose.



$ ssh me@remote
$ source ~/.dbus/session-bus/6a34f24f9c504e3f813bc094ed0b67af-0
$ notify-send "hi"


NOTE: The name of the DBUS file will change from session to session.






share|improve this answer






















  • Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
    – aikeru
    Jul 28 '14 at 17:50










  • @aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
    – slm♦
    Jul 28 '14 at 18:02










  • So is there any way to attach to the current environment or something like that, such that it has the info needed?
    – aikeru
    Jul 28 '14 at 18:15










  • @aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
    – slm♦
    Jul 28 '14 at 18:50










  • @aikeru - see updates.
    – slm♦
    Jul 29 '14 at 11:37










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f147036%2fnotify-send-not-working-under-ssh%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
7
down vote



accepted










I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the $DISPLAY is how X11 sends the output from an application to another for displaying purposes, but the notify-send is sending an actual message to the notification daemon. This message is send using the libnotify library.



excerpt


libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.




Source: https://developer.gnome.org/libnotify/



Per app approach



One method for joining the notify-send messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.



Tunneling libnotify over SSH



For a more general solution libnotify-over-ssh may be more what you're looking for.



excerpt


This is a client server perl script I wrote so that my server could
essentially send libnotify messages to my local machine. I use this
mainly with weechat but has a feature to make it more general. When
calling the client with the weechat tag the server checks the name of
the current focused window. If it starts with weechat, notifications
are suppressed if not notify-send is called.




Displaying on the remote server



If on the otherhand you're simply trying to use notify-send to display messages on a remote server that you've used ssh to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.



To get notify-send working I had to set this variable with the appropriate value from the remote system's desktop environment.



$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wzrbFpDUZQ,guid=82e5bffe1f819506faecc77a53d3ba73


On my system I was able to make use of a file that's maintained for this exact purpose.



$ ssh me@remote
$ source ~/.dbus/session-bus/6a34f24f9c504e3f813bc094ed0b67af-0
$ notify-send "hi"


NOTE: The name of the DBUS file will change from session to session.






share|improve this answer






















  • Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
    – aikeru
    Jul 28 '14 at 17:50










  • @aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
    – slm♦
    Jul 28 '14 at 18:02










  • So is there any way to attach to the current environment or something like that, such that it has the info needed?
    – aikeru
    Jul 28 '14 at 18:15










  • @aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
    – slm♦
    Jul 28 '14 at 18:50










  • @aikeru - see updates.
    – slm♦
    Jul 29 '14 at 11:37














up vote
7
down vote



accepted










I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the $DISPLAY is how X11 sends the output from an application to another for displaying purposes, but the notify-send is sending an actual message to the notification daemon. This message is send using the libnotify library.



excerpt


libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.




Source: https://developer.gnome.org/libnotify/



Per app approach



One method for joining the notify-send messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.



Tunneling libnotify over SSH



For a more general solution libnotify-over-ssh may be more what you're looking for.



excerpt


This is a client server perl script I wrote so that my server could
essentially send libnotify messages to my local machine. I use this
mainly with weechat but has a feature to make it more general. When
calling the client with the weechat tag the server checks the name of
the current focused window. If it starts with weechat, notifications
are suppressed if not notify-send is called.




Displaying on the remote server



If on the otherhand you're simply trying to use notify-send to display messages on a remote server that you've used ssh to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.



To get notify-send working I had to set this variable with the appropriate value from the remote system's desktop environment.



$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wzrbFpDUZQ,guid=82e5bffe1f819506faecc77a53d3ba73


On my system I was able to make use of a file that's maintained for this exact purpose.



$ ssh me@remote
$ source ~/.dbus/session-bus/6a34f24f9c504e3f813bc094ed0b67af-0
$ notify-send "hi"


NOTE: The name of the DBUS file will change from session to session.






share|improve this answer






















  • Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
    – aikeru
    Jul 28 '14 at 17:50










  • @aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
    – slm♦
    Jul 28 '14 at 18:02










  • So is there any way to attach to the current environment or something like that, such that it has the info needed?
    – aikeru
    Jul 28 '14 at 18:15










  • @aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
    – slm♦
    Jul 28 '14 at 18:50










  • @aikeru - see updates.
    – slm♦
    Jul 29 '14 at 11:37












up vote
7
down vote



accepted







up vote
7
down vote



accepted






I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the $DISPLAY is how X11 sends the output from an application to another for displaying purposes, but the notify-send is sending an actual message to the notification daemon. This message is send using the libnotify library.



excerpt


libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.




Source: https://developer.gnome.org/libnotify/



Per app approach



One method for joining the notify-send messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.



Tunneling libnotify over SSH



For a more general solution libnotify-over-ssh may be more what you're looking for.



excerpt


This is a client server perl script I wrote so that my server could
essentially send libnotify messages to my local machine. I use this
mainly with weechat but has a feature to make it more general. When
calling the client with the weechat tag the server checks the name of
the current focused window. If it starts with weechat, notifications
are suppressed if not notify-send is called.




Displaying on the remote server



If on the otherhand you're simply trying to use notify-send to display messages on a remote server that you've used ssh to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.



To get notify-send working I had to set this variable with the appropriate value from the remote system's desktop environment.



$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wzrbFpDUZQ,guid=82e5bffe1f819506faecc77a53d3ba73


On my system I was able to make use of a file that's maintained for this exact purpose.



$ ssh me@remote
$ source ~/.dbus/session-bus/6a34f24f9c504e3f813bc094ed0b67af-0
$ notify-send "hi"


NOTE: The name of the DBUS file will change from session to session.






share|improve this answer














I think you're confusing the various technologies and how they work. I wouldn't expect that the notification daemon from one system could send messages via SSH. Setting the $DISPLAY is how X11 sends the output from an application to another for displaying purposes, but the notify-send is sending an actual message to the notification daemon. This message is send using the libnotify library.



excerpt


libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.




Source: https://developer.gnome.org/libnotify/



Per app approach



One method for joining the notify-send messages to your local system's notifier is to use a approach as outlined by this blog post titled: IRC notifications via SSH and libnotify. This approach would need to be customized per each type of notification that you'd want to tunnel back to your local notifier.



Tunneling libnotify over SSH



For a more general solution libnotify-over-ssh may be more what you're looking for.



excerpt


This is a client server perl script I wrote so that my server could
essentially send libnotify messages to my local machine. I use this
mainly with weechat but has a feature to make it more general. When
calling the client with the weechat tag the server checks the name of
the current focused window. If it starts with weechat, notifications
are suppressed if not notify-send is called.




Displaying on the remote server



If on the otherhand you're simply trying to use notify-send to display messages on a remote server that you've used ssh to connect to, you'll likely need to follow one of the suggestions that was made in this Q&A titled: Using notify-send with cron. Even though several of the answers suggested that this was unnecessary, I had to do the following as others mentioned in comments on my Fedora 20 system using Cinnamon as my desktop to get things working.



To get notify-send working I had to set this variable with the appropriate value from the remote system's desktop environment.



$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-wzrbFpDUZQ,guid=82e5bffe1f819506faecc77a53d3ba73


On my system I was able to make use of a file that's maintained for this exact purpose.



$ ssh me@remote
$ source ~/.dbus/session-bus/6a34f24f9c504e3f813bc094ed0b67af-0
$ notify-send "hi"


NOTE: The name of the DBUS file will change from session to session.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 13 '17 at 12:36









Community♦

1




1










answered Jul 28 '14 at 17:45









slm♦

242k66501669




242k66501669











  • Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
    – aikeru
    Jul 28 '14 at 17:50










  • @aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
    – slm♦
    Jul 28 '14 at 18:02










  • So is there any way to attach to the current environment or something like that, such that it has the info needed?
    – aikeru
    Jul 28 '14 at 18:15










  • @aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
    – slm♦
    Jul 28 '14 at 18:50










  • @aikeru - see updates.
    – slm♦
    Jul 29 '14 at 11:37
















  • Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
    – aikeru
    Jul 28 '14 at 17:50










  • @aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
    – slm♦
    Jul 28 '14 at 18:02










  • So is there any way to attach to the current environment or something like that, such that it has the info needed?
    – aikeru
    Jul 28 '14 at 18:15










  • @aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
    – slm♦
    Jul 28 '14 at 18:50










  • @aikeru - see updates.
    – slm♦
    Jul 29 '14 at 11:37















Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
– aikeru
Jul 28 '14 at 17:50




Hmmm.. I added some clarification. I don't want to send messages over SSH, I think. I think of notify-send as a terminal app that I can run interactively to the host (not client) PC. I think I understand - notify-send is a client per se on the host machine in its own way - is what you're saying. Does that somehow mean this is not possible to do while in an SSH session? Mind you, I am not trying to get this to appear on the SSH client, only the SSH host/server.
– aikeru
Jul 28 '14 at 17:50












@aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
– slm♦
Jul 28 '14 at 18:02




@aikeru - notify-send can send messages to the listening notifier daemon. When you login via SSH this environment does not have the info necessary to communicate w/ this notifier, is the underlying issue.
– slm♦
Jul 28 '14 at 18:02












So is there any way to attach to the current environment or something like that, such that it has the info needed?
– aikeru
Jul 28 '14 at 18:15




So is there any way to attach to the current environment or something like that, such that it has the info needed?
– aikeru
Jul 28 '14 at 18:15












@aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
– slm♦
Jul 28 '14 at 18:50




@aikeru - much of what I've found shows that setting $DISPLAY=:0 would work, but this does not work for me as well. I'm on Fedora 20 using Cinnamon as my desktop. Using strace to debug this shows that there is a connection that doesn't get done when going through SSH, still investigating what is blocking this.
– slm♦
Jul 28 '14 at 18:50












@aikeru - see updates.
– slm♦
Jul 29 '14 at 11:37




@aikeru - see updates.
– slm♦
Jul 29 '14 at 11:37

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f147036%2fnotify-send-not-working-under-ssh%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

The Forum (Inglewood, California)

Palaiologos