Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-12 00:33:36

Skaperen
Member
From: surface of planet Earth
Registered: 2013-06-15
Posts: 163

How can I set the PATH ...?

how can i set the PATH environment variable that Xfce will run with?  i would like to have scripts in a distinct directory be run by Xfce.  i noticed PATH did not have the directory i want to have the scripts in.  for a bash terminal session, i can have appropriate commands in .bashrc to set PATH.

Offline

#2 2019-01-12 01:37:42

Jerry3904
Member
Registered: 2013-11-09
Posts: 650

Re: How can I set the PATH ...?

Some hits from a web search on "How can I set the PATH environmemt variable"

https://unix.stackexchange.com/question … th-to-path
https://www.techrepublic.com/article/ho … -in-linux/


MX-18 (based on Debian Stable) with Xfce 4.12.
My little collection: Xfce Tidbits

Offline

#3 2019-01-12 02:56:32

Skaperen
Member
From: surface of planet Earth
Registered: 2013-06-15
Posts: 163

Re: How can I set the PATH ...?

those tell how to do it for a shell session, like in a terminal.  but what i need is how to set it in Xfce.  there maybe a shell script that starts up Xfce.  if there is it could be done there with the shell export subcommand.  but, the right way may be different; it may be some config setting in a file that Xfce reads.

Offline

#4 2019-01-12 12:53:25

alcornoqui
Member
Registered: 2014-07-28
Posts: 344

Re: How can I set the PATH ...?

Offline

#5 2019-01-12 14:03:50

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 5,049

Re: How can I set the PATH ...?

Skaperen wrote:

those tell how to do it for a shell session, like in a terminal.  but what i need is how to set it in Xfce.  there maybe a shell script that starts up Xfce.  if there is it could be done there with the shell export subcommand.  but, the right way may be different; it may be some config setting in a file that Xfce reads.

This really isn't an Xfce issue. Let me explain why.

Xfce is a user-space desktop environment which means that it only starts up after a user has logged in (manually from a tty or via a display manager). By this time, the system has already set the default $PATH. Xfce and all of it's components will use this $PATH.

So if you want to change your distro's $PATH, you need to edit it's configuration files. This will/may vary from distro to distro. Ubuntu for example, has $HOME/bin and $HOME/.local/bin already included in it's default path (at least for 16.04 it does) - which is set in /etc/skel/.profile and copied to each users $HOME/.profile on account creation. So the easy answer is to use one of those directories.

If you want to add another directory to the path, then you need to edit your system files or alternatively, use the advice that Jerry provided above.

Offline

#6 2019-01-12 15:16:46

Skaperen
Member
From: surface of planet Earth
Registered: 2013-06-15
Posts: 163

Re: How can I set the PATH ...?

> This really isn't an Xfce issue. Let me explain why.

i figured PATH was set before Xfce started.

so what i would be looking for is either how that PATH is set (not in Xfce) or how Xfce is started.  and what i mean by "how ... is started" is not what starts it (such as the display manager), but what steps it goes through to start it.  perhaps all it does is execute (via an appropriate system exec??() syscall) some specific path.  part of "how" would be where it gets that path from.  maybe that is a registration database.  or maybe it's a directory of symlinks that can be looked through for regular expression matches.  or maybe that directory with exact session name symlinks.  i can imagine many possible ways.

maybe it's /usr/bin/startxfce4.

if i know a fixed file path where Xfce is always started at what i can do is "wedge it".  that means renaming it to an alternate name and replacing the original name with a script that sets or modifies the PATH environment variable, then executes the alternate name the original file was renamed to.

or, perhaps, the start file is a script that can be modified.

if it were a binary executable compiled from a language like C or C++ then either the source can be modified and compiled and linked appropriately, or the wedge method would be used.

Last edited by Skaperen (2019-01-12 15:18:33)

Offline

Board footer

Powered by FluxBB