Score:1

Adding to PATH for programs opened from the desktop

id flag

Ok, I know there are lots of ways to add to PATH. Each one has good reasons why you would choose a specific method vs another.

However, what I don't know is in the case of a program opened from the desktop (by double clicking its icon), how does one add to the PATH in this scenario?

By right-clicking and going to properties I can change the command run by double clicking. Could i potentially use && to tag on a command here? Surely there's a better, more global way of doing it?

Not sure if it makes a difference, but I'm using 18.04.

Suggestions much appreciated.

Gunnar Hjalmarsson avatar
uz flag
Use `~/.profile`. It's sourced by the display manager and alters `PATH` for the whole session.
llionevans avatar
id flag
@GunnarHjalmarsson - this did the trick globally. The other two suggested answers would have required manually editing each desktop icon individually. If you put this down as an answer I can mark it as solved.
Score:1
it flag

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.

Score:1
uz flag

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

llionevans avatar
id flag
This is the solution which worked as it applied the change for all desktop icons in one go rather than needing to do each one individually.
Score:1
zw flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.