Opened 13 years ago

Closed 12 years ago

#152 closed defect (fixed)

Can't add to Lubuntu server menu

Reported by: tlc Owned by: Antoine Martin
Priority: major Milestone: 1.0
Component: Server Keywords:
Cc:

Description

My server is running Lubuntu. My client, OSX.

I added a working .desktop file to ~/.winswitch/server/menu, but it replaced the contents of the Start Application menus for that server. I wanted to add to those menus.

So then I moved the .desktop file to ~/.local/share/applications, which added it to my menus on the server DESKTOP (when I do Start Desktop), but not my Start Application menus on the client FOR the server. I restarted the server and the client.

How can I ADD to the menus of a server?

Change History (9)

comment:1 Changed 13 years ago by Antoine Martin

Owner: changed from Antoine Martin to Antoine Martin
Status: newaccepted

If you define a menu directory, it will be used instead of the system one.
If you just want to add to the global system one, just add your desktop file there (probably /usr/share/applications/) (which generally requires root).
If you do not have root access, you will have to duplicate all existing shortcuts before adding the new one, something like this ought to do it:

cd ~/.winswitch/server/menu
for x in `ls /usr/share/applications`; do
    ln -sf /usr/share/applications/$x ./
done

I must have missed the part about "~/.local/share/applications" needing to be added to the global shortcuts from the freedesktop menu spec, I will try to add this feature soon (should not be hard to do). If I had known about it sooner, I should have used pyxdg instead of writing my own desktop file parsing code...

I think this should only apply when loading from the system global menu location (and not add to .winswitch/server/menu which can remain as an override mechanism, what do you think?

comment:2 Changed 13 years ago by tlc

Seems right. Some people may want the override mechanism.

BTW, is there a way to change the categories in the server menus? It's not very important. I just thought there might be, since they're very different than the ones on my server.

comment:3 Changed 13 years ago by Antoine Martin

OK, will do.

As for the categories, this is a known bug, I have added some info to #94: we should be using '/usr/share/desktop-directories/'

comment:4 Changed 13 years ago by tlc

Also, ~/.local is enough for me but the free desktop spec defines a bunch of env vars too.

$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. 
If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

...

$XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition 
to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be seperated with a colon ':'.

If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used.

http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html

comment:5 Changed 13 years ago by Antoine Martin

Milestone: 1.0

comment:6 Changed 12 years ago by HellFire

Definitely need this sorted out. Most of mine aren't showing up because of the category. I just had to add firefox to Internet for it to show.

comment:7 Changed 12 years ago by Antoine Martin

r4896 honours XDG_DATA_HOME and XDG_DATA_DIRS

Will now look at the categories and why they are different from the usual menus

comment:8 Changed 12 years ago by Antoine Martin

r4898 fixes the loading of the icons for the menu categories.

Still TODO: figure out how to do this category/menus thing properly.
Nathan: can you post your firefox.desktop and the associated desktop-directories entries? (if I can't do-the-right-thing straight away, at least maybe I can fix this particular problem the dirty way..)

comment:9 Changed 12 years ago by Antoine Martin

Resolution: fixed
Status: acceptedclosed

Will follow up in #94

Note: See TracTickets for help on using tickets.