Adding to PATH for programs opened from the desktop

Use ~/.profile. It's sourced by the display manager and alters PATH for the whole session.


Replace the shortcut's command with a pointer to a bash script, set up your environment in the script, then call the shortcut's command.


Every *.desktop file has Exec= field. This field may include:

  • executable name which is already in $PATH;
  • full path to executable which is not in $PATH;
  • full path to user/system-created script which does what is needed.

Documentation to read: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables .

Traditional desktop environments like MATE have special tool for desktop-file creation named mate-desktop-item-edit. See its man-page online.