Hi there is it possible to run a script in snippets?

Asked by Mathew Potter

Hi there, i'm working on your layouts, and I have created a touch bar with password shortcuts right on the screen. What I am wondering is can we execute scripts in the snippets sections?

Question information

English Edit question
Onboard Edit question
No assignee Edit question
Solved by:
Francesco Fumanti
Last query:
Last reply:
Revision history for this message
Best Francesco Fumanti (frafu) said :

The snippets simulate somebody typing on a keyboard. It does not interprete what is being typed; it only sends keystrokes to the front application.

You can however put cli commands into the snippets. I have for example the following in a snippet:
tail -f /var/log/syslog \n

When I click on that snippet while the terminal is the front application, I see the system log that scrolls in the terminal.

Remark: The "\n" at the end of the command is equivalent to hitting the return key. You can remove it and the command gets only executed after you hit the return key on the keyboard.

Revision history for this message
Mathew Potter (matt-r) said :

Thanks Francesco Fumanti, that solved my question.

Revision history for this message
Mathew Potter (matt-r) said :

Thank you, this was helpful, i've got it in my mind to have a little bit of touchbar on the my touch screen xps :) this gets me one setup closer


Revision history for this message
Francesco Fumanti (frafu) said :

You're welcome.