You are not logged in.
Hi everyone, yesterday this problem occured from nowhere and I'm unable to fix it on my own so I thought maybe someone could help me.
So on my ".zshrc" I'm adding my "~/.scripts" folder to the path like this: "export PATH=$PATH:$HOME/.scripts" so on my terminal (urxvt) I can run my scripts without entering full path. But from outside of terminal, like my i3 config, dmenu, xbindkeys and so on they are not working and I have to type full path in order to get them working. So while I can just type "screenshot" on my terminal, I can't do that on dmenu. My system is up to date and working perfectly fine except this issue.
Last edited by menfie (2017-06-01 13:04:47)
Offline
How do you start i3? With xinit/startx, or with a display manager?
In general, it is recommended to export variables in .zprofile, otherwise you'll keep appending paths to $PATH each time you spawn a new shell from within a shell.
Offline
Ok, I moved the export Path to ".zprofile". I'm starting i3 with nvidia-xrun. I have "exec i3" inside ".nvidia-xinitrc" file like this: https://pastebin.com/Fw6qmS1G
Offline
Note that you will need to log out and in again after applying those changes.
Also, from a quick glance at that nvidia-xinitrc, it seems that your personal xinitrc is not supposed to look like that—have you simply copied /etc/X11/xinit/nvidia-xinitrc to your home? Then again, I don't get why the project provides a global xinitrc like that...
Last edited by ayekat (2017-06-01 12:09:40)
Offline
Moving export Path to .zprofile is worse... Now whenever I login or open a new terminal I have to type export manually because it's not exporting... And on web I saw everyone suggesting ".zshrc" instead of ".zprofile".
Note that you will need to log out and in again after applying those changes.
Also, from a quick glance at that nvidia-xinitrc, it seems that your personal xinitrc is not supposed to look like that—have you simply copied /etc/X11/xinit/nvidia-xinitrc to your home? Then again, I don't get why the project provides a global xinitrc like that...
I can't remember what I did back in the time but they look identical except I'm running i3. This is not something new I did it was like that before.
Last edited by menfie (2017-06-01 12:19:19)
Offline
.zshrc is not the place to export variables. Especially not PATH (for reasons noted above). And on the web, people can suggest all sorts of things.
Please paste the output of these commands, after you log in on the TTY:
echo $PATH
ls -ld ~/.scriptsAlso, please post your .zprofile. If exporting PATH in there does not work, it means that some other file overwrites it later on during login.
Offline
Okay, it was a typo (I had typed .script instead of .scripts) but still it works after the login but when I open a new terminal on X11 it's not.
Here is the outputs on a new tty: https://pastebin.com/jrTgqGbw
And this is on a terminal: https://pastebin.com/3vZcAnmX
.zshrc: https://pastebin.com/KACWWLNz
.zprofile: https://pastebin.com/04cnYeEJ (I'm using auto login so it directly run X11)
Last edited by menfie (2017-06-01 12:31:36)
Offline
if [ $(tty) = /dev/tty1 ]; then nvidia-xrun fi export PATH=$PATH:$HOME/.scripts
Ah! This explains it. You're running X before exporting the PATH variable.
Put the export before the nvidia-xrun lines and see if that works.
Also, (this is not very important, but) may I quote our overlord? ![]()
Pastebin.com is swamped with advertisements and random captchas. Malware found on pastebin.com has resulted in it being blocked for some users. It injects CRLF line-endings. Please, use something else. Use something sane like https://ptpb.pw https://gist.github.com https://bpaste.net https://ix.io
Last edited by ayekat (2017-06-01 12:44:14)
Offline
menfie wrote:if [ $(tty) = /dev/tty1 ]; then nvidia-xrun fi export PATH=$PATH:$HOME/.scriptsAh! This explains it. You're running X before exporting the PATH variable.
Put the export before the nvidia-xrun lines and see if that works.
Now the terminal is perfectly fine! But I still can't run my scripts outside of my terminal without full path
There must be something I have done wrong while working on auto login...
Offline
Not sure for the other applications, but dmenu_run keeps a cache file that is only updated if any of the files in $PATH are newer than the cache itself. Try removing .dmenu_cache (or $XDG_CACHE_HOME/dmenu_run), then running dmenu_run again.
To test if dmenu_run sees the right PATH, you can run this:
echo $PATH > blablaThe generated ~/blabla contains PATH as seen by dmenu_run.
Offline
"rm ~/.cache/dmenu_run" worked! Now dmenu can run my scripts, thanks to you! I think I can live with that since I don't think there is a way to fix every single app like this.
Edit: Suprisingly i3 is also fixed! Thank you again.
Last edited by menfie (2017-06-01 13:04:19)
Offline