You are not logged in.
For some applications that I install, they create a literal folder called '$HOME' in the install directory rather than actually referencing the $HOME bash variable. As a result, files that should go in my ~/.config actually go to <random install location>/'$HOME'/.config. Why would applications do this, and how do I prevent them from doing so? I think this is the root of many weird problems on my system.
Last edited by origamisith (2021-05-28 20:04:29)
Offline
What do you mean by "the install directory"? Do you mean the current working directory when you run the program?
In any case, the problem is most likely bad quoting in one of your shell rc / profiles. So post those. Or a quick check with these commands:
sudo find /etc -type f -exec grep '$HOME' '{}' \+ 2>/dev/null
grep '$HOME' /home/$USER/*
Perhaps the most likely possibility (though a bit of a guess) is that you've recently tried to set some XDG_ variables, and you did so with a single-quoted '$HOME'.
Last edited by Trilby (2021-05-27 21:22:40)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
The output of
sudo find /etc -type f -exec grep '$HOME' '{}' \+ 2>/dev/null
is
https://pastebin.com/DAZd6pvY
The only thing that looks suspcious to me here is a file I didn't know existed, /etc/environment, whose sole contents are:
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
XDG_CONFIG_HOME=$HOME/.config
Could this break anything? It would make sense if this is the file breaking everything, because I've had config file problems from the beginning of my installation so I do not think I personally misspelled anything in any bash files that could cause these problems.
According to
sudo find . -name '$HOME' | wc -l
there are 85 folders called '$HOME' on my system. Here are all of them: https://pastebin.com/EkVpC39C.
(edit: this list is significant because I have had problems with polybar, IntelliJ Idea, Steam, Origin, OBS plugins, and they all link back to a misplaced config file)
Here is my /etc/bash.bashrc (equivalent to /etc/skel/.bashrc except for one alias): https://pastebin.com/6HVxNiJ5
My /home/$USER/.bashsrc: https://pastebin.com/gPGgUyAb
Last edited by origamisith (2021-05-27 23:03:13)
Offline
/etc/environment is empty (comments only) on a default installation. The comments say it's parsed by pam_env, not a shell; it may not understand $HOME
Last edited by Scimmia (2021-05-27 23:01:05)
Offline
Wow.
I've been existing in this broken install for 9 months now.
It's finally fixed. It was all because of /etc/environment not following the syntax described at https://wiki.archlinux.org/title/environment_variables
Chromium works without crashing after 2seconds. Fonts are changing. (some fonts are totally messed up now lol I can't even see numbers).
I won't ever have to worry about manually resetting the JDK path for IntelliJ again
OBS plugins work
I can actually install games with Lutris
I won't have to manually specify the directory of config files for launching i3, polybar, and picom in my .xinitrc
Nature is healing.
And I believe I can boldly pipe my entire list of '$HOME' clones into a good old fashioned rm -rf command (if I figure out how to safely)
Last edited by origamisith (2021-05-27 23:32:00)
Offline
It was all because of /etc/environment not following the syntax described at https://wiki.archlinux.org/title/environment_variables
Right from that page:
/etc/environment is used by the pam_env module and is shell agnostic so scripting or glob expansion cannot be used.
And
@{HOME} and @{SHELL} are special variables that expand to what is defined in /etc/passwd. The following example illustrates how to expand the HOME environment variable into another variable:
XDG_CONFIG_HOME DEFAULT=@{HOME}/.config
Note: The variables ${HOME} and ${SHELL} are not linked to the HOME and SHELL environment variables, they are not set by default.
Last edited by Trilby (2021-05-28 01:19:21)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Yes, I understand that now. This syntax is what I used to fix the problem. However, I do not recall ever editing this file in the first place. Maybe I did somehow, but again, I did not even know the file existed until today. I remember things started breaking within the first few hours of my install. I don't think I would have manually changed /etc/environment with an XDG variable before even configuring a window manager, given that I was new to Arch. Maybe I did somehow. I'm grateful for the help either way.
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline