feat(commands): add PC control packs — volume, apps, file_search, output_device
All four packs are pure Lua (sandbox=full) and call out to PowerShell helpers
where COM / native APIs are needed. No new Rust code, no rebuild required:
post_build.py --sync copies them under target/{debug,release}/resources/.
volume/
- volume_up / volume_down: 5x VK_VOLUME_UP|DOWN via keybd_event
- volume_mute: VK_VOLUME_MUTE
- volume_max: 50x VK_VOLUME_UP (system clamps)
Helper _volume_helper.ps1 P/Invokes user32!keybd_event.
apps/
- open_browser : start "" https://www.google.com (uses system default browser)
- open_notepad : notepad.exe
- open_calculator: calc.exe
- open_explorer : explorer.exe
- open_terminal : wt.exe, falls back to powershell.exe
- open_settings : ms-settings: protocol
- open_task_manager: taskmgr.exe
- lock_screen : rundll32 user32.dll,LockWorkStation
- screenshot : System.Drawing capture to ~/Pictures/jarvis_screenshot_*.png
file_search/
- find file <query> : recursive Get-ChildItem in Desktop/Documents/Downloads
(depth 3, top 5 matches). Strips Russian/English/Ukrainian trigger
prefixes from the recognized phrase, then opens explorer /select on the
first hit and notifies with the total count.
output_device/
- list_output_devices : enumerates active render endpoints via
IMMDeviceEnumerator and notifies friendly names with indices
- next_output_device : cycles the system default render device via the
undocumented IPolicyConfig::SetDefaultEndpoint (eConsole/Multimedia/
Communications). Tested locally — listed 7 devices, current correctly
identified at index 5.
This commit is contained in:
parent
16240609de
commit
9c25108356
22 changed files with 932 additions and 0 deletions
55
resources/commands/output_device/command.toml
Normal file
55
resources/commands/output_device/command.toml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
[[commands]]
|
||||
id = "list_output_devices"
|
||||
type = "lua"
|
||||
script = "list_devices.lua"
|
||||
sandbox = "full"
|
||||
timeout = 8000
|
||||
|
||||
[commands.phrases]
|
||||
ru = [
|
||||
"какие устройства вывода",
|
||||
"покажи устройства",
|
||||
"список устройств",
|
||||
"какие наушники",
|
||||
"какие колонки",
|
||||
]
|
||||
en = [
|
||||
"list output devices",
|
||||
"show audio devices",
|
||||
"list speakers",
|
||||
"what audio devices",
|
||||
]
|
||||
ua = [
|
||||
"які пристрої виводу",
|
||||
"покажи пристрої",
|
||||
"список пристроїв",
|
||||
]
|
||||
|
||||
|
||||
[[commands]]
|
||||
id = "next_output_device"
|
||||
type = "lua"
|
||||
script = "next_device.lua"
|
||||
sandbox = "full"
|
||||
timeout = 8000
|
||||
|
||||
[commands.phrases]
|
||||
ru = [
|
||||
"переключи устройство",
|
||||
"переключи звук",
|
||||
"следующее устройство",
|
||||
"смени вывод",
|
||||
"переключи на наушники",
|
||||
"переключи на колонки",
|
||||
]
|
||||
en = [
|
||||
"switch audio device",
|
||||
"next audio device",
|
||||
"switch output",
|
||||
"switch speakers",
|
||||
]
|
||||
ua = [
|
||||
"перемкни пристрій",
|
||||
"перемкни звук",
|
||||
"наступний пристрій",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue