You should create your own fail2ban actions and filters. Let me show an example
Simply add lines for your new desktop notify action in /etc/fail2ban/jail.conf
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
ssh-with-desktop-notification[title=<Title Here>, content=<Content Here>]
logpath = /var/log/secure
maxretry = 3
Crate a new file that name in /etc/fail2ban/actions.d/ssh-with-desktop-notification.conf and add any command to actionstart, actionstop events. For example ,i am assuming that you are using GNOME as a desktop environment,
actionban = `which notify-send` <content>
After all these new lines do not forget to restart fail2ban service.
In conclusion, this new fail2ban action checks /var/log/secure log file for breaking attemps. After 3 failed actions it will run iptables with three parameters(name, port and protocol). After running iptables fail2ban will look to /etc/fail2ban/actions.d folder for ssh-with-descktop-notifications.conf file. If the file exist then it will look to file for actionban event. Then, if actionban event exist fail2ban executes actionban commands with parameters(title and content) when banning an IP.
Note : Please check commands are executed with fail2ban user rights.