QX

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(New page: QX is a X-Server that runs under Qt Extended. Especially in the distribution QtMoko is is used to run applications like: * Navit * Linphone under Qt Extended.)
 
(New desktop-definiton file for SyncCal)
 
(42 intermediate revisions by 3 users not shown)
Line 1: Line 1:
QX is a X-Server that runs under [[Qt Extended]]. Especially in the distribution [[QtMoko]] is is used to run applications like:
+
QX is a X-Server that runs under [[Qt Extended]]. Especially in the distribution [[QtMoko]] it is used to run applications like:
 
* [[Navit]]  
 
* [[Navit]]  
 
* [[Linphone]]
 
* [[Linphone]]
under Qt Extended.
+
under Qt Extended.  
 +
 
 +
== Starting Applications ==
 +
You can start applications that need the X-Server with the following steps in [[QtMoko]]:
 +
# Open Main Menu by clicking on the green Q-Topia "Q"-Box.
 +
# Open Applications (4 Boxes, red, yellow, green, blue)
 +
# Scroll down and open QX
 +
# Select the application that needs the X-Server (e.g. [[Navit]])
 +
# Click on the white Paper Icon on the bottom left to open the context menu of the QX application.
 +
# Select "Launch" to start application
 +
With the AUX-Button you can exit the X-Server environment without quitting the application.
 +
== Screenshots ==
 +
{| cellspacing="0"  border="0" style="font-size: 85%; text-align: left; width: auto; background:#CCCCC;"
 +
|-
 +
!
 +
[[Image:QX_Navit1.png|250px|thumb|Use QX-Menu-Button at bottom left]]
 +
!
 +
[[Image:QX_Navit_Launch.png|250px|thumb|Select Launch to start Navit in QX]]
 +
|-
 +
|}
 +
* In Settings you can change the launch settings of the selected application
 +
* with Favourites you can select the predefined applications you can add to your favourites menu.
 +
 
 +
==QX Favorites==
 +
[[Image:qxfavorites.png|200px|thumb|Favorites in QX with Linphone-icon added]]
 +
 
 +
[[QX]] is the X-Server in QtMoko you can add favorites to the QX-Menu too by manual editing the files in:
 +
  /opt/qtmoko/etc/qx
 +
The file
 +
  favourites.conf
 +
detemines the list of application you will see after starting [[QX]]. The file looks like this:
 +
  [Apps]
 +
  list=navit, tangogps
 +
The applicationsnames must exist and need an entry in the <tt>profiles.conf</tt> file.
 +
The file
 +
  profiles.conf
 +
defines the QX-settings for the application. E.g. navit needs the GPS-daemon to be started and the auto-dim function of the display is disabled. These settings can be defined for the applications individually. The file contains profile records like the following for <tt>tangogps</tt> and <tt>navit</tt>:
 +
 
 +
  [tangogps]
 +
  antidim=true
 +
  antisuspend=true
 +
  gps=true
 +
  init=gpsd /dev/ttySAC1
 +
  kbd=false
 +
  qvga=false
 +
  rotate=false
 +
  wm=true
 +
 +
  [navit]
 +
  antidim=true
 +
  antisuspend=true
 +
  gps=true
 +
  init=gpsd /dev/ttySAC1
 +
  kbd=false
 +
  qvga=false
 +
  rotate=false
 +
  wm=true
 +
{{Note|You do not need a profile definition for the application to be launched in QX. Just a desktop-definition file in the folder:
 +
  /usr/share/applications
 +
}}
 +
 
 +
===Add to QX-Favourites===
 +
The following explainations show the internal structure of the QX application management. It is helpful to create installation scripts for QX.
 +
 
 +
You have installed or programmed an application  with the name <tt>myapp</tt>. Test the application in the QX-terminal if it works properly. Now we add this application <tt>myapp</tt> to the application list in <tt>favourites.conf</tt>. We do this e.g. with vi:
 +
  # vi /opt/qtmoko/etc/qx/favourites.conf
 +
 
 +
The file look like this (press "I" for switching to INSERT mode):
 +
 
 +
  [Apps]
 +
  list=navit, tangogps, myapp
 +
 
 +
Add <tt>myapp</tt> press ESC and :w for "write to file" and ":q" for "quit VI".
 +
{{Note|You can use programs for myapp (e.g. a shell script with xdialog), that have a desktop-definition file in the directory:
 +
  /usr/share/applications
 +
If you want to use your own scripts in QX with an icon, create a desktop-definition file first (see <tt>synccal.desktop</tt> as an example below) and save this file in <tt>/usr/share/applications</tt>.
 +
}}
 +
 
 +
Now we have to add a profile record for <tt>myapp</tt> in file <tt>profiles.conf</tt>. We do this e.g. with vi:
 +
  # vi /opt/qtmoko/etc/qx/profiles.conf
 +
The file is depended on your settings could look like this  and e.g. the following lines (press "I" for switching to INSERT mode):
 +
 
 +
  [myapp]
 +
  antidim=false
 +
  antisuspend=true
 +
  gps=false
 +
  init=
 +
  kbd=false
 +
  qvga=false
 +
  rotate=false
 +
  wm=false
 +
 
 +
Then press "ESC" and ":w" for "write to file" and ":q" for "quit VI".
 +
 
 +
===Listed Favourites===
 +
The available applications for the favourites in QX are defined in the directory:
 +
  /usr/share/applications
 +
====Example desktop-definiton file for navit====
 +
The files have the extension <tt>.desktop</tt> and have the following structure (e.g. <tt>navit.desktop</tt> is defined like this:
 +
<pre>
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=Navit
 +
Name[de]=Navit
 +
Name[fr]=Navit
 +
Comment=The open source vector based navigation program with routing engine
 +
Comment[de]=Ein vektorbasiertes Navigationsprogramm
 +
Comment[fr]=Le logiciel opensource de navigation vectorielle
 +
Exec=navit
 +
Icon=navit
 +
StartupNotify=true
 +
Terminal=false
 +
Type=Application
 +
Categories=GTK;Utility;Geography;
 +
GenericName=Navit
 +
GenericName[de]=Navit
 +
</pre>
 +
You can define the
 +
* Name,
 +
* Comment and
 +
* Generic Name
 +
for differnent languages. The main variable is <tt>Exec=...</tt>, because it defines the command executed, when you click on the icon in QX.
 +
 
 +
{{Note|The navit icons are stored in:
 +
<pre>
 +
/usr/share/icons/hicolor/22x22/apps/navit.png
 +
/usr/share/icons/hicolor/128x128/apps/navit.png
 +
</pre>
 +
The icon should be located in:
 +
<pre>
 +
/usr/share/pixmaps/
 +
</pre>
 +
So copy the icon into the pixmap directory:
 +
  cp /usr/share/icons/hicolor/128x128/apps/navit.png /usr/share/pixmaps/navit.png
 +
}}
 +
 
 +
====New desktop-definiton file for SyncCal====
 +
As an example we want to use the shellscript of [http://mossroy.free.fr/ics2qtcal/ Mossroy] for syncing an iCal-file into the Qt-Calendar (see [http://wiki.openmoko.org/wiki/QtMoko#Install_Script QtMoko ics2qtcal Installation]]). We have a working script
 +
  /usr/local/bin/synccal
 +
that performs an import of in iCal-file in the Qt-calendar. We create for <tt>synccal</tt> a desktop-definition file, that is visible in QX via <tt>vi</tt>.
 +
vi /usr/share/applications/synccal.desktop
 +
We call the desktop-definition file <tt>synccal.desktop</tt> and enter the following definitions:
 +
<pre>
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=SyncCal
 +
Name[de]=SyncCal
 +
Name[fr]=SyncCal
 +
Comment=Syncing remote and local ics-file into Qt-Calendar.
 +
Comment[de]=Ein perlbasiertes Script fuer den Import von ics-Dateien in QtMoko
 +
Exec=synccal
 +
Icon=synccal
 +
StartupNotify=true
 +
Terminal=true
 +
Type=Application
 +
Categories=GTK;Utility;Dialog;
 +
GenericName=SyncCal
 +
GenericName[de]=SyncCal
 +
</pre>
 +
{| cellspacing="0"  border="0" style="font-size: 85%; text-align: left; width: auto; background:#CCCCC;"
 +
|-
 +
!
 +
[[Image:QX_SyncCal_Launch.png|250px|thumb|Use QX-Menu for launch the new Application SyncCal]]
 +
!
 +
[[Image:QX_SyncCal_Info.png|250px|thumb|The Info in QX shows the setting in synccal.desktop]]
 +
|-
 +
|}
 +
 
 +
===Icons for the QX-Application===
 +
If you want to have a special icon for your new application see free e.g. [http://www.100000freecliparts.com/clipart/Icons/index.html 100000 Free Clipart] and store the icons in the following directory with the name <tt>synccal.png</tt>. 
 +
<pre>
 +
/usr/share/pixmaps/synccal.png
 +
</pre>
 +
The name is defined by the definition:
 +
  Icon=synccal
 +
in the file <tt>synccal.desktop</tt>. If the icon is not in the image format PNG, you can install ImageMagick and convert the file:
 +
  # apt-get install imagemagick
 +
  # cd /usr/share/pixmaps/
 +
  # convert synccal.gif synccal.png
 +
  # rm synccal.gif
 +
 
 +
===Remove QX-Favorites===
 +
You just have to remove the application name from the list of applications in:
 +
  /opt/qtmoko/etc/qx/favorites.conf
 +
You do not need to remove the application profile for your application in <tt>profiles.conf</tt>.
 +
 
 +
If you want to remove an application not only from the favourites list and from the list of available application in [[QX]] then remove the desktop-definition file in the folder:
 +
  /usr/share/applications 
 +
[[Category:Qt based distributions]]

Latest revision as of 20:18, 29 November 2010

QX is a X-Server that runs under Qt Extended. Especially in the distribution QtMoko it is used to run applications like:

under Qt Extended.

Contents

[edit] Starting Applications

You can start applications that need the X-Server with the following steps in QtMoko:

  1. Open Main Menu by clicking on the green Q-Topia "Q"-Box.
  2. Open Applications (4 Boxes, red, yellow, green, blue)
  3. Scroll down and open QX
  4. Select the application that needs the X-Server (e.g. Navit)
  5. Click on the white Paper Icon on the bottom left to open the context menu of the QX application.
  6. Select "Launch" to start application

With the AUX-Button you can exit the X-Server environment without quitting the application.

[edit] Screenshots

Use QX-Menu-Button at bottom left
Select Launch to start Navit in QX
  • In Settings you can change the launch settings of the selected application
  • with Favourites you can select the predefined applications you can add to your favourites menu.

[edit] QX Favorites

Favorites in QX with Linphone-icon added

QX is the X-Server in QtMoko you can add favorites to the QX-Menu too by manual editing the files in:

 /opt/qtmoko/etc/qx

The file

 favourites.conf

detemines the list of application you will see after starting QX. The file looks like this:

 [Apps]
 list=navit, tangogps

The applicationsnames must exist and need an entry in the profiles.conf file. The file

 profiles.conf

defines the QX-settings for the application. E.g. navit needs the GPS-daemon to be started and the auto-dim function of the display is disabled. These settings can be defined for the applications individually. The file contains profile records like the following for tangogps and navit:

 [tangogps]
 antidim=true
 antisuspend=true
 gps=true
 init=gpsd /dev/ttySAC1
 kbd=false
 qvga=false
 rotate=false
 wm=true

 [navit]
 antidim=true
 antisuspend=true
 gps=true
 init=gpsd /dev/ttySAC1
 kbd=false
 qvga=false
 rotate=false
 wm=true
NOTE: You do not need a profile definition for the application to be launched in QX. Just a desktop-definition file in the folder:
 /usr/share/applications


[edit] Add to QX-Favourites

The following explainations show the internal structure of the QX application management. It is helpful to create installation scripts for QX.

You have installed or programmed an application with the name myapp. Test the application in the QX-terminal if it works properly. Now we add this application myapp to the application list in favourites.conf. We do this e.g. with vi:

 # vi /opt/qtmoko/etc/qx/favourites.conf

The file look like this (press "I" for switching to INSERT mode):

 [Apps]
 list=navit, tangogps, myapp

Add myapp press ESC and :w for "write to file" and ":q" for "quit VI".

NOTE: You can use programs for myapp (e.g. a shell script with xdialog), that have a desktop-definition file in the directory:
 /usr/share/applications

If you want to use your own scripts in QX with an icon, create a desktop-definition file first (see synccal.desktop as an example below) and save this file in /usr/share/applications.


Now we have to add a profile record for myapp in file profiles.conf. We do this e.g. with vi:

 # vi /opt/qtmoko/etc/qx/profiles.conf

The file is depended on your settings could look like this and e.g. the following lines (press "I" for switching to INSERT mode):

 [myapp]
 antidim=false
 antisuspend=true
 gps=false
 init=
 kbd=false
 qvga=false
 rotate=false
 wm=false

Then press "ESC" and ":w" for "write to file" and ":q" for "quit VI".

[edit] Listed Favourites

The available applications for the favourites in QX are defined in the directory:

 /usr/share/applications

[edit] Example desktop-definiton file for navit

The files have the extension .desktop and have the following structure (e.g. navit.desktop is defined like this:

[Desktop Entry]
Version=1.0
Name=Navit
Name[de]=Navit
Name[fr]=Navit
Comment=The open source vector based navigation program with routing engine
Comment[de]=Ein vektorbasiertes Navigationsprogramm
Comment[fr]=Le logiciel opensource de navigation vectorielle
Exec=navit
Icon=navit
StartupNotify=true
Terminal=false
Type=Application
Categories=GTK;Utility;Geography;
GenericName=Navit
GenericName[de]=Navit

You can define the

  • Name,
  • Comment and
  • Generic Name

for differnent languages. The main variable is Exec=..., because it defines the command executed, when you click on the icon in QX.

NOTE: The navit icons are stored in:
/usr/share/icons/hicolor/22x22/apps/navit.png
/usr/share/icons/hicolor/128x128/apps/navit.png

The icon should be located in:

/usr/share/pixmaps/

So copy the icon into the pixmap directory:

 cp /usr/share/icons/hicolor/128x128/apps/navit.png /usr/share/pixmaps/navit.png


[edit] New desktop-definiton file for SyncCal

As an example we want to use the shellscript of Mossroy for syncing an iCal-file into the Qt-Calendar (see QtMoko ics2qtcal Installation]). We have a working script

 /usr/local/bin/synccal

that performs an import of in iCal-file in the Qt-calendar. We create for synccal a desktop-definition file, that is visible in QX via vi.

vi /usr/share/applications/synccal.desktop

We call the desktop-definition file synccal.desktop and enter the following definitions:

[Desktop Entry]
Version=1.0
Name=SyncCal
Name[de]=SyncCal
Name[fr]=SyncCal
Comment=Syncing remote and local ics-file into Qt-Calendar.
Comment[de]=Ein perlbasiertes Script fuer den Import von ics-Dateien in QtMoko
Exec=synccal
Icon=synccal
StartupNotify=true
Terminal=true
Type=Application
Categories=GTK;Utility;Dialog;
GenericName=SyncCal
GenericName[de]=SyncCal
Use QX-Menu for launch the new Application SyncCal
The Info in QX shows the setting in synccal.desktop

[edit] Icons for the QX-Application

If you want to have a special icon for your new application see free e.g. 100000 Free Clipart and store the icons in the following directory with the name synccal.png.

/usr/share/pixmaps/synccal.png

The name is defined by the definition:

 Icon=synccal

in the file synccal.desktop. If the icon is not in the image format PNG, you can install ImageMagick and convert the file:

 # apt-get install imagemagick
 # cd /usr/share/pixmaps/
 # convert synccal.gif synccal.png
 # rm synccal.gif

[edit] Remove QX-Favorites

You just have to remove the application name from the list of applications in:

 /opt/qtmoko/etc/qx/favorites.conf

You do not need to remove the application profile for your application in profiles.conf.

If you want to remove an application not only from the favourites list and from the list of available application in QX then remove the desktop-definition file in the folder:

 /usr/share/applications
Personal tools

QX is a X-Server that runs under Qt Extended. Especially in the distribution QtMoko is is used to run applications like:

under Qt Extended.