media/ — play_pause, next, prev, stop via user32!keybd_event (VK_MEDIA_*
0xB0..0xB3). Helper _media_helper.ps1 mirrors the volume/ pack pattern,
so the same C# P/Invoke style works for the four standard media keys
without needing any external tooling. Catches Spotify, foobar, browsers,
Yandex Music PWA — anything that responds to system media keys.
sysinfo/ — battery / time / cpu / ram / disk and an "all" combo.
_sysinfo.ps1 uses CIM queries (Win32_Battery, Win32_OperatingSystem,
Win32_LogicalDisk, Win32_Processor + Win32_PerfFormattedData_PerfOS_
Processor) — no external deps. Time is rendered in ru-RU culture
("01:17, 15 мая, пятница"). Battery falls back to a friendly "no
battery, looks like a desktop" when Win32_Battery is empty. SystemDrive
env var resolves the right disk on non-C:/ installs.
Each sysinfo command notifies the line as a Windows toast and logs it.
Triggered locally: sysinfo_all currently reports:
Сейчас: 01:17, 15 мая, пятница
Батарея не обнаружена (видимо, десктоп)
CPU: AMD Ryzen 7 5700X3D 8-Core Processor, загрузка 4%
RAM: 23.4 из 47.9 ГБ (49% занято)
Диск C:: свободно 118.2 из 1906.8 ГБ
Total command packs is now 9 (verified via jarvis-gui startup log).
Portability: all PowerShell helpers use $env:SystemDrive and CIM
classes that ship with every Windows install; Lua wrappers resolve
the helper path via jarvis.context.command_path (no hardcoded user
profile paths or absolute C:\ refs).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13 lines
538 B
Lua
13 lines
538 B
Lua
local helper = jarvis.context.command_path .. "\\_sysinfo.ps1"
|
|
local cmd = string.format('powershell -NoProfile -ExecutionPolicy Bypass -File "%s" -Topic battery', helper)
|
|
local res = jarvis.system.exec(cmd)
|
|
local text = (res.stdout or ""):gsub("[\r\n]+$", "")
|
|
if res.success and text ~= "" then
|
|
jarvis.system.notify("Батарея", text)
|
|
jarvis.log("info", text)
|
|
jarvis.audio.play_ok()
|
|
else
|
|
jarvis.log("error", "battery info failed: " .. tostring(res.stderr))
|
|
jarvis.audio.play_error()
|
|
end
|
|
return { chain = false }
|