We have moved to a new Sailfish OS Forum. Please start new discussions there.

# [question] How to start qml file from CLI ?

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 ? Thanks edit retag close delete ## Comments 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. ( 2016-01-18 21:57:48 +0200 )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... Thanks ( 2016-01-18 23:34:15 +0200 )edit ## 2 Answers Sort by » oldest newest most voted answered 2016-01-18 22:24:41 +0200 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) more ## Comments 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... Weird... If jolla-settings already opened, this command working without any problem, also dev mode. Same with first dbus command of jolla-settings.desktop :( ( 2016-01-18 23:30:32 +0200 )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... ( 2016-01-18 23:36:56 +0200 )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 :) ( 2016-01-18 23:55:37 +0200 )edit nice hint, thanks @kimmoli ! ( 2016-01-19 11:57:49 +0200 )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"  ( 2016-01-19 12:36:32 +0200 )edit answered 2016-01-19 01:30:43 +0200 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)

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?
Thanks

( 2016-01-19 09:31:36 +0200 )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.

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