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

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

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 :
#2

Thanks Francesco Fumanti, that solved my question.

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

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

mathew

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

You're welcome.