Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've written quite a few open source programs over the years, but not very recently, and I've never had this problem before. The menu items for my new project simply refuse to show up in menus on either gnome or kde.

I originally just installed the .desktop files to /usr/share/applications but later modified it to use desktop-file-utils - all to no avail. I've add update-desktop-database to my postinst script... nothing

I've validated the entries, and in the file manager they are correct, I've tried giving them execute permissions... I can't find anything wrong but they just won't show up. Is there something new one has to do to get your app's menu items to show these days ?

The .desktop files are:

silentcoder@ravenriley ~/SOURCE/ezdm $ cat ezdm.desktop 
[Desktop Entry]
Type=Application
Name=EZDM
GenericName=Easy Dungeon Master
Comment=A tookit for AD&D Dungeon Master
TryExec=/usr/games/ezdm
Exec=/usr/games/ezdm
Categories=Game;RolePlaying;
Icon=/usr/share/icons/hicolor/128x128/ezdm.png
Terminal=false

cat ezdmconsole.desktop

[Desktop Entry]
Type=Application
Name=EZDM-Console
GenericName=Easy Dungeon Master (Console version)
Comment=A tookit for AD&D Dungeon Master
TryExec=/usr/games/ezdm --console
Exec=/usr/games/ezdm --console
Categories=Game;RolePlaying;
Icon=/usr/share/icons/hicolor/128x128/ezdm-console.png
Terminal=1
X-Desktop-File-Install-Version=0.20

And if any of the other code might be useful, it's all browseable on github: https://github.com/ajventer/ezdm

UPDATE: The mystery deepens, if I copy the files to /usr/share/applications/kde4 (which I obviously don't want to do in my package - after all, it should work in gnome too) then suddenly ezdm.desktop does show up in the menu, but ezdm-console.desktop still refuses to.

UPDATE: since it may be relevant: From Makefile:

install:
                $(PYTHON) setup.py install --prefix=/${PREFIX} --root $(DESTDIR) --install-scripts=/${PREFIX}/games/ --no-compile --force --record .install.record --install-layout=deb
                mkdir -p ${DESTDIR}/${PREFIX}/share/applications
                mkdir -p ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/
                desktop-file-install --dir=${DESTDIR}/${PREFIX}/share/applications/ ezdm.desktop 
                desktop-file-install --dir=${DESTDIR}/${PREFIX}/share/applications/ ezdm-console.desktop 
                install -g root -o root -m 0666 ezdm.png ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/ezdm.png
                install -g root -o root -m 0666 ezdm-console.png ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/ezdm-console.png 
                update-desktop-database ${DESTDIR}/${PREFIX}/share/applications

And debian/postinst:

cat debian/postinst 
#!/bin/bash -x
ln -sf /usr/games/ezdm* /usr/bin
for I in /usr/lib/python2.7/dist-packages/ezdm_libs/*.py; do
        python -m compileall $I
done
update-desktop-database
#DEBHELPER#
share|improve this question
    
I am not sure where the problem is - it could very well be the install code, since the possibilities are scattered over numerous places - I gave one set of examples and linked to where all the other code is. But by all means, I'll add the makefile and setup.py as well. –  silentcoder Feb 28 '13 at 23:42
    
Did you have a look at stackoverflow.com/questions/13632385/… –  mikebabcock Feb 28 '13 at 23:59
    
Yep, found it while googling around - I even mention in the question that I tested with giving +x permissions (the solution from that question) –  silentcoder Mar 1 '13 at 0:02
    
So it shows up in KDE but not in GNOME? –  Herman Torjussen Mar 1 '13 at 0:02
    
I haven't checked that - I was just trying to various things. But installing to a KDE4 specific directory would be insane either way - since this should work on any desktop that understands the XDG specification - they can't all demand a different menu directory. –  silentcoder Mar 1 '13 at 0:04
show 2 more comments

migrated from stackoverflow.com Mar 1 '13 at 14:15

This question came from our site for professional and enthusiast programmers.

2 Answers

There were formatting errors in the files. Based on commenters, I can only assume that some versions of gnome are more forgiving. Either way I found a nifty way to get them to work: Open the directory in dolphin, and edit them until they can be launched from dolphin - only once that works, add the categories field and then they show up in menus. In KDE you may have to run: kbuildsycoca4 --noincremental first if you don't relog.

The final versions of the files are:

cat ezdm.desktop 
[Desktop Entry]
Categories=Game;RolePlaying;
Comment[en_US]=A tookit for ADnD Dungeon Master
Comment=A tookit for ADnD Dungeon Master
Exec=/usr/games/ezdm
GenericName[en_US]=Easy Dungeon Master
GenericName=Easy Dungeon Master
Icon=/usr/share/icons/hicolor/128x128/ezdm.png
MimeType=
Name[en_US]=EZDM
Name=EZDM
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
TryExec=/usr/games/ezdm
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

silentcoder@ravenriley ~/SOURCE/ezdm0/ezdm $ cat ezdm-console.desktop 
[Desktop Entry]
Categories=Game;RolePlaying;
Comment[en_US]=EZDM Console Version
Comment=EZDM Console Version
Exec=/usr/games/ezdm --console
GenericName[en_US]=EZDM Console Version
GenericName=EZDM Console Version
Icon=/usr/share/icons/hicolor/128x128/ezdm-console.png
MimeType=
Name[en_US]=EZDM-Console
Name=EZDM-Console
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

In case that helps anybody else. I've just pushed out a new PPA build request, so updated ubuntu packages will be available soon.

share|improve this answer
add comment

Most likely because your incorrect TryExec line indicates that it is no longer valid.

TryExec=/usr/games/games/ezdm

I guess this file does not exist, and in particular is not executable?

share|improve this answer
    
Thanks for that catch, I've fixed it in the code, but the menu items still don't show up (I even logged out and back in to make sure). –  silentcoder Feb 28 '13 at 23:16
    
Do you by chance have another ezdm.desktop somewhere, for example in $HOME/.local/share/applications/ezdm.desktop? –  Anony-Mousse Mar 1 '13 at 0:03
    
None that I can find, the only entries in the .local version are the ones wine creates. And I tested on another machine (with gnome) which does not contain a code checkout (I use it to clean-install test the packages). –  silentcoder Mar 1 '13 at 0:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.