You are not logged in.
Currently I have zsh with powerlevel10k setup, but on my several attempts to install it I did run at some point sudo chsh -s /usr/bin/zsh (with sudo, as I thought at the time that's why it doesn't work). Anyhow, I did setup eventually zsh with powerlevel10k, but when I use su/sudo I get zsh with no configuration. I checked the path of the $SHELL for the user and root and it's the same, the .zshrc file is only one across the system at ~/.zshrc.
Can I fix this somehow instead of reinstalling?
Last edited by magnicu (2024-05-29 08:20:38)
Offline
You have to install it for root to.
sudo su # run the following commands in that shell
chsh -s /usr/bin/zsh root
## install powerlevel10kIt's only installed for you user, e.g. your_user's_home/.zshrc
there's nothing in /root/.zshrc, which sudo su reads.
Alternatively, you can also add the line to /etc/zsh/zshrc
echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' | sudo tee -a /etc/zsh/zshrc(assuming you installed the arch package)
This will install it for all users.
Can I fix this somehow instead of reinstalling?
that won't help at all, you'll have the same problem after too.
Last edited by jl2 (2024-05-27 13:40:20)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
Thanks, I cloned it instead of installing the package, but I managed to add the correct path to /etc/zsh/zshrc as you suggested and it worked, but I needed to reconfigure it again for the root.
I have one question though, when I'm as a user, the indicator is showing "~", but with root, I get my user name as "/home/user" - is this supposed to be like that?
Offline
~/ = /home/$USER/ = $HOME/
In sudo su, it changes the home directory
~/ = $HOME/ = /root/
This is likely due to sudo su not changing the directory, even though it should?
could you paste the output of $PWD or pwd (while as root, no cd?)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
Why should it?
But
sudo -i will and incidentally that is what one always should™ to to log into a root shell using sudo ![]()
Online
The $PWD is /home/user for both my user and root with su.
The sudo -i gives me the same "~" as with regular user, but the $PWD is actually /root.
seth, is sudo -i is the same as su - ?
And why is it not enough to use just su, even though it gives an access to use shell as root?
Offline
seth, is sudo -i is the same as su - ?
And why is it not enough to use just su, even though it gives an access to use shell as root?
Yes and it is, using sudo instead of su allows sudoers rules to be applied etc. but superficially it's equivalent.
Online
Thanks
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.
Online
Will do
Offline