~ci-train-bot/miral/miral-ubuntu-zesty-2641

« back to all changes in this revision

Viewing changes to getting_and_using_miral.md

  • Committer: Bileto Bot
  • Date: 2017-02-15 14:05:17 UTC
  • mfrom: (352.1.3 miral)
  • Revision ID: ci-train-bot@canonical.com-20170215140517-3h16hkkwog2nl0au
* New upstream release 1.2.0 (https://launchpad.net/miral/+milestone/1.2)
  - ABI summary:
    . miral ABI unchanged at 2
  - Enhancements:
    . New libmirclientcpp-dev package "C++ wrapper for libmirclient". (Split
      from libmiral-dev)
    . Give miral-app and miral-desktop a good default for -bindir
    . More surface to window renaming to reflect Mir name changes
    . Refresh the "Building and Using MirAL" doc
  - Bugs fixed:
    . Chrome-less shell hint does not work any more (LP: #1658117)
    . WindowSpec::set_state() wrapper for mir_window_spec_set_state()
      (LP: #1661256)
    . "$ miral-app -kiosk" fails with "Unknown command line options: 
      --desktop_file_hint=miral-shell.desktop" (LP: #1660933)
    . libmiral] Fix focus and movement rules for Input Method and Satellite
       windows. (LP: #1660691)
    

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Building and using MirAL  {#building_and_using_miral}
2
 
========================
 
1
Getting and Using MirAL  {#getting_and_using_miral}
 
2
=======================
 
3
 
 
4
Getting MirAL
 
5
-------------
 
6
 
 
7
Depending upon your needs you can:
 
8
 
 
9
1. Install and use the MirAL examples [Using MirAL examples];
 
10
2. Use MirAL to develop your own Mir server [Using MirAL for development]; or,
 
11
3. Build MirAL yourself [Building MirAL]. 
 
12
 
 
13
Using MirAL examples
 
14
--------------------
 
15
 
 
16
You can install the MirAL examples as follows:
 
17
 
 
18
    $ sudo apt install libmiral-examples
 
19
    $ sudo apt install mir-graphics-drivers-desktop qtubuntu-desktop
 
20
 
 
21
For convenient testing there's a "miral-app" script that wraps the commands used
 
22
in the last section to start the server and then launches the gnome-terminal (as
 
23
the current user):
 
24
 
 
25
    $ miral-app
 
26
 
 
27
To run independently of X11 you need to grant access to the graphics hardware
 
28
(by running as root) and specify a VT to run in. There's a "miral-desktop"
 
29
script that wraps to start the server (as root) and then launch gnome-terminal
 
30
(as the current user):
 
31
 
 
32
    $ miral-desktop
 
33
    
 
34
For more options see [Options when running the MirAL example shell] below.
 
35
    
 
36
### Running applications on MirAL
 
37
 
 
38
If you use the command-line launched by miral-app or miral-desktop native Mir
 
39
applications (which include native Mir clients and those that use SDL or the 
 
40
GTK+, Qt toolkits) can be started as usual:
 
41
 
 
42
    $ sudo apt install mir-demos kate neverball 
 
43
    $ mir_demo_client_egltriangle
 
44
    $ gedit
 
45
    $ kate
 
46
    $ neverball
 
47
 
 
48
From outside the MirAL session GTK+, Qt and SDL applications can still be run
 
49
using the miral-run script:
 
50
 
 
51
    $ miral-run gedit
 
52
    $ miral-run 7kaa
 
53
 
 
54
### Running for X11 applications
 
55
 
 
56
If you want to run X11 applications that do not have native Mir support in the
 
57
toolkit they use then the answer is Xmir: an X11 server that runs on Mir. First
 
58
you need Xmir installed:
 
59
 
 
60
    $ sudo apt install xmir
 
61
 
 
62
Then once you have started a miral shell (as above) you can use miral-xrun to
 
63
run applications under Xmir:
 
64
 
 
65
    $ miral-xrun firefox
 
66
 
 
67
This automatically starts a Xmir X11 server on a new $DISPLAY for the
 
68
application to use. You can use miral-xrun both from a command-line outside the
 
69
miral-shell or, for example, from the terminal running in the shell.
 
70
 
 
71
### Options when running the MirAL example shell
 
72
 
 
73
#### Script Options
 
74
 
 
75
Both the "miral-app" and "miral-desktop" scripts provide options for using an
 
76
alternative example shell (miral-kiosk) and an alternative to gnome-terminal.
 
77
 
 
78
    -kiosk               use miral-kiosk instead of miral-shell
 
79
    -launcher <launcher> use <launcher> instead of 
 
80
                         'gnome-terminal --app-id com.canonical.miral.Terminal'
 
81
 
 
82
In addition miral-desktop has the option to set the VT that is used:
 
83
 
 
84
    -vt       <termid>   set the virtual terminal [4]
 
85
 
 
86
There are some additional options (listed with "-h") but those are the important
 
87
ones.
 
88
 
 
89
#### MirAL Options
 
90
 
 
91
The scripts can also be used to pass options to MirAL: they pass everything on
 
92
the command-line following the first thing they don't understand. These can be
 
93
listed by `miral-shell --help`. Most of these options are inherited from Mir,
 
94
but the following MirAL specific are likely to be of interest:
 
95
 
 
96
    --window-management-trace           log trace message
 
97
 
 
98
Probably the main use for MirAL is to test window-management (either of a
 
99
toolkit or of a server) and this logs all calls to and from the window 
 
100
management policy. This option is supported directly in the MirAL library and
 
101
works for any MirAL based shell - even one you write yourself.
 
102
 
 
103
    --keymap arg (=us)                  keymap <layout>[+<variant>[+<options>]]
 
104
                                        , e,g, "gb" or "cz+qwerty" or 
 
105
                                        "de++compose:caps"
 
106
 
 
107
For those of us not in the USA this is very useful. Both the -shell and -kiosk
 
108
examples support this option.
 
109
 
 
110
    --window-manager arg (=titlebar)   window management strategy 
 
111
                                       [{titlebar|tiling|system-compositor}]
 
112
 
 
113
Is only supported by miral-shell and its main use is to allow an alternative
 
114
"tiling" window manager to be selected.
 
115
 
 
116
Using MirAL for development
 
117
---------------------------
 
118
 
 
119
Install the headers and libraries for using libmiral in development:
 
120
 
 
121
    $ sudo apt install libmiral-dev
 
122
 
 
123
A `miral.pc` file is provided for use with `pkg-config` or other tools. For
 
124
example: `pkg-config --cflags miral`
 
125
 
 
126
The MirAL documentation can be installed and read like this:
 
127
 
 
128
    $ sudo apt install miral-doc
 
129
    $ xdg-open /usr/share/doc/miral-doc/html/index.html
 
130
 
 
131
Building MirAL
 
132
--------------
3
133
 
4
134
These instructions assume that you’re using Ubuntu 16.04LTS or later, I’ve not
5
135
earlier Ubuntu versions or other distributions.
7
137
You’ll need a few development and utility packages installed, along with the
8
138
Mir graphics drivers:
9
139
 
10
 
    $ sudo apt-get install devscripts equivs bzr
11
 
    $ sudo apt-get install mir-graphics-drivers-desktop
 
140
    $ sudo apt install devscripts equivs bzr
 
141
    $ sudo apt install mir-graphics-drivers-desktop
12
142
 
13
143
(If you’re working on a phone or tablet use mir-graphics-drivers-android in
14
144
place of mir-graphics-drivers-desktop.)
16
146
With these installed you can checkout and build miral:
17
147
 
18
148
    $ bzr branch lp:miral
19
 
    $ sudo mk-build-deps -i --build-dep miral/debian/control
 
149
    $ sudo mk-build-deps -i
20
150
    $ mkdir miral/build
21
151
    $ cd  miral/build
22
152
    $ cmake ..
41
171
 
42
172
To exit from miral-shell press Ctrl-Alt-BkSp.
43
173
 
44
 
To run independently of X11 you need to grant access to the graphics hardware
45
 
(by running as root) and specify a VT to run in. For example:
46
 
 
47
 
    $ sudo bin/miral-shell --vt 4 --arw-file --file $XDG_RUNTIME_DIR/mir_socket
48
 
 
49
 
For convenient testing there's a "miral-desktop" script that wraps this command
50
 
to start the server (as root) and then launches the gnome-terminal (as the
51
 
current user):
52
 
 
53
 
    $ bin/miral-desktop -bindir bin
54
 
 
55
 
Support for X11 applications
56
 
----------------------------
57
 
 
58
 
If you want to run X11 applications that do not have native Mir support in the
59
 
toolkit they use then the answer is Xmir: an X11 server that runs on Mir. First
60
 
you need Xmir installed:
61
 
 
62
 
    $ sudo apt install xmir
63
 
 
64
 
Then once you have started miral-shell (as above) you can use miral-xrun to run
65
 
applications under Xmir:
66
 
 
67
 
    $ bin/miral-xrun firefox
68
 
 
69
 
This automatically starts a Xmir X11 server on a new $DISPLAY for the
70
 
application to use. You can use miral-xrun both from a command-line outside the
71
 
miral-shell or, for example, from a terminal running in the shell.
72
 
 
73
 
Running applications on Miral
74
 
-----------------------------
75
 
 
76
 
Assuming you have a Mir server running, native Mir applications can be started
77
 
from the command-line:
78
 
 
79
 
    $ sudo apt-get install mir-demos
80
 
    $ mir_demo_client_egltriangle
81
 
 
82
 
Similarly, GTK+, Qt and SDL applications can be run with the miral-run script:
83
 
 
84
 
    $ bin/miral-run gedit
85
 
    $ bin/miral-run 7kaa
86
 
 
87
 
Configuration options
88
 
---------------------
89
 
 
90
 
You can list the configuration options for miral-shell with "--help":
91
 
 
92
 
    $ bin/miral-shell --help
93
 
 
94
 
Most of these options are inherited from Mir. These can be set on the command
95
 
line, by environment variables or in a config file. For example, if you want to
96
 
start the gnome-terminal when you run miral-shell you can:
97
 
 
98
 
Set supply the option on the command line:
99
 
 
100
 
    $ bin/miral-shell --startup-apps gnome-terminal
101
 
 
102
 
Set the corresponding MIR_SERVER_<option> environment variable:
103
 
 
104
 
    $ export MIR_SERVER_STARTUP_APPS=gnome-terminal
105
 
    ...
106
 
    $ bin/miral-shell
107
 
 
108
 
Create a miral-shell config file:
109
 
 
110
 
    $ echo startup-apps=gnome-terminal > ~/.config/miral-shell.config
111
 
    ...
112
 
    $ bin/miral-shell
113
 
 
114
 
Running Qt applications
115
 
-----------------------
116
 
 
117
 
To run Qt applications under Mir you may need to install qtubuntu-desktop:
118
 
 
119
 
    $ sudo apt-get install qtubuntu-desktop
120
 
 
121
 
Building the tests
122
 
------------------
123
 
 
124
 
MirAL comes with a set of tests, if you intend to build these then add the
125
 
following packages:
126
 
 
127
 
    $ sudo apt-get install cmake-extras google-mock mirtest-dev mir-test-tools
128
 
    $ sudo apt-get install libboost-filesystem-dev libboost-system-dev
129
 
 
130
 
Note that this is not possible for Mir versions prior to 0.24 as there were
131
 
bugs in mirtest-dev. At the time of writing Ubuntu 16.4 has Mir-0.21.
 
174
You can install the MirAL examples, headers and libraries you've built with:
 
175
  
 
176
    $ sudo make install
 
177
    
 
178
Otherwise, you just need to add "bin/" to the beginning of the commands shown
 
179
in the previous section.