himanshub16 / ProxyMan

Configuring proxy settings made easy.
https://github.com/himanshub16/ProxyMan/releases/latest/
MIT License
683 stars 108 forks source link

Setting/un-setting environment variables for proxy not working #78

Closed abhisekch closed 4 years ago

abhisekch commented 5 years ago

I tried to install the latest version in my Manjaro 18.0.4 XFCE. To install it successfully, I had to add "$HOME/.local/bin" to $PATH. After installation, when I tried to unset the proxy (I use proxy by editing "/etc/environment" file), it showed this error: bash: environment.sh: No such file or directory When I checked $HOME/.proxyman/, indeed there was no environment.sh file. How do I resolve this? I have been using ProxyMan 2.5 for quite some time, never faced this problem there.

EDIT: Adding screenshot of the same Screenshot_2019-03-13_16-12-17

himanshub16 commented 5 years ago

Oh! Sorry @abhisekch 😞

environment.sh not found This happened because I had merged the implementation of bashrc, zshrc and /etc/environment to single file - shellrc.sh, and (bash-zsh.sh)[https://github.com/himanshub16/ProxyMan/blob/master/bash-zsh.sh] takes care of required target. However, I missed integrating /etc/environment to the implementation.

My bad. I shall fix this soon.

himanshub16 commented 5 years ago

Also, many have reported to have issues with ~/.local/bin not being there in $PATH This answer states more about the problem.

A solution would be to either have it at ~/bin or don't have it (as earlier). Thoughts?

abhisekch commented 5 years ago

Although it is quite obvious that ~/bin will be available generally in the $PATH variable, according to this answer, it would be available only if the folder exists (but, again, it's quite an outdated answer, so there's no harm in assuming that this folder will definitely exist). So as a more foolproof implementation, I would suggest taking a folder that is available in $PATH rather than hard-coding something.

Taking the output of echo $PATH into a variable, and then splitting it by : and taking the first available folder as TARGET_DIR and then proceeding as usual. That would remove any chances of the program not being able to be installed properly. Please correct me if I went wrong somewhere :sweat_smile:

nathanbrizzee commented 5 years ago

Oh! Sorry @abhisekch 😞

environment.sh not found This happened because I had merged the implementation of bashrc, zshrc and /etc/environment to single file - shellrc.sh, and (bash-zsh.sh)[https://github.com/himanshub16/ProxyMan/blob/master/bash-zsh.sh] takes care of required target. However, I missed integrating /etc/environment to the implementation.

My bad. I shall fix this soon.

Hi, I just downloaded the script and I still get the error with environment.sh missing. Do you have an update on when it might be fixed?

danielemegna commented 4 years ago

Any update on this? Could I try to submit a pull request reviewing environment.sh from the 2.5 version?

danielemegna commented 4 years ago

Fixed with https://github.com/himanshub16/ProxyMan/pull/89 🎉