0

I want ubuntu to read aloud something I put on clipboard. I found a solution for that, which is this:

xsel --clipboard | festival --tts

When I try it on terminal, this code works. But when I try to put this command to a shortcut instead, it doesn't work. Nevertheles, if I change the command in shortcuts with 'gedit' for example, it opens gedit. So, the shortcut is also working. What can be the problem over here?

1 Answers1

3

Keyboard shortcut commands do not get interpreted by a shell, so you can't normally use shell features like pipes in them directly.

Change your shortcut command to explicitly run in a Bash shell:

bash -c 'xsel --clipboard | festival --tts'
Byte Commander
  • 110,243