summaryrefslogtreecommitdiff
path: root/man/50-xdg-data-dirs.sh
blob: 02216abf6c69aad0c48b8e84f50578655637b1db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
# SPDX-License-Identifier: CC0-1.0

# set the default value
XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share}"

# add a directory if it exists
if [[ -d /opt/foo/share ]]; then
    XDG_DATA_DIRS="/opt/foo/share:${XDG_DATA_DIRS}"
fi

# write our output
echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}"