cat brain.log | less

Getting it down on `paper`

notify-send over ssh

This tutorial assumes you’re using Ubuntu 12.04. Subtle changes may be necessary if you use a different distro.

First you need to have your ssh keys configured for passwordless connections.

After that, you need to ensure you have notify-send installed.

Now, it’s just a matter of executing notify-send remotely:
ssh "DISPLAY=:0 /usr/bin/notify-send \"Hello, World\""
ssh "DISPLAY=:0 /usr/bin/notify-send -i face-smile \"Header\" \"Content\""

At this point, you may wonder how to escape special characters:
ssh "DISPLAY=:0 /usr/bin/notify-send -i face-smile \"Profit\" \"Sold half for +\\\$221.11\\\!\""

Or perhaps you’re more interested in those fancy icons?
$ find /usr/share/icons/
Pick any one and simply leave off the directory and file extension.

Or better! If you have ~/img/awesome.png in your home directory:
ssh "DISPLAY=:0 /usr/bin/notify-send -i \"/home/user/img/awesome.png\" \"Header\" \"Content\""

Ah yes, this assumes you want the notifcations to show up on your primary display. If you’re running multiple workspaces or have displays or something else, you may need to change your display id (DISPLAY=:0). As I’ve never had anything other than DISPLAY=:0.0, I can’t really say under which conditions this applies. Good luck!



No comments so far.

(comments are closed)