3 ms·
I'm going to pull a Jedi mind trick here... <waves hand> There is no problem with editing environment variables in Linux. <waves hand> You're going to go back
by riskable 11y ago
I'm going to pull a Jedi mind trick here...
<waves hand> There is no problem with editing environment variables in Linux.
<waves hand> You're going to go back to your terminal and re-think how you use environment variables.
Seriously, nobody has this problem on Linux desktops because folks usually--if they're going to mess with environment variables at all--they're going to do it right after getting a new home directory (i.e. a new desktop where logging out and back in one time isn't a concern) or they're going to set them in a script of some sort. As in, start_server.sh or, "oh fuck this I'll just write a small shell script that sets PATH and launches what I want" which is perfectly normal and reasonable; if your application needs certain environment variables set to function properly why would you want to leave such things to chance? Just set it in the script that launches your app.
Unlike Windows, a Linux desktop has no mandatory distinction between a shell script and a binary in order for it to be executed. If it's set as executable it's executable; simple as that. The user probably won't know or care that /usr/bin/yourapp is really a shell script that sets up some environment variables before launching /opt/you/bin/youractualapp
Not only that but you don't have to log out and log back in--that's just the cop-out, "I'm lazy" way of applying such changes to your desktop. You could just restart your launcher. I use KDE's Plasma desktop so that would be:
killall plasmashell
kstart plasmashell
If you're SSH'd into your Linux box it's even easier: . ~/.bashrc