Skip to content

Instantly share code, notes, and snippets.

@Jayy001
Created January 6, 2025 14:36
Show Gist options
  • Select an option

  • Save Jayy001/894e52e61aff08ea713caa46ae06eb0b to your computer and use it in GitHub Desktop.

Select an option

Save Jayy001/894e52e61aff08ea713caa46ae06eb0b to your computer and use it in GitHub Desktop.
QML App/Command Launcher

Installation

  1. Download and run install.sh from here to install xovi
  2. Change directory into /home/root/xovi and run rebuild_hashtable
  3. Create launcher.qmd in /home/root/xovi/exthome/qt-resource-rebuilder and edit the jsonFileUrl, defaultExec params if needed
  4. Create apps.json in /home/root/xovi/ (or wherever you changed it to)
{
  "items": [
    { "title": "Minesweeper", "args": "mines", "icon": "tablet", "exec": "/home/root/xovi/run_app" }
    ....
  ]
}
  1. Run xovi/_start

JSON Structure

Reads from items list, if not given:

  • title defaults to untitled
  • icon defaults to storage
  • exec defaults to /home/root/xovi/run_app
  • args defaults to []

Args can either be a singular string item, or list of strings.

Caveats

  • Full screen only (for now)
  • App is ran in seperate thread, as xochitl is required to be running for it to work
  • No way to exit app unless the app has an exit option
  • No shell environment, so shebang must be used if referencing a script
Hashtab generated in 3.16
AFFECT [[4911547370760691430]]
IMPORT net.asivery.CommandExecutor 1.0
TRAVERSE [[3819512207256720568]] > [[14125623155555875541]]
LOCATE BEFORE [[8397788359424131273]]
INSERT {
CommandExecutor {
~&5972374&~: cmdExecutor
}
~&6502786168&~ {
~&7081629735527&~.~&7797818826744279624&~: ~&7083038346995&~.~&214646099849&~
~&7082729686082&~: 2
~&254501108490678590&~ {
~&233721384511543&~.~&6503816592&~: ~&7083038346995&~
~&214622605608&~: ~&7082020628281&~.~&8399340017235344933&~
}
}
~&7712155293725601&~ {
~&5972374&~: ~&6504391364&~
~&214634455770&~: ~&254492861152542582&~ {} /* Ensure the model is initialized as a ListModel
*/
~&16385778650434842232&~ {
property ~&197102514&~ appData: ~&214634455770&~
~&214642559243&~: ~&6504222003&~(appData.~&214642559243&~ || "Untitled")
~&8399601734642709923&~: ~&"1981241021903572048&~ + (appData.~&6503917970&~ || ~&"233744880322142&~)
~&7082453764421&~: ~&214625660372&~
~&254542236275632405&~: {
~&7082453764421&~ = ~&6504329801&~;
~&7083211098251&~();
cmdExecutor.executeCommand((appData.exec || "/home/root/xovi/run_app"), (appData.~&6503646550&~ || []));
~&7082453764421&~ = ~&214625660372&~;
}
~&7081629735527&~.preferredHeight: ~&7082020628281&~.~&15061686673205541622&~
~&7081629735527&~.~&7797818826744279624&~: ~&7083038346995&~.~&214646099849&~
~&11921478716705041271&~: ~&233744436321411&~
}
}
~&6502786168&~ {
~&7081629735527&~.~&7797818826744279624&~: ~&7083038346995&~.~&214646099849&~
~&7082729686082&~: 2
~&254501108490678590&~ {
~&233721384511543&~.~&6503816592&~: ~&7083038346995&~
~&214622605608&~: ~&7082020628281&~.~&8399340017235344933&~
}
}
property ~&7083178290016&~ jsonFileUrl: "file:///home/root/xovi/apps.json"
function loadJson() {
~&197102514&~ xhr = new XMLHttpRequest();
xhr.~&6504147419&~("GET", jsonFileUrl, ~&6504329801&~); /* Open the file asynchronously
*/
xhr.onreadystatechange = function () {
~&5972376&~ (xhr.readyState === XMLHttpRequest.DONE && xhr.~&7083177691309&~ === 200) {
~&197102514&~ ~&6503736259&~ = ~&6502785411&~.~&214637526116&~(xhr.responseText.~&7713616118928163&~());
~&6504391364&~.~&214634455770&~.~&214622489712&~(); /* Clear existing model data
*/
~&197085552&~ (~&197102514&~ ~&180978&~ = 0; ~&180978&~ < ~&6503736259&~.~&214629893131&~.~&7082886407723&~; ~&180978&~++) {
~&6504391364&~.~&214634455770&~.~&7082469033025&~(~&6503736259&~.~&214629893131&~[~&180978&~]);
}
~&233724020023100&~.~&197092075&~(~&6504391364&~.~&214634455770&~);
}
};
xhr.~&6504279475&~();
}
~&254480451320573660&~.~&495334332051582499&~: {
loadJson();
}
}
END TRAVERSE
END AFFECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment