github.com/stulluk/snapd@v0.0.0-20210611110309-f6d5d5bd24b0/data/env/snapd.sh.in (about)

     1  # shellcheck shell=sh
     2  
     3  # Expand $PATH to include the directory where snappy applications go.
     4  snap_bin_path="@SNAP_MOUNT_DIR@/bin"
     5  if [ -n "${PATH##*${snap_bin_path}}" ] && [ -n "${PATH##*${snap_bin_path}:*}" ]; then
     6      export PATH="$PATH:${snap_bin_path}"
     7  fi
     8  
     9  # Ensure base distro defaults xdg path are set if nothing filed up some
    10  # defaults yet.
    11  if [ -z "$XDG_DATA_DIRS" ]; then
    12      export XDG_DATA_DIRS="/usr/local/share:/usr/share"
    13  fi
    14  
    15  # Desktop files (used by desktop environments within both X11 and Wayland) are
    16  # looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
    17  # snappy applications' desktop files.
    18  snap_xdg_path="/var/lib/snapd/desktop"
    19  if [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}}" ] && [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}:*}" ]; then
    20      export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${snap_xdg_path}"
    21  fi
    22