I had a frustrating afternoon trying to send notifications from Domoticz to the XFCE desktop, but it is finally working.
On your Domoticz server, you need to install sshpass
Code: Select all
sudo apt install sshpass
Code: Select all
sudo apt install ssh
Code: Select all
#!/bin/bash
sshpass -p YOUR_PASSWORD ssh YOUR_USERNAME@SERVER_ADDRESS DISPLAY=:0 notify-send "Domoticz" \"$1\"
exit 0
Code: Select all
script://xfce-notify.sh #MESSAGE
For a reason I can't explain, SSH login using key authentication doesn't work (it is working if I manually start the script from the command line), hence the use of sshpass.
Note also the escape character "\" around "$1". Without it, notify-send throws an "invalid arguments number" error.