Code: Select all
~/.config/xfce4/xinitrc
It is a start up script so it is executed at every boot up.
One of the useful things it can do is to set a very good PATH to "~/bin" that is the most common place for private user scripts.
What does PATH mean.?
PATH is a line of directories where the computer looks for the filename (script name) you use for a command in the Terminal.
And it will look in the same order as they are lined up.
It can go like this:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
All the folders are installed by system or software but you can see important system folders in the beginning and games are put in the end.
There can be exceptions but as done here I believe it is a good common rule to put the most important files first to make sure they can always be found correctly.
Before we make scripts we naturally always do a test in Terminal so we know the filename is available but just to decrease the risk I choose to put "~/bin" (:/home/my_user_name/bin) in the end, and PATH then goes like this:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/my_user_name/bin
In order to do that I just need a xinitrc like this, and give it permission to run as a program:
Code: Select all
#!/bin/sh
# This file: ~/.config/xfce4/xinitrc
# Script for setting user PATH in MX 23.6 Xfce
# This file might later be overwritten by MX update or a MX-tool.
# You can read more here: https://forum.mxlinux.org/viewtopic.php?t=75245
# In order to work, this script needs to be in the right folder and have permission to run like a program
# ( chmod +x ~/.config/xfce4/xinitrc or chmod 755 ~/.config/xfce4/xinitrc or Thunar right click file -> prop -> perm )
# ***** Personal config begin ***********
# Section 1:
# Setting PATH
# The 3 lines below will include ~/bin in the end of PATH only if the folder exist
if [ -d "$HOME/bin" ] ; then
PATH="$PATH:$HOME/bin"
fi
# ***** Personal config end ***********
exec /etc/xdg/xfce4/xinitrc
So if you give "~/.config/xfce4/xinitrc" that content and also create ~/bin (don't forget permissions if you want) then you will have a very fine PATH for ~/bin after next boot up.
In fact after all I have seen about this one as one out of at least four solutions for PATH it beats all the others on at least the term or functionality.
And of course MX Xfce users deserve the very best.! :-)
In the script I write: "# This file might later be overwritten by MX update or a MX-tool."
That is extremely unlikely, and we all keep backups. I mostly wrote it to make sure this script is not in the way for it.
Edit1: Path to the file we don't have has been corrected to make it easier to understand.