chris-marsh / pureline

A Pure Bash Powerline PS1 Command Prompt
MIT License
507 stars 95 forks source link

Installation for all users? #23

Open CRCinAU opened 5 years ago

CRCinAU commented 5 years ago

Is there any hints / howto on how to install this for all users?

I would get that the source should exist in /etc/profile.d/something

Then install under /usr/local? or /opt?

CRCinAU commented 5 years ago

For what its worth, I got this running by doing a git clone into /opt.

Then, create file as /etc/profile.d/pureline.sh

if [ -f ~/.pureline.conf ]; then
    source /opt/pureline/pureline ~/.pureline.conf
else
    source /opt/pureline/pureline /opt/pureline/configs/powerline_full_256col.conf
fi

This can probably have a bit more tweaking, but will import the default config if no config is provided. It also allows each user to customise their own prompt.

chris-marsh commented 5 years ago

Yep your right, PureLine should have a proper installation method. I'm going to try and commit a bit more time to the project and aim for a feature freeze and stable release. Then it should easier to work on distro packages to install system wide.

max06 commented 1 year ago

I've just tried this - with not very much success.

    # source external segments
    local segment_dir
    segment_dir=$(dirname "${BASH_SOURCE[0]}")'/segments'

Sourcing /opt/pureline/pureline fails to load the segments, since ${BASH_SOURCE[0]} points to /etc/profile.d/pureline.sh.

Is there a better way?

(Instead of sourcing 2 files, I just source pureline in the profile script and directly add the configuration content afterwards.)

max06 commented 1 year ago

Nevermind... Adding my config into the profile-script instead of sourcing it was my mistake.

Out of interest... can someone explain me the difference between

source a.sh b.sh

and

source a.sh
source b.sh

? 😅