Customize manjaro-zsh-config

What’s the right way to add alias’s and otherwise customize the official manjaro-zsh-config install? From what I see it’s all found in /usr/share/zfs which is owned by root. Do I just add my changes to those files as sudo? Wouldn’t that make it system-wide?

Another issue is when I try and change the default p10k theme by running “p10k configure” it fails with “[ERROR] p10k configure: cannot create /usr/share/zsh/p10k.zsh because /usr/share/zsh is readonly”, which is related to my original issue.

I really like the work on this package btw! I just need to customize it a bit.

Thanks in advance!

2 Likes

Hi @Aeolus, and welcome!

Anny customization for zsh is done per-user, and thus in the user’s home directory, in a file called .zshrc:

$ nano ~/.zshrc

In this file, you can set the specified aliases.

alias tmuxs='tmux new -s'

Also have a look at the oh-my-zsh plugin.

3 Likes

Thanks @Mirdarthos! Does this work the same for themes as well?

I use that oh-my-zsh for customization, and that includes themes, so I don’t know of other ways.

Thanks for the help!

You’re very welcome!

DId you follow the instructions?

echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
1 Like

I’m getting the exact same error, p10k configure: cannot create /usr/share/zsh/p10k.zsh because /usr/share/zsh is readonly

This is with the powerlevel10k setup that is now pre-installed on the latest ISO. On Gnome, opening a terminal from first boot goes straight to a custom p10k prompt. On Plasma I just have to use chsh.

This I love because it saves me setting it up from scratch, but if I want to reconfigure, the above error message appears.

3 Likes

i had the same error “p10k configure: cannot create /usr/share/zsh/p10k.zsh because /usr/share/zsh is readonly” when it tried to configure powerlevel10k.

what i did was, open /usr/share/zsh/manjaro-zsh-prompt

look for (line 15):
[[ ! -f /usr/share/zsh/p10k.zsh ]] || source /usr/share/zsh/p10k.zsh

change it into:
# [[ ! -f /usr/share/zsh/p10k.zsh ]] || source /usr/share/zsh/p10k.zsh

then save manjaro-zsh-prompt, open your konsole and it will prompt to configure powerlevel10k. this will create a .p10k.zsh file in your home directory and modify your .zshrc

if you need to make changes, you can now use “p10k configure”

if you like to use the stock config of manjaro-zsh-config, copy /usr/share/zsh/p10k.zsh file to you home directory, replacing .p10k.zsh

if there is something wrong with what i did, kindly correct me, im still new(noob). btw, im using manjaro kde plasma.

10 Likes

Thanks a lot! It works for me. I am now using Manjaro 21.0.2 Ornara with KDE Plasma 5.21.4.

How I can customize ZSH colors? Manjaro ZSH colors is not best. It need more contrast.

With p10k configure. See:

Hi! I run into the same thing every time I do an install, my workaround for a system wide configuration is change file ownership & permissions temporarily, be careful though chown & chmod recursively can mess up your system:

#altering read, write & execute permissions
sudo chmod 775 /usr/share/zsh

#altering ownership of directory & file
sudo chown myusername:myusername /usr/share/zsh
sudo chown myusername:myusername /usr/share/zsh/p10k.sh
#then run p10k configure, and let it overwrite /usr/share/zsh/p10k.sh
p10k configure
#reverting to original 
sudo chmod 755 /usr/share/zsh
sudo chown root:root /usr/share/zsh
sudo chown root:root /usr/share/zsh/p10k.sh

for root to use zsh, which will not mess up other processes relying on bash @ root level:

#Add the following to the end of /root/.bashrc
if [ ! -z "$PS1" ]; then
    exec /bin/zsh $*
fi 

thought I’d share
cheers