Page 1 of 4

Requesting update file for PATH (21.3 Wildflower Xfce)(and now mx25)

Posted: Mon May 15, 2023 3:41 pm
by Jakob77
If it is compatible with MX I think all users without a file like this ought to receive it automatically in an update:

Code: Select all

~/.config/xfce4/xinitrc

Code: Select all

#!/bin/sh

# set Xfce PATH so it includes user's private bin if the folder exists

if [ -d "$HOME/bin" ] ; then
    PATH="$PATH:$HOME/bin"
fi

exec /etc/xdg/xfce4/xinitrc

It might as well be next week.? :smile:

Documentation and background discussion:
viewtopic.php?p=724064#p724064

If it is not compatible with MX, I would like to know why.

Thank you. :penguin:

Edit: the last line in the script was missing but is now added.


Edit june 1. 2025:
Update MX25 added to headline
and this post added:
viewtopic.php?p=821066#p821066

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Mon May 15, 2023 4:40 pm
by Eadwine Rose
I wager if things need to be added, the devs will do so on their own time. Thanks.

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Mon May 15, 2023 4:57 pm
by CharlesV
Jakob77 wrote: Mon May 15, 2023 3:41 pm If it is compatible with MX I think all users without a file like this ought to receive it automatically in an update:

Code: Select all

~/.config/xfce4/xinitrc

Code: Select all

#!/bin/sh

# set Xfce PATH so it includes user's private bin if the folder exists

if [ -d "$HOME/bin" ] ; then
    PATH="$PATH:$HOME/bin"
fi

It might as well be next week.? :smile:


Documentation and background discussion:
https://forum.mxlinux.org/viewtopic.php ... 64#p724064

If it is not compatible with MX, I would like to know why.

Thank you. :penguin:
@Jakob77 The first issue I see here is that unless you add this line to the end of your xinitrc file your going to have a login that goes no where. (ie cannot log in !)

Code: Select all

exec /etc/xdg/xfce4/xinitrc

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Mon May 15, 2023 5:02 pm
by CharlesV
Second thing, I would advocate that the user bin should be *infront* of the rest of the path.

The ability for a knowing user to *override* anything in the other bin's... really give that path idea some strength.

so... I would advocate for this instead:

Code: Select all

#!/bin/sh

# set Xfce PATH so it includes user's private bin if the folder exists

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

exec /etc/xdg/xfce4/xinitrc

Then I would + 1

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Tue May 16, 2023 2:26 am
by Jakob77
CharlesV

Thank you for adding the line I forgot. :thumbup:

CharlesV wrote: Mon May 15, 2023 5:02 pm Second thing, I would advocate that the user bin should be *infront* of the rest of the path.

The ability for a knowing user to *override* anything in the other bin's... really give that path idea some strength.
Yes but can't it be a risk for the users if they by accident give their script the same name as a command the system uses during boot up or elsewhere.?
And maybe if they are smart enough to make a new command system they are also smart enough to change the PATH.

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Tue May 16, 2023 5:30 am
by Jakob77
Eadwine Rose wrote: Mon May 15, 2023 4:40 pm I wager if things need to be added, the devs will do so on their own time. Thanks.
That is what I take for granted and why I asked.
I have no idea about how much work and time it takes to set up an update to copy one file to all MX Xfce users who hasn't got it already, but I would like to know.

Changing PATH has been a forum subject for about 1½ month.
I over did it by missing a line but my request is minimalistic in order to get a faster result.
I can dream of the delicious MX-tool we could have made instead and maybe will later. I just think we need to do something faster.

But of course only if it is MX compatible, and in spite of minimalism and a long discussion with no warnings about problems in that direction I have to respect that it might not be all easy to determine.




@CharlesV

Do you think we ought to add one more line as a warning to the users.?

Code: Select all

# This file can be overwritten later by automatic updates or a MX-tool.

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Sat May 20, 2023 9:44 am
by Jakob77
And maybe:

Code: Select all

# In order to work this script needs permission to run like a program (  chmod +x ~/.config/xfce4/xinitrc ). 

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Thu Nov 02, 2023 8:53 am
by Jakob77
Since every single folder name in the file only will be a part of PATH if the folder exist I think it will be a good idea to add more default folders.



~/bin_first

A folder to be placed first and before all the other folders in PATH
As CharlesV wants it.



~/bin_pre

A folder to be placed before ~/bin in PATH




~/bin

The basic user folder for scripts placed last in PATH to protect the scripting user from over ruling basic commands by accident.




~/bin_post

A folder to be placed after ~/bin in PATH




~/mx_home_automation

I don't know about name, rank or need for this folder in PATH.
It is just meant to bring it to the @developers attention before it might be too late to prepare.





Maybe someone wants to add a sixth or a seventh folder to PATH if the folder exist.?



I can vote for letting the developers vote about it. :-)
Maybe it is already implemented in MX23.?



My main priority is still to make it significantly more user friendly for the scripting culture among new users.
And an addition of ~/bin to PATH is in itself enough to do that.

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Thu Nov 02, 2023 11:36 am
by thomasl
Jakob77 wrote: Mon May 15, 2023 3:41 pmIf it is compatible with MX I think all users without a file like this ought to receive it automatically in an update:
I agree with @Eadwine Rose's take on that.
Jakob77 wrote: Mon May 15, 2023 3:41 pm

Code: Select all

~/.config/xfce4/xinitrc
Additionally, whatever a system update puts onto my system, I strongly object to putting stuff willy-nilly into my ~/.config directory. Doing this would mean getting onto a very slippery slope.

Or as any Englishman will tell you, my $HOME is my castle!

Re: Requesting update file for PATH (21.3 Wildflower Xfce)

Posted: Thu Nov 02, 2023 11:50 am
by CharlesV
Jakob77 wrote: Thu Nov 02, 2023 8:53 am Since every single folder name in the file only will be a part of PATH if the folder exist I think it will be a good idea to add more default folders.



~/bin_first

A folder to be placed first and before all the other folders in PATH
As CharlesV wants it.

I do not recall ever saying that I wanted that? Infact, I am pretty sure that this is the first time I have ever seen or heard a "bin_first"