Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,33 @@ The skill can be configured to map spoken phrases to scripts or commands in the

3. **Validation**:
- Avoid configuring dangerous commands like `rm -rf` without additional safeguards.


## Note for using the skill in Docker containers:

All commands run exclusively within the Docker container. If the commands/scripts are also supposed to have an effect outside the container, additional solutions are required. Here is an example for steering kodi (outsight the container) with ovos-skill-cmd:

```json
{
"alias": {
"kodi restart": "echo \"systemctl restart kodi\" > /home/ovos/.config/mycroft/joespipe",
"kodi mute": "echo \"kodi-send --action=\\\"Mute\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi unmute": "echo \"kodi-send --action=\\\"Mute\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi louder": "echo \"kodi-send --action=\\\"VolumeUp\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi lower": "echo \"kodi-send --action=\\\"VolumeDown\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi pause": "echo \"kodi-send --action=\\\"PlayerControl(Play)\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi resume": "echo \"kodi-send --action=\\\"PlayerControl(Play)\\\"\" > /home/ovos/.config/mycroft/joespipe",
"kodi stop": "echo \"kodi-send --action=\\\"PlayerControl(Stop)\\\"\" > /home/ovos/.config/mycroft/joespipe"
},
"shell": true,
"__mycroft_skill_firstrun": false
}
```

"/home/ovos/.config/mycroft/joespipe" is a named pipe placed in the shared volume of the ovos config folder. Outside of the container is a mini script watching for commands in the pipe:

```json
#!/bin/bash
while true; do eval "$(cat /storage/ovos/config/joespipe)"; done
```
A description for the named pipe solution you can find [here](https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container)
2 changes: 1 addition & 1 deletion locale/de-de/running.dialog
Original file line number Diff line number Diff line change
@@ -1 +1 @@
führe {Alias} (Befehl|Skript) aus
führe {alias} (Befehl|Skript) aus