Create your own shell commands to execute on your mirror.
⚠️ Security Warning: Custom commands execute shell commands on your system. Only add commands you trust.
These commands override the default system commands:
config: {
customCommand: {
shutdownCommand: 'sudo shutdown -h now',
rebootCommand: 'sudo reboot',
monitorOnCommand: 'vcgencmd display_power 1',
monitorOffCommand: 'vcgencmd display_power 0',
monitorStatusCommand: 'vcgencmd display_power -1',
},
},| Command | Description |
|---|---|
shutdownCommand |
Shutdown the system |
rebootCommand |
Reboot the system |
monitorOnCommand |
Turn the display on |
monitorOffCommand |
Turn the display off |
monitorStatusCommand |
Check display status (must return "true" or "false") |
For detailed monitor control options (Wayland, X11, CEC, etc.), see Monitor Control.
Since v2.3.0, you can define custom commands that can be triggered via the API:
config: {
customCommand: {
myCustomCommand: 'echo "Hello World"',
takeScreenshot: 'scrot /tmp/screenshot.png',
},
},Then call via API:
curl http://your-mirror:8080/api/command/myCustomCommandcustomCommand: {
shutdownCommand: 'systemctl poweroff',
rebootCommand: 'systemctl reboot',
}customCommand: {
restartCommand: 'sudo systemctl restart magicmirror',
}