Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Solved] XFCE not reading profile files
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
[Solved] XFCE not reading profile files
Hello.
I'm using Debian Buster with Xfce 4.12.
I have installed and I've been using Xfce but I can't make files ,such as ~/.profile, ~/.bash_profile and others like that, to be read by bash when my system boots up.
So, every time I open a terminal window, I need to manually run `source ~/.profile`so that the paths I want to add to $PATH becomes available for that terminal.
What am I missing here?
I'm using Debian Buster with Xfce 4.12.
I have installed and I've been using Xfce but I can't make files ,such as ~/.profile, ~/.bash_profile and others like that, to be read by bash when my system boots up.
So, every time I open a terminal window, I need to manually run `source ~/.profile`so that the paths I want to add to $PATH becomes available for that terminal.
What am I missing here?
Last edited by PsySc0rpi0n on 2021-02-06 18:47, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
They say there to use the file .xsessionsrc. But I can't even find this file in my system.
Not sure why but I couldn't find it. Is it supposed that I have it in the first place or I have to create it in my $HOME ?
Not sure why but I couldn't find it. Is it supposed that I have it in the first place or I have to create it in my $HOME ?
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: XFCE not reading profile files
^ This.PsySc0rpi0n wrote:I have to create it in my $HOME
See also https://wiki.debian.org/Xsession
Search engines are quicker than waiting for a reply on forums.
deadbang
-
- Posts: 1394
- Joined: 2007-03-04 21:10
- Location: U.S.A. - WI.
Re: XFCE not reading profile files
PsySc0rpi0n wrote:Hello.
I'm using Debian Buster with Xfce 4.12.
I have installed and I've been using Xfce but I can't make files ,such as ~/.profile, ~/.bash_profile and others like that, to be read by bash when my system boots up.
So, every time I open a terminal window, I need to manually run `source ~/.profile`so that the paths I want to add to $PATH becomes available for that terminal.
What am I missing here?
You are missing the fact that you don't want / need X / your DE messing with your $PATH. You want bash to have the $PATH every time you open the terminal.
You need to put the PATH you want in ~/.bashrc, as Debian has that file sourced by default for both interactive, login, and non-login shells. That should cover having the updated $PATH no matter what kind of stupid crap your terminal emulator is doing.
See: https://unix.stackexchange.com/question ... consistent
fortune -o
Your love life will be... interesting.
How did it know?
The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches
Your love life will be... interesting.
How did it know?
The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: XFCE not reading profile files
Environmental variables shouldn't be added to ~/.bashrc because that file only applies to bash itself. The OP might want to export their custom PATH for other programs and that wouldn't work with your suggestion.pendrachken wrote:You need to put the PATH you want in ~/.bashrc
See also https://superuser.com/questions/183870/ ... 980#183980
deadbang
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
I created this ~/.xsessionrc and placed inside:
bu this is not working. After logging out an back in or even after restarting, it still can't see the paths I wanted to add to $PATH.
Code: Select all
source ~/.profile
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: XFCE not reading profile files
That's a bashism and I think ~/.xsessionrc is read by /bin/sh (hence dash).
Try
EDIT: or use this in ~/.xsessionrc to avoid creating extraneous PATH entries:
Replace "/added/directory" with the actual directories that you want to add to PATH.
Try
Code: Select all
. ~/.profile
Code: Select all
case "$PATH" in
*/added/directory*) ;;
*) PATH=/added/directory:"$PATH"
esac
export PATH
deadbang
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
Ok, that worked... I chose to use the latter one.Head_on_a_Stick wrote:That's a bashism and I think ~/.xsessionrc is read by /bin/sh (hence dash).
TryEDIT: or use this in ~/.xsessionrc to avoid creating extraneous PATH entries:Code: Select all
. ~/.profile
Replace "/added/directory" with the actual directories that you want to add to PATH.Code: Select all
case "$PATH" in */added/directory*) ;; *) PATH=/added/directory:"$PATH" esac export PATH
So, if I want to add more folders, do I need to create another block like that or I can use that block to add other folders?
edited;
For instance, if I need to add
Code: Select all
~/Downloads/my-program
Code: Select all
~/Downloads/your-program
Code: Select all
[code]case "$PATH" in
*~/Downloads/my-program*) ;;
*) ~/Downloads/my-program:"$PATH"
*~/Downloads/your-program*) ;;
*) ~/Downloads/your-program:"$PATH"
esac
export PATH
Last edited by PsySc0rpi0n on 2021-02-06 18:17, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: XFCE not reading profile files
You can add all the directories you want in the same case statement, for example:
Code: Select all
dirs=/first/directory:/second/directory:/third/directory
case "$PATH" in
*"$dirs"*) ;;
*) PATH="$dirs":"$PATH"
esac
export PATH
deadbang
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
Head_on_a_Stick wrote:You can add all the directories you want in the same case statement, for example:Code: Select all
dirs=/first/directory:/second/directory:/third/directory case "$PATH" in *"$dirs"*) ;; *) PATH="$dirs":"$PATH" esac export PATH
Ahh ok. I see. Thanks. Will try and report back
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
Ok, with the last suggestion, it didn't work, I mean, with the multiple dirs...
This is my ~/.xsessionrc file:
Edited;
Stupid me... Forget it...
This is my ~/.xsessionrc file:
Code: Select all
$ cat .xsessionrc
incdirs=~/Downloads/bitcoin-0.21/src:~/Downloads/lightning/cli:~/Downloads/lightning/lightningd:~/Downloads/mcabber/mcabber/mcabber:~/Storage/Software/Linux/openocd/src:~/Storage/Software/Linux/gcc-arm-none-eabi-10-2020-q4-major/bin
case "$PATH" in
*"$dirs"*) ;;
*) PATH="$dirs":"$PATH"
esac
export PATH
Edited;
Stupid me... Forget it...
Last edited by PsySc0rpi0n on 2021-02-06 18:32, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: XFCE not reading profile files
That's because you've declared an "incdirs" variable in the first line but used the "dirs" variable in the case statement. Both variable names have to match.
deadbang
- PsySc0rpi0n
- Posts: 322
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 8 times
- Been thanked: 1 time
Re: XFCE not reading profile files
Thanks. Stupid me...
I think this one is solved.
Thanks everyone.
I think this one is solved.
Thanks everyone.