I want to show sshd.service
notifications on the desktop to know if someone is connected to my PC using ssh.
I could track changes by using terminal and running journalctl -t sshd -f
, but it requires additional attention from me in case of opening terminal every time, running the command and tracking changes.
I've tried it in the next way:
journalctl -t sshd -f
Create new service that will run my
journalctl
command and output it using notifications on the desktop:sudo vim.tiny /etc/systemd/system/shownotes.service
Create script:
vim.tiny /home/user/test/output.sh
:I use
echo $DISPLAY
to get display value./dev/pts/0
- notifications output device.sshd
- service, which syslog's output I will direct toDISPLAY=:0
.Start and enable new service:
The state of the new service in real time I could see by:
Results:
But after rebooting and entering into Gnome session, not Kubuntu/Plazma, it started showing notification on
/dev/pts/2