xdg-ninja: allow custom programs/ dir via XN_PROGRAMS_DIR
In order to foresee the work on the unified packaging process, the
programs/ directory (which should be located in /usr/share/xdg-ninja or
/usr/local/share/xdg-ninja) is automatically found depending on where
the xdg-ninja executable is located.
This also allows for backwards compatibility as when the xdg-ninja
script is located in a working directory (not in a bin/), xdg-ninja
automatically picks the programs/ folder in the current working
directory, just like previously.
If the directory fails to find the programs/ dir, the user can override
the variable XN_PROGRAMS_DIR through environment variables.
This change is to prevent people from packaging xdg-ninja with the
programs/ directory within /usr(/local)/bin or by modifying the script
in place.