Ask / Submit

[question] How to start qml file from CLI ?

asked 2016-01-18 21:27:31 +0300

Schturman gravatar image

updated 2016-01-19 07:25:42 +0300

Hi to all.
Someone know how to start QML file from CLI or from .desktop file ?
From googling I found that somehow can be started by sailfish-qml (needed package libsailfishapp-launcher)
But when I tried I got weird output:

[nemo@Jolla Vault]$ sailfish-qml /usr/lib/qt5/qml/Sailfish/Vault/MainPage.qml
[D] QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration:62 - Using Wayland-EGL
[D] MDesktopEntryPrivate::MDesktopEntryPrivate:230 - Specified Desktop file does not exist "/usr/share/applications//usr/lib/qt5/qml/Sailfish/Vault/MainPage.qml.desktop"
[W] unknown:-1 - file:///usr/share/usr/lib/qt5/qml/Sailfish/Vault/MainPage.qml/qml/usr/lib/qt5/qml/Sailfish/Vault/MainPage.qml.qml: File not found

For example I want to directly open "Backup" from Settings app (/usr/lib/qt5/qml/Sailfish/Vault/MainPage.qml)

Any ideas ?

edit retag flag offensive close delete


No idea what the page is called in settings but I guess you want to do a dbus call for the settings-vault page. And in addition, vault comes as CLI tool.

chemist ( 2016-01-18 21:57:48 +0300 )edit

Can you explain how to start a full backup like we do in the jolla-settings, but in CLI ?
Maybe I will just create a simple script to create backup every few days...

Schturman ( 2016-01-18 23:34:15 +0300 )edit

2 Answers

Sort by » oldest newest most voted

answered 2016-01-18 22:24:41 +0300

kimmoli gravatar image

updated 2016-01-18 22:25:37 +0300

The sailfish-qml thing executes the qml by app-name, and not a single specific qml file.

as the usage says:

Usage: sailfish-qml <appname>

And letting dbus-monitor be your friend;

dbus-send --type=method_call --dest=org.nemomobile.lipstick /LauncherModel org.nemomobile.lipstick.LauncherModel.notifyLaunching string:"jolla-settings.desktop"
dbus-send --type=method_call --dest=com.jolla.settings /com/jolla/settings/ui com.jolla.settings.ui.showPage string:"system_settings/system/developer_mode"

(find out the correct path for Vault)

edit flag offensive delete publish link more


Cool thanks. Probably this is what I wanted. But it still can't open Backup page... I changed path to system_settings/system/backup (from backup.json):

dbus-send --type=method_call --dest=com.jolla.settings /com/jolla/settings/ui com.jolla.settings.ui.showPage string:"system_settings/system/backup"

It start cover with Settings icon and circle in the middle and after few seconds it's disappeared...
After 4-5 attempts it finally starts Backup page. After this again the same story...
If jolla-settings already opened, this command working without any problem, also dev mode. Same with first dbus command of jolla-settings.desktop :(

Schturman ( 2016-01-18 23:30:32 +0300 )edit

Works for me, first the notifyLaunching, then few secs of waiting, then the showPage Maybe there is some reply (etc) from the first call, dunno.

i used dbus-monitor and lauched quick-action from eventsview-pulldown to get those. maybe i missed something...

kimmoli ( 2016-01-18 23:36:56 +0300 )edit

Found a way to start it in one-line command:

sh -c "xdg-open /usr/share/applications/jolla-settings.desktop &" && sleep 1 &&  dbus-send --type=method_call --dest=com.jolla.settings /com/jolla/settings/ui com.jolla.settings.ui.showPage string:"system_settings/system/backup"

Now it always working for me....And yes it need a few seconds of sleep to start a second command...
Also tried like this:

dbus-send --type=method_call --dest=org.nemomobile.lipstick /LauncherModel org.nemomobile.lipstick.LauncherModel.notifyLaunching string:"jolla-settings.desktop" && sleep 2 && dbus-send --type=method_call --dest=com.jolla.settings /com/jolla/settings/ui com.jolla.settings.ui.showPage string:"system_settings/system/backup"

And sometimes it working too.
Thanks anyway :)

Schturman ( 2016-01-18 23:55:37 +0300 )edit

nice hint, thanks @kimmoli !

ced117 ( 2016-01-19 11:57:49 +0300 )edit

This way it working even better, open immediately on the Backup page :)

sh -c "/usr/bin/jolla-settings -prestart &" && sleep 1 && dbus-send --type=method_call --dest=com.jolla.settings /com/jolla/settings/ui com.jolla.settings.ui.showPage string:"system_settings/system/backup"

Schturman ( 2016-01-19 12:36:32 +0300 )edit

answered 2016-01-19 01:30:43 +0300

chemist gravatar image

updated 2016-01-19 01:49:17 +0300

As privileged (devel-su -p) vault --help is your friend but as I had a hard time myself... some help here of a not really working script :D but it is a start

--unit is from ~/.vault/.unit/ just remove path and .json - multiple write like Accounts,People

vault -a export -V /home/nemo/.vault -H /home/nemo -M People -c .vault/.vault -g .vault/.git/config -t $(date -d "today" +"%Y%m%d%H%M")

don't ask me what the --data is, maybe @dez can help with a full story command-line (it is probably the .git dir I don't know really)

edit flag offensive delete publish link more


--help not say me nothing about how to use, just show options...
I can add a few units to this command ? For example People,Acconts etc or I need run this command separately for each unit?
And how at the end system create Backup.tar file ? What it include exactly?

Schturman ( 2016-01-19 09:31:36 +0300 )edit

@schturman I provided everything but the Backup.tar and --data, your first question is answered in the 2nd paragraph (multiple write like Accounts,People) - Backup.tar can be basic as tar'ing .vault - as I do not know how it really works and a test did not populate the .git directory, we need to wait for @lbt or @dez to enlighten us. The command I pasted above does a backup but not with proper git tree and stuff though.

chemist ( 2016-01-19 10:46:56 +0300 )edit

@chemist, thanks for answer :)

Schturman ( 2016-01-19 13:27:06 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2016-01-18 21:27:31 +0300

Seen: 470 times

Last updated: Jan 19 '16