I see what's going on.... ::facepalm::
If you take a look at your first screenshot in
post #27 above - the file you have open is
/root/.xinitrc
!!
So what happened there is:
Because you used
sudo
when you copied the
xinitrc
file from
/etc/X11/xinit/xinitrc
to
~/.xinitrc
- you were acting as root, so it copied the file to the root users home directory at
/root/.xinitrc
instead of
/home/alex/.xinitrc
.
In my first post, I recommended copying the file using
cp
and I deliberately made
no mention of using
sudo
because it was
absolutely not necessary to do so.
@wizardfromoz muddied the waters by recommending using
sudo
and I responded with a long post on why using
sudo
was a terrible idea in this instance. (and it turned out to be a slightly worse idea than I actually thought it was!)
With your later post, when you said you couldn't find
.xinitrc
, I just assumed you didn't know that you were dealing with a hidden config file.
However, I'd actually forgotten that if you use the
~
shortcut when logged in as root, or using
sudo
, it expands to
/root/
. So if you used
@wizardfromoz 's
sudo cp
suggestion, then yes - it all makes sense now. You copied the .xinitrc file as root to roots home at
/root/
, NOT to your personal directory. Which is why it was not there!
And when you used
sudo nano ~/.xinitrc
you ended up opening the copy of
.xinitrc
that you accidentally copied to
/root/
! Ha ha!
So I will say it one, hopefully final time:
Whilst logged in as a
normal user NOT ROOT and
definitely NOT using
sudo
- copy the fallack
xinitrc
file to
your home directory, as I originally recommended.
e.g.
Bash:
cp /etc/X11/xinit/xinitrc ~/.xinitrc
And then make your edits.
Or - Alternatively, because you've already made the changes to the version in roots home directory - you could use
sudo mv
to move the file from
/root/
to
/home/yourusername/
and then use
sudo chown
to give you ownership of the file.
e.g.
Bash:
sudo mv /root/.xinitrc /home/alex/.xinitrc
sudo chown alex:alex /home/alex/.xinitrc
That will move your edited
.xinitrc
from
/root/
to
/home/alex/
Pick one of those two solutions and that should fix things!