On Tue, Nov 3, 2015 at 6:53 AM, lilydjwg <[email protected]> wrote:
> [...]
> If $prefix/share/applications doesn't exist, just create it.
>
> A XDG_DATA_DIRS setting specifies where to search for
> applications/*.desktop files[1], and it defaults to ~/.local/share,
> /usr/local/share and /usr/share on my system.

on mine, it is set to just /usr/share
>
> That setting may not be easy to find out.

in /etc/profile maybe, or in some other script sourced by all shells?
Ah, there: /etc/profile.d/xdg-environment.sh and
/etc/profile.d/xdg-environment.csh (which IIUC are sourced by some
other shell startup script): here are the lines I have in the .sh
script:

  for xdgdir in /usr/local/share /usr/share /etc/opt/*/share
/opt/*/share /usr/share/gnome ; do
     if test -d "$xdgdir" && test -d "$xdgdir/applications"; then
        if test -z "$XDG_DATA_DIRS"; then
           XDG_DATA_DIRS="$xdgdir"
        else
           XDG_DATA_DIRS="$XDG_DATA_DIRS:$xdgdir"
        fi
     fi
  done

and in the .csh script

if ( ! ${?XDG_DATA_DIRS} ) then
    set XDG_DATA_DIRS
else
    set XDG_DATA_DIRS=(${XDG_DATA_DIRS:as/:/ /})
endif
set nonomatch
foreach xdgdir (/usr/local/share /usr/share /etc/opt/*/share
/opt/*/share /usr/share/gnome/help)
    if ( -d "$xdgdir" ) then
    set -l XDG_DATA_DIRS=($XDG_DATA_DIRS $xdgdir)
    endif
end
unset nonomatch

IOW now that I have created the directory, the environment variable
will be updated the next time a shell is started.

> And I don't think a script can
> determine it automatically when e.g. someone wants to install Vim to
> /opt and has that file placed where they want.

/opt/*/share is among the places where my shells will look at startup
for an applications/ subdirectory, see above.


Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui