[TUTORIAL] XFCE Notifications
Posted: Saturday 13 November 2021 20:05
I am a long-time Linux user and my desktop of choice is XFCE4 (running under Debian).
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
On your XFCE workstation, the SSH daemon must be installed and running.
In your domoticz/script directory, create a file "xfce-notify.sh" and make it executable
In Domoticz, go to Setup/Settings/Notifications/CUSTOM HTTP/ACTION. Check "Enable" and fill "URL/ACTION" with
What the script does is opening an SSH session from the Domoticz server to your workstation and then using notify-send to access XFCE's notification system.
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.
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 #MESSAGEFor 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.