You are not logged in.
I have this line in my .zprofile file
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"but when I type echo $PATH I cannot see /.local/bin in my $PATH
Why?
Last edited by b42 (2023-10-16 14:06:57)
Offline
.zprofile is only sourced by your zsh login shell, if you don't run it as login shell (eg. b/c you're usign some DM) it's inert.
In what context do you want the extended PATH? Interactive shells? => ~/.zshrc
Offline
zsh is my default shell.
what do you mean by login shell?
a prompt to log in with a user?
Offline
https://man.archlinux.org/man/extra/zsh/zshall.1.en but agetty will typilcally get you a loginshell
Running a TE (eg. konsole) in a DE (eg. plasma) will *not*.
Whether or not zsh is your default shell is irrelevant.
Offline
here is my full .zprofile file:
Offline
Who cares.
Unless you're using zsh as login shell it's a completely inert file, use the zshrc if you want to extend the path for your user only and only in interactive zshells
If you want to see whether it's sourced "export FOO=BAR" so you can check for "echo $FOO"
Offline
echo $FOO returns nothing
Offline
echo $FOO returns nothing
Then you agree ~/.zprofile is not being sourced for your use case? Why not follow seth's advice to move the entry to ~/.zshrc? See also Zsh#Startup/Shutdown_files.
Offline
I want to keep my zshrc as clean as possible. that is why I have zprofile file for env variables. How do I source it?
Offline
You don't. You'd use zsh as login shell but that's apparently (you've failed to comment on that at all) not the case.
If you want those exports only in zsh, you can use ~/.zshenv (maybe read the linked manpage…) - otherwise you put it into the proper location for the relevant context, https://wiki.archlinux.org/title/Environment_variables
Offline
how do I make zsh my login shell?
Offline
By running it as login shell…
This is cyclic. How do you login/start your session to begin with?
Offline
I log in via default Arch Linux terminal to my user
Offline
grep $USER /etc/passwd # there's no password in that Offline
dwm:x:1000:1000::/home/dwm:/bin/zsh
Offline
Does your zprofile trigger startx?
What does the environment look like when you skip that?
Offline
no it does not because zprofile is not triggered at all
I run startx myself after I log in
Offline
What is the output of `printenv` after you log in before you execute anything else?
Offline
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
EDITOR=vim
XDG_SEAT=seat0
PWD=/home/dwm
LOGNAME=dwm
XDG_SESSION_TYPE=tty
SYSTEMD_EXEC_PID=5282
XAUTHORITY=/home/dwm/.Xauthority
WINDOWPATH=1
MOTD_SHOWN=pam
HOME=/home/dwm
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/system.slice/system-getty.slice/getty@tty1.service/memory.pressure
INVOCATION_ID=4e595e962910421a9818822ab23ff8e5
XDG_SESSION_CLASS=user
TERM=st-256color
LESS_TERMCAP_mb=
LESS_TERMCAP_me=
LESS_TERMCAP_md=
ZDOTDIR=/home/dwm/.config/zsh
USER=dwm
DISPLAY=:0
SHLVL=3
LESS_TERMCAP_ue=
LESS_TERMCAP_us=
XDG_VTNR=1
XDG_SESSION_ID=7
XDG_RUNTIME_DIR=/run/user/1000
QUOTING_STYLE=literal
DEBUGINFOD_URLS=https://debuginfod.archlinux.org
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/dwm
OLDPWD=/home/dwm
WINDOWID=10485766
_=/usr/bin/printenvLast edited by b42 (2023-10-15 17:45:46)
Offline
ZDOTDIR=/home/dwm/.config/zshWhere's your .profile located?
TERM=st-256colorafter you log in before you execute anything else
![]()
And why is $SHELL not set?
There's something massively fishy with that config.
Offline
seems like I do not have a .profile file.
as for $SHELL, when I do echo $SHELL it gives /bin/zsh so $SHELL must be set
Offline
I meant ".zprofile", sorry (though could have been obvious) and there's no way that you can echo $SHELL but it doesn't show up in printenv. Did you edit the output?
Offline
.zprofile is located in /home/dwm directory
No I did not edit anything
Offline
… and what is your zdotdir?
Not even ~/.zshrc should be sourced w/ that setup.
Offline
~/.config/zsh
Offline