Author Topic: LxMenuEditor pclos 2011 not working [Solved Partially]  (Read 1495 times)

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
LxMenuEditor pclos 2011 not working [Solved Partially]
« on: August 20, 2011, 12:06:44 PM »
I installed lxmenueditor from synaptic, it does not work.
This appears to be the original package developed for debian, it looks for *.desktop files in:
"$HOME/.local/share/applications"
The .desktop files in pclos are in "/usr/share/applications"
Even if you correct the search path in the script, it can not read the menu structure of pclos or creat working desktop files.
there is supposed to be a script for pclos developed by Daniel Leiche . see:
http://kde-apps.org/content/show.php/LxMenuEditor?content=138298
and see
http://opendesktop.org/usermanager/search.php?username=Leiche&action=comments&PHPSESSID=kfmhtqozm

However the dropbox link given in the post is broken
does any one know where the working package or script is?
Thanks
« Last Edit: August 21, 2011, 02:09:36 PM by hasmak »
PCLOS 2011 LXDE

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LxMenuEditor pclos 2011 not working
« Reply #1 on: August 20, 2011, 12:40:33 PM »
Leiche's package is in our repos. If it is broken, it can be fixed.

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
Re: LxMenuEditor pclos 2011 not working
« Reply #2 on: August 20, 2011, 02:02:11 PM »
Leiche's package is in our repos. If it is broken, it can be fixed.

Thanks for the reply
This is the package from the repo installed by synaptic, it is the only one in the repo.
If you say it is broken, should I post it in broken packages?
Thanks
PCLOS 2011 LXDE

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LxMenuEditor pclos 2011 not working
« Reply #3 on: August 20, 2011, 08:23:20 PM »
Leiche's package is in our repos. If it is broken, it can be fixed.

Thanks for the reply
This is the package from the repo installed by synaptic, it is the only one in the repo.
If you say it is broken, should I post it in broken packages?
Thanks

I'm not the one saying it is broken. I was responding to your post.   

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5524
  • PCLinuxOS: A revolution in personal computing
Re: LxMenuEditor pclos 2011 not working
« Reply #4 on: August 21, 2011, 08:19:25 AM »
I've found that if you try to use your ~/username setup for LXDE, there are a small number of programs that refuse to appear on the menu. It's strange, because changes to the KDE menu should sit in the ~/username/.kde4 folder. I think it might have something to do with something sitting in the ~/username/.config folder.

For example, in my main KDE setup, I've added task-lxde and some stuff, and Chromium refuses to appear in the LXDE menu, even after using the LxMenuEditor but in a spare partition with an LXDE-only setup, and a separate user, it works just fine.




PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LxMenuEditor pclos 2011 not working
« Reply #5 on: August 21, 2011, 08:29:23 AM »
Apps that do not show up in the menu, usually have a NotShowIn: or ShowIn: line in their /usr/share/applications dot desktop file. For example, thunar has the line ShowIn:XFCE; which means it will not show in LXDE's menu. Changing the line to ShowIn:XFCE;LXDE; will add it to the LXDE menu.

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
Re: LxMenuEditor pclos 2011 not working
« Reply #6 on: August 21, 2011, 02:08:52 PM »
Thanks to all
I modified the script, it now works on pclos lxde (with some limitations)
Currently it can only process the following catigories:
Archiving, Editors, File Tools, Games, Graphics, Internet, Office, Sound, Video, System, and Other
You can create, show, hide and edit and assign launchers to multiple groups
You can not add catigories or sub catigories
The launchers created have basic structure, if you want to add other items like mime type, tool tips, comments, ShowIn, different language name ...etc you will have to edit the launchers manually
------------
If any one is interested in having the script or working on it, let me know
PCLOS 2011 LXDE

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: LxMenuEditor pclos 2011 not working
« Reply #7 on: August 23, 2011, 09:14:50 AM »
Thanks to all
I modified the script, it now works on pclos lxde (with some limitations)


Hi,
I would have tried to add a symlink in my home user, pointing from "$HOME/.local/share/applications" to /usr/share/applications, and not changed the script, just to get what the scripts searches for.
I might have worked.

Quote
Currently it can only process the following catigories:
Archiving, Editors, File Tools, Games, Graphics, Internet, Office, Sound, Video, System, and Other
You can create, show, hide and edit and assign launchers to multiple groups
You can not add catigories or sub catigories


When it will be possible, that will be nice.

Quote
The launchers created have basic structure, if you want to add other items like mime type, tool tips, comments, ShowIn, different language name ...etc you will have to edit the launchers manually
------------
If any one is interested in having the script or working on it, let me know.


If you add your language in a destkop file, you can add the name, and the description. If you do so, you could share it, so that other members also add theirs. There are such threads at the translation sub-section of the forum, you could take a look:
http://www.pclinuxos.com/forum/index.php/board,65.0.html

Regards,
Mélodie

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
Re: LxMenuEditor pclos 2011 not working
« Reply #8 on: August 23, 2011, 12:16:59 PM »
Thanks to all
I modified the script, it now works on pclos lxde (with some limitations)


Hi,
I would have tried to add a symlink in my home user, pointing from "$HOME/.local/share/applications" to /usr/share/applications, and not changed the script, just to get what the scripts searches for.
I might have worked.



When it will be possible, that will be nice.



If you add your language in a destkop file, you can add the name, and the description. If you do so, you could share it, so that other members also add theirs. There are such threads at the translation sub-section of the forum, you could take a look:
http://www.pclinuxos.com/forum/index.php/board,65.0.html

Regards,
Mélodie



Melodie
Thanks for the reply
adding the symlink will only solve part of the problem, that will allow the editor to read the current desktop files, however there is a more fundamental problem in the design, it assumes a certain menu structure and it assumes its own syntax for the category definitions, unfortunately pclos (and other distros like mandriva) use differnt syntax.
What I did was to modify the script to search for the desktop files in their proper place and to use pclos syntax to assign the launchers to their categories.
To see this open the file /etc/xdg/menus/applications.menu - that will give you the full structure of the pclos menu and the syntax definition of each category 
Then open the script to see the definitions in it
If you would like it, I can post the modified script for you to compare and try
Cheers
PS
A better design approach which would give a universal application is to have the application read the current application.menu file and any other merged menus to get the right menu structure and the category definitions
from that, than read the .desktop files where ever they may be to populate the lists.
This will require serious programing which is beyond me for the time being
Cheers again
PCLOS 2011 LXDE

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: LxMenuEditor pclos 2011 not working [Solved Partially]
« Reply #9 on: August 23, 2011, 12:31:58 PM »
Hi,

I'm not available to involve in this for now, but I'll follow your progresses with pleasure. Why not start a thread about that at Advanced users section and show everyone there the script, along with the diff ?

Regards,
Mélodie

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: LxMenuEditor pclos 2011 not working [Solved Partially]
« Reply #10 on: September 03, 2011, 08:30:07 AM »
@hasmak

You get working the script?
What you change?

Send me please, your script, i will see, what i've not seen  ;)

You have my email  ;D

Daniel

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
Re: LxMenuEditor pclos 2011 not working [Solved Partially]
« Reply #11 on: September 03, 2011, 10:36:04 AM »
@hasmak


Send me please, your script, i will see, what i've not seen  ;)l

Sent.

Cheers
PCLOS 2011 LXDE

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: LxMenuEditor pclos 2011 not working [Solved Partially]
« Reply #12 on: September 04, 2011, 05:51:15 AM »
Is it right, that you want remove files with this script in /usr/share/applications?

This is your edit

Code: [Select]
snip...
Create(){
  if [ "$itemname" ]; then
- cd "$HOME/.local/share/applications"
+ cd "/usr/share/applications"
  lxshortcut -o "$itemname".desktop
 #Sanity check: test if the new launcher is more than an empty file
  SANCHK=`du -b "$itemname".desktop | awk '{ print $1 }'`
 #If no then rm and notify of cancelation before returning to main menu
  if [ "$SANCHK" -lt 110 ]; then
- rm "$HOME/.local/share/applications"/"$itemname".desktop
- zenity --info --title=$"Warning" --width="200" --text=$"${itemname}.desktop was empty and was therefore DISCARDED. \n\n\nPlease try again."
+ rm "/usr/share/applications"/"$itemname".desktop
+ zenity --info --title="Warning" --width="200" --text="${itemname}.desktop was empty and was therefore DISCARDED. \n\n\nPlease try again."
  else
- select=`zenity --list --height="330" --width="400" --text=$"Choose the LXMenu Section(s) to file ${itemname}.desktop under." --checklist --multiple --separator=";" --hide-column=2 --print-column=2 --column="" --column=$"Returned Output" --column=$"Category" FALSE Utility Accessories FALSE Graphics Graphics FALSE Network Internet FALSE Office Office TRUE Other Other FALSE AudioVideo $"Sound & Video" FALSE System $"System Tools" FALSE Accessibility $"Universal Access" FALSE Settings $"System -> Preferences" FALSE SystemSetup $"System -> Administration"`
+ select=`zenity --list --height="330" --width="400" --text="Choose the LXMenu Section(s) to file ${itemname}.desktop under." --checklist --multiple --separator=";" --hide-column=2 --print-column=2 --column="" --column="Returned Output" --column="Category" FALSE X-MandrivaLinux-System-Archiving-Compression Archiving FALSE X-MandrivaLinux-MoreApplications-Editors Editors FALSE X-MandrivaLinux-System-FileTools "File Tools" FALSE X-MandrivaLinux-MoreApplications-Games Games FALSE X-MandrivaLinux-Multimedia-Graphics Graphics FALSE X-MandrivaLinux-Internet-Mail Internet FALSE X-MandrivaLinux-Office-Other Office FALSE X-MandrivaLinux-Multimedia-Sound Sound FALSE X-X-MandrivaLinux-Multimedia-Video Video FALSE X-MandrivaLinux-System System TRUE X-MandrivaLinux-Other Other`
 #Failure to select at least one checkmark results in the Categories tag being set to Other
  if `grep -qw "^Categories=;" "$itemname".desktop` ; then
  sed -e '/^Categories=.*/d' -e '/^$/ d' -i "$itemname".desktop
- echo "Categories=Other;" >> "$HOME/.local/share/applications"/"$itemname".desktop
- zenity --info --title=$"Note" --width="200" --text=$"${itemname}.desktop filed under <i>Other</i> by default."
+ echo "Categories=Other;" >> "/usr/share/applications"/"$itemname".desktop
+ zenity --info --title="Note" --width="200" --text="${itemname}.desktop filed under <i>Other</i> by default."
  else
- echo "Categories=${select};" >> "$HOME/.local/share/applications"/"$itemname".desktop
+ echo "Categories=${select};" >> "/usr/share/applications"/"$itemname".desktop
  fi
 #Sanity Check: test if the new launcher is more than an empty file
  SANCHK=`du -b "$itemname".desktop | awk '{ print $1 }'`
 #If no then delete and notify of cancelation before returning to main menu
  if [ "$SANCHK" -lt 123 ]; then
- rm "$HOME/.local/share/applications"/"$itemname".desktop
- zenity --info --title=$"Warning" --width="200" --text=$"${itemname}.desktop was empty and was therefore DISCARDED. \n\n\nPlease try again."
+ rm "/usr/share/applications"/"$itemname".desktop
+ zenity --info --title="Warning" --width="200" --text="${itemname}.desktop was empty and was therefore DISCARDED. \n\n\nPlease try again."
  fi
  fi
...snip

Maybe you should meet the developer...
We use the originale script without any hacks, only add

Code: [Select]
-# i18n - Internationalization - Internationalisierung
-export TEXTDOMAIN=lxMenuEditor
-export TEXTDOMAINDIR="/usr/share/locale"
« Last Edit: September 04, 2011, 05:53:00 AM by Leiche »

Offline hasmak

  • Full Member
  • ***
  • Posts: 53
Re: LxMenuEditor pclos 2011 not working [Solved Partially]
« Reply #13 on: September 04, 2011, 08:13:14 AM »

We use the originale script without any hacks, only add

Leiche
Thanks
The original script does not work on my system (pclos 2011.06 lxde) maybe your system is different.
I modified the script, and now it works.
I did this only for my self, it is not a public release.
Deleting launchers is in the original script, and I did not remove it, I don't use it, it is better just to hide launchers that I don't want.
I also found out that alacarte menu editor (installed by default with the Gnome DE) also works with lxde, I am now using that.
Cheers
PCLOS 2011 LXDE