diff --git a/README.md b/README.md index ac151af..14d37e0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ -# expand-user-path +# Expand user's PATH +- Expands `PATH` variable for each user; Adds user-specific `$HOME/.local/bin` to `PATH`. + +## Installation + +``` +git clone https://fjordtek.com/git/Fincer/expand-user-path + +``` + +**NOTE**: You need to re-login into your shell to see changes. + +### Manually + +Place [user-path.sh](files/user-path.sh) into `/etc/profile.d/` folder. + +### Arch Linux + +Get [PKGBUILD](files/PKGBUILD) and [user-path.sh](files/user-path.sh). Run `updpkgsums && makepkg -i`. + +## License + +See [LICENSE](LICENSE). diff --git a/files/PKGBUILD b/files/PKGBUILD new file mode 100644 index 0000000..0a55abd --- /dev/null +++ b/files/PKGBUILD @@ -0,0 +1,17 @@ +pkgname=expand-user-path +pkgver=1 +pkgrel=1 +pkgdesc='Expand PATH variable. Set user-wide PATH $HOME/.local/bin for each user' +arch=('any') +url='https://fjordtek.com/git/Fincer/expand-user-path' +license=('GPL') +depends=() +makedepends=() +source=( + 'user-path.sh' +) +md5sums=('267d50bda049aadfa942e8329e114bae') + +package() { + install -Dm 644 -t "$pkgdir/etc/profile.d/" *.sh +} diff --git a/files/user-path.sh b/files/user-path.sh new file mode 100644 index 0000000..07fd60c --- /dev/null +++ b/files/user-path.sh @@ -0,0 +1,18 @@ +# Copyright © 2020 Pekka Helenius + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Not home? +[ -n "$HOME" ] || return 0 +export PATH="$HOME/.local/bin:$PATH"