.desktop file is supposed to make Menu entry? [Solved]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

.desktop file is supposed to make Menu entry? [Solved]

#1 Post by sunburnt »

Here`s a file I made and put in: /use/share/applications/driveman.desktop

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=DriveMan   Drive Manager
Icon=mini-fdisk
Comment=DriveMan Drive Manager
Exec=/root/my-applications/driveman/driveman
Terminal=false
Type=Application
Categories=X-FilesystemMount
GenericName=DriveMan Drive Manager
Nothing is added to the Puppy Menu.
I don`t see how it adds itself to a sub menu, no mention of it that I can see...
Do I really have to add a line to: /root/.jwmrc like this:

Code: Select all

JWMRC=$(</root/.jwmrc)
H=`echo "$JWMRC" |head -$((`echo "$JWMRC" |grep -n Filesystem |sed 's/:.*$//'`+1))`
T=`echo "$JWMRC" |tail +$(($N+1))`
M='<Program label="  DriveMan   Drive Manager" icon="mini-fdisk">/root/my-applications/driveman/driveman</Program>'
echo -e "$H\\n$M\\n$T" > /root/.jwmrc
Last edited by sunburnt on Sun 04 Apr 2010, 20:54, edited 1 time in total.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#2 Post by 8-bit »

Depending on the version of Puppy you may have to open a terminal, type "fixmenus" and then restart JWM.
Puppy 431 will automatically do it IF the program is installed as a PET.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

I rebooted just to be sure, apparently there`s something I`m missing ( Wow... That`s new... :wink: ).

I never did understand how the .desktop files generated Menu entries.
I get how the .desktop files are used to add entries to the default Puppy menu in: /root.jwmrc
But as I said, I see no info. in the .desktop file about how they are placed in the menu.
Somehow I would think it would have to reference the sub-menu it`s to go in.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#4 Post by Pizzasgood »

It's based on the category. Which category belongs to which menu is listed in /etc/xdg/menus/hierarchy. The fixmenus script uses the stuff in /etc/xdg/templates and /etc/xdg/menus to create the menu file that you get in ~/. Depending on which WM is being used, I believe fixmenus also uses jwm-xdgmenu, icewm-xdgmenu, etc.

I just tested the desktop file you posted and it worked for me (4.1.2). Except, in your post you said it was under the "use" directory, instead of "usr". I assume that was just a typo in your post, and that you did in fact place it under "usr".

Make sure you run fixmenus.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#5 Post by sunburnt »

Thanks for the tutorial Pizzasgood; I always appreciate the help!
I knew the menu setup was rather complex and used many files to do it`s thing.
Fixed an error, the .desktop file had, no "xpm" extention on the icon file name. Looks great!
I set my app. to copy the .desktop file, fix the menus, and restart jwm.

And yes... The "e" key is too close to the "r" key for rapid typing. :P

Post Reply