What I am trying to do is, I have a few texts in a file & when I tap a key combination like ctrl+Q, the text should appear as a notification on my Ubuntu Desktop. What is the command to assign this keyboard shortcut?
Asked
Active
Viewed 836 times
1 Answers
3
You can use the notify-send tool:
cd $HOME
touch foo
echo "foo\nbar\nbaz" > foo
notify-send "TEST" $(cat ~/foo)
it will create a notification like the one below:

Finally read How to add keyboard shortcuts? to enable Ctrl+Q for this notification (or better choose another combination as this one is already occupied - Thanks Jacob Vlijm).
Update:
All you have to do now is to create a small launcher (foo.sh):
#!/bin/bash
notify-send "TEST" $(cat ~/foo)
Change its permissions:
chmod 777 foo.sh
And assign to your new shortcut the full path of your launcher:

Sylvain Pineau
- 63,229