There’s no way.
The HTML, CSS and Javascript of any website are executed in a type of sandbox which the browser creates for each "tab". If the browser itself, as an application, already prevents Javascript, for example, to perform actions that exceed the scope of the tab to which the script is being performed, manipulations involving the operating system are much above the Javascript "permissions loop" run by the websites.
In other words, the restriction level is much higher than Javascript can perform. Screen capture is not an application feature (like the browser), but an operating system feature.
The commando that you mentioned is an API provided by operating system Android for which applications manipulate the screenshot. The browser, as an application, could access this API, but Javascript, which runs within browser does not have "permission" to access it.
It would be a huge security flaw to allow Javascript to access this type of API relatively more low-level of the operating system.
If you’re talking about Node.js or Deno, that’s another story (but that’s not the case).