Apps API#
Name |
Specification |
Description |
---|---|---|
startupApplication |
|
The default application to display after the user has logged in. Also known as the launcher. |
lockscreenApplication |
|
The lock screen application in use. |
applications |
property (read) |
The list of all the applications registered with tarnish. |
previousApplications |
|
List of previous
applications that
have been opened.
This list drives the
|
currentApplication |
|
The currently running foreground application. |
runningApplications |
|
The list of currently running applications. The includes all the running background, and paused foreground applications. |
pausedApplications |
|
The list of paused foreground applications. |
applicationRegistered |
signal
|
Signal sent when a new application is registered with tarnish. |
applicationLaunched |
signal
|
Signal sent when an application has been launched. |
applicationUnregistered |
signal
|
Signal sent when an application has been removed from tarnish. |
applicationPaused |
signal
|
Signal sent when an application has been paused. |
applicationResumed |
signal
|
Signal sent when an application has been resumed. |
applicationExited |
signal
|
Signal sent when an application has exited. The second output parameter contains the exit code. |
openDefaultApplication |
method |
Launch or resume the application defined by `` startupApplication`` |
openTaskManager |
method |
Launch or resume the process manager. |
openLockScreen |
method |
Launch or resume the
application defined
by
|
registerApplication |
method
|
Register a new application with tarnish. |
unregisterApplication |
method
|
Remove an application from tarnish. |
reload |
method |
Reload applications registered with tarnish from disk. |
getApplicationPath |
method
|
Returns the D-Bus
path for an
application based on
it’s name.
Will return |
previousApplication |
method
|
Launch or resume the
previous application
from
|
Example Usage#
#include <liboxide/dbus.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 apps API...";
QDBusObjectPath path = api.requestAPI("apps");
if(path.path() == "/"){
qDebug() << "Unable to get apps API";
return EXIT_FAILURE;
}
qDebug() << "Got the apps API!";
Apps appsApi(OXIDE_SERVICE, path.path(), bus);
qDebug() << "Available applications" << appsApi.applications().keys();
qDebug() << "Running applications" << appsApi.runningApplications().keys();
return EXIT_SUCCESS;
}
#!/bin/bash
echo "Available applications"
rot apps get applications | jq 'keys'
echo "Running applications"
rot apps get runningApplications | jq 'keys'
Application Object#
Name |
Specification |
Description |
---|---|---|
name |
|
Unique name used to reference the application. |
processId |
|
Process Id of the
application if it’s
running.
Will return |
permissions |
|
List of permissions that the process has. |
displayName |
|
Name for the application to display to the user. |
description |
|
Description of the application. |
bin |
|
Path to the binary file used to launch the application. |
onPause |
|
Simple script to run when pausing the application. |
onResume |
|
Simple script to run when resuming the application. |
onStop |
|
Simple script to run when stopping the application. |
autoStart |
|
If this application should be automatically started when tarnish starts up. |
type |
|
Type of application.
- |
state |
|
Current state of the
application.
- |
systemApp |
|
If this application is a system app or not. |
hidden |
|
If this application should be hidden from the user on any UI. |
icon |
|
Path to the icon used to represent this application. |
environment |
|
Map of environment variables to set for the process. |
workingDirectory |
|
Directory to set as the current working directory for the application. |
user |
|
User the application will be run as. |
group |
|
Group the application will be run as. |
launched |
signal |
Signal sent when the application starts. |
paused |
signal |
Signal sent when the application is paused. |
resumed |
signal |
Signal sent when the application is resumed. |
unregistered |
signal |
Signal sent when the application is removed from tarnish. |
exited |
signal
|
Signal sent when the application exits. First signal parameter is the exit code of the application. |
permissionsChanged |
signal
|
Signal sent when the permissions of the application changes. |
displayNameChanged |
signal
|
Signal sent when the displayName of the application changes. |
onPauseChanged |
signal
|
Signal sent when the onPause of the application changes. |
onResumeChanged |
signal
|
Signal sent when the onResume of the application changes. |
onStopChanged |
signal
- (out) |
Signal sent when the onStop of the application changes. |
autoStartChanged |
signal
|
Signal sent when autoStart for the application chagnes. |
iconChanged |
signal
|
Signal sent when the icon of the application changes. |
environmentChanged |
signal
|
Signal sent when the environment of the application changes. |
wor kingDirectoryChanged |
signal
|
Signal sent when the working directory of the application changes. |
directoriesChanged |
signal
|
Signal sent when the directories of the application changes. |
launch |
method |
Launch or resume the application. |
pause |
method |
Pause the application. If the application is backgroundable it will be moved into the background. |
resume |
method |
Resume an application. If the application is backgroundable and in the background it will be moved into the foreground. |
stop |
method |
Stop the application. |
unregister |
method |
Remove the application from tarnish. |
setEnvironment |
method
|
Change the environment of the application. Changes will be applied after the application restarts. |
Example Usage#
#include <liboxide/dbus.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 apps API...";
QDBusObjectPath path = api.requestAPI("apps");
if(path.path() == "/"){
qDebug() << "Unable to get apps API";
return EXIT_FAILURE;
}
qDebug() << "Got the apps API!";
Apps appsApi(OXIDE_SERVICE, path.path(), bus);
path = appsApi.currentApplication();
Application app(OXIDE_SERVICE, path.path(), bus);
qDebug() << "Current application:" << app.displayName();
QString name("test");
qDebug() << "Removing application: " << name;
path = appsApi.getApplicationPath(name);
if(path.path() == "/"){
qDebug() << "Failed to find application: " << name;
return EXIT_FAILURE;
}
if(!appsApi.unregisterApplication(path)){
qDebug() << "Failed to unregister application: " << name;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
#!/bin/bash
echo -n "Current application: "
rot apps get currentApplication \
| jq -cr | sed 's|/codes/eeems/oxide1/||' \
| xargs -I {} rot --object Application:{} apps get displayName \
| jq -cr
name="test"
echo "Removing Application: $name"
rot apps call getApplicationPath "QString:\"$name\"" \
| jq -cr | sed 's|/codes/eeems/oxide1/||' \
| xargs -I {} rot --object Application:{} apps call unregister