Add callbacks support for all media actions
- Add CallbackConfig model for callback scripts - Add callbacks section to config for optional command execution - Add turn_on/turn_off/toggle endpoints (callback-only) - Add callbacks for all media actions (play, pause, stop, next, previous, volume, mute, seek) - Update README with callbacks documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,4 +44,64 @@ scripts:
|
||||
label: "Restart"
|
||||
description: "Restart the PC immediately"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
# Callback scripts (executed after media actions)
|
||||
# All callbacks are optional - if not defined, the action runs without callback
|
||||
callbacks:
|
||||
# Media control callbacks (run after successful action)
|
||||
on_play:
|
||||
command: "echo Play triggered"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_pause:
|
||||
command: "echo Pause triggered"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_stop:
|
||||
command: "echo Stop triggered"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_next:
|
||||
command: "echo Next track"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_previous:
|
||||
command: "echo Previous track"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_volume:
|
||||
command: "echo Volume changed"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_mute:
|
||||
command: "echo Mute toggled"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_seek:
|
||||
command: "echo Seek triggered"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
# Turn on/off/toggle (callback-only actions, no default behavior)
|
||||
on_turn_on:
|
||||
command: "echo Turn on callback"
|
||||
timeout: 10
|
||||
shell: true
|
||||
|
||||
on_turn_off:
|
||||
command: "rundll32.exe user32.dll,LockWorkStation"
|
||||
timeout: 5
|
||||
shell: true
|
||||
|
||||
on_toggle:
|
||||
command: "echo Toggle callback"
|
||||
timeout: 10
|
||||
shell: true
|
||||
Reference in New Issue
Block a user