how to modify menu command to run LyX in Ubuntu Netbook

Asked by Waluyo Adi Siswanto

According to the discussion found here
https://bugs.launchpad.net/ubuntu/+source/indicator-appmenu/+bug/619811
LyX can be run with all menus shown in my Ubuntu Netbook, by using a command from the terminal:
QT_X11_NO_NATIVE_MENUBAR=1 lyx

My question is, what is the command in LyX icon properties, so I can run LyX by clicking the icon (from Applications>Office>Lyx)

Revision history for this message
Waluyo Adi Siswanto (was-wlk) said :
#1

I am sorry, I have found the solution
a) Create a file lyx_command.sh
    #!/bin/sh
     QT_X11_NO_NATIVE_MENUBAR=1 lyx
b) Change permission to "Allow executing file as program"
c) Replace the previous lyx command (lyx %f) by browsing to lyx_command.sh

Now clicking LyX menu under applications -> office, can see LyX with normal menus.

Revision history for this message
cristo (ccristoo) said :
#2

I have confirmed that using APPMENU_DISPLAY_BOTH=1 it also works for lyx in Ubuntu Netbook Edition 10.10.

Regarding the lyx command replacement, howt is it done?, where do I use "lyx %f"?

Best regards

Revision history for this message
Waluyo Adi Siswanto (was-wlk) said :
#3

In Ubuntu Netbook, from Applications->System then click Main Menu, go to folder Office, then you can find LyX.
If you click properties, you will find command field with already defined command "lyx %f". browse to the shell command that you have prepared, in my case "lyx_command.sh", which is allowed to execute.

Revision history for this message
Waluyo Adi Siswanto (was-wlk) said :
#4

In Ubuntu Netbook, from Applications->System then click Main Menu, go to folder Office, then you can find LyX.
If you click properties, you will find command field with already defined command "lyx %f". browse to the shell command that you have prepared, in my case "lyx_command.sh", which is allowed to execute.

Revision history for this message
cristo (ccristoo) said :
#5

Thanks a lot. It works great now.

Revision history for this message
Manveru (manveru) said :
#6

The script by Waluyo Adi Siswanto do not pass arguments to the LyX which may block ability to launch LyX documents by clicking them (I do not know proper work flow on document click and I do not know whether the same application definition is in use for that).

However proper script should look like:
     #!/usr/bin/env sh
     QT_X11_NO_NATIVE_MENUBAR=1 lyx "$@"

In such version arguments are passed to the lyx invocation.

Revision history for this message
Waluyo Adi Siswanto (was-wlk) said :
#7

Thanks,
I have corrected the script in my netbook.

Revision history for this message
nbubis (nbubis) said :
#8

It's actually easier then writing a new script.
In the launcher just write: "env APPMENU_DISPLAY_BOTH=1 lyx"
It should run fine.

Revision history for this message
joopbraak (joopbraak) said :
#9

It's fixed now, so no work around necessary anymore.
https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/619811