memory-leaks

Still reachable: lots of words in many pages.
git clone https://git.kevinlegouguec.net/memory-leaks
Log | Files | Refs | README | LICENSE

activate (1118B)


      1 # Hey Emacs; this is a -*- shell-script -*-.
      2 # Hopefully invoked by bash 🤞
      3 
      4 _apps_dir=$(realpath --no-symlinks $(dirname ${BASH_SOURCE}))
      5 
      6 _apps_PATH=$(
      7     shopt -s nullglob
      8     bins=( "${_apps_dir}"/*/bin )
      9     IFS=: eval 'echo "${bins[*]}"'
     10 )
     11 export PATH=${_apps_PATH}:${PATH}
     12 
     13 _apps_XDG_DATA_DIRS=$(
     14     shopt -s nullglob
     15     # We could set globstar and let Bash loose, searching the depths
     16     # of _apps_dir for
     17     # **/{applications/*.desktop,systemd/user/*.service}
     18     # but it seems like asking for trouble.  Make some assumptions
     19     # about where applications typically dump their XDG-related files.
     20     datadirs=($(
     21         {
     22             for dkentry in "${_apps_dir}"/*/share/applications/*.desktop
     23             do
     24                 echo ${dkentry%/applications/*.desktop}
     25             done
     26             for unit in "${_apps_dir}"/*/lib*/systemd/user/*.service
     27             do
     28                 echo ${unit%/systemd/user/*.service}
     29             done
     30         } | sort -u
     31     ))
     32     IFS=: eval 'echo "${datadirs[*]}"'
     33 )
     34 export XDG_DATA_DIRS="${_apps_XDG_DATA_DIRS}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"