extension.js:
Код: Выделить всё
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
import * as Screenshot from 'resource:///org/gnome/shell/ui/screenshot.js';
import Shell from 'gi://Shell';
export default class ExampleExtension extends Extension {
async enable() {
const shooter = new Shell.Screenshot();
const [content] = await shooter.screenshot_stage_to_content();
const texture = content.get_texture();
await Screenshot.captureScreenshot(texture, null, 1, null);
}
disable() {
}
}

Как сделать скриншот тихо, без всплывающих окон и звуков? Как это делается, например, когда внешнее приложение делает снимок экрана через API dbus https://gitlab.gnome.org/GNOME/xdg-desk ... /org.gnome .Shell.Screenshot.xml#L46. В этом случае скриншот просто спокойно добавляется на диск и всё.
Ubuntu 24.04, GNOME 46, wayland>
Подробнее здесь: https://stackoverflow.com/questions/785 ... -extension