Screen API#
Name |
Specification |
Description |
---|---|---|
screenshots |
` ARRAY OBJECT_PATH` property (read) |
Get the list of screenshots on the device. |
screenshotAdded |
signal
- (out)
|
Signal sent when a screenshot is added. |
screenshotRemoved |
signal
- (out)
|
Signal sent when a screenshot is removed. |
screenshotModified |
signal
- (out)
|
Signal sent when a screenshot is modified. |
addScreenshot |
method
- (in) blob
|
Add a screenshot taken by an application. |
drawFullScreenImage |
method
- (in) path
|
Draw an image to the screen. |
screenshot |
method
- (out)
|
Take a screenshot. |
Example Usage#
#include <liboxide.h>
#include "dbusservice_interface.h"
#include "screenapi_interface.h"
using namespace codes::eeems::oxide1;
int main(int argc, char* argv[]){
Q_UNUSED(argc);
Q_UNUSED(argv);
auto bus = QDBusConnection::systemBus();
General api(OXIDE_SERVICE, OXIDE_SERVICE_PATH, bus);
qDebug() << "Requesting screen API...";
QDBusObjectPath path = api.requestAPI("screen");
if(path.path() == "/"){
qDebug() << "Unable to get screen API";
return EXIT_FAILURE;
}
qDebug() << "Got the screen API!";
Screen screen(OXIDE_SERVICE, path.path(), bus);
path = screen.screenshot();
if(path.path() == "/"){
qDebug() << "Screenshot failed";
}else{
qDebug() << "Screenshot taken";
}
return EXIT_SUCCESS;
}
#!/bin/bash
echo -n "Screenshot "
if [ $(rot screen call screenshot | jq -cr) = "/" ]; then
echo "failed"
else
echo "taken"
fi
Screenshot#
Name |
Specification |
Description |
---|---|---|
blob |
|
The blob data of the screenshot. |
path |
|
The path to the screenshot on disk. |
modified |
signal |
Signal sent when the screenshot is modified. |
removed |
signal |
Signal sent when the screenshot is removed. |
remove |
method |
Remove the screenshot from the device. |
Example Usage#
#include <liboxide.h>
#include "dbusservice_interface.h"
#include "screenapi_interface.h"
#include "screenshot_interface.h"
using namespace codes::eeems::oxide1;
int main(int argc, char* argv[]){
Q_UNUSED(argc);
Q_UNUSED(argv);
auto bus = QDBusConnection::systemBus();
General api(OXIDE_SERVICE, OXIDE_SERVICE_PATH, bus);
qDebug() << "Requesting screen API...";
QDBusObjectPath path = api.requestAPI("screen");
if(path.path() == "/"){
qDebug() << "Unable to get screen API";
return EXIT_FAILURE;
}
qDebug() << "Got the screen API!";
Screen screen(OXIDE_SERVICE, path.path(), bus);
for(auto path : screen.screenshots()){
Screenshot(OXIDE_SERVICE, path.path(), bus).remove().waitForFinished();
}
qDebug() << "Screenshots removed";
return EXIT_SUCCESS;
}
#!/bin/bash
rot screen get screenshots \
| jq -cr 'values | join("\n")' \
| sed 's|/codes/eeems/oxide1/||' \
| xargs -rI {} rot --object Screenshot:{} screen call remove
echo "Screenshots removed"