diff options
author | John Turner <jturner.usa@gmail.com> | 2025-07-17 16:56:13 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-07-17 16:57:31 -0400 |
commit | bb020f110c2526d5dd446e7a1a071e269880b71c (patch) | |
tree | dc94f4bf277194ef2a87569fe6514dcd1b44e323 /functions.zsh | |
download | zshrc-bb020f110c2526d5dd446e7a1a071e269880b71c.tar.gz |
init
Diffstat (limited to 'functions.zsh')
-rw-r--r-- | functions.zsh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/functions.zsh b/functions.zsh new file mode 100644 index 0000000..b068b3c --- /dev/null +++ b/functions.zsh @@ -0,0 +1,30 @@ +if [[ ${UID} = 0 ]]; then + return +fi + +if [[ -f /lib/gentoo/functions.sh ]]; then + source /lib/gentoo/functions.sh +fi + +wl-clear() { + wl-copy --clear + wl-copy --primary --clear +} + +with-userns() { + if [[ ${1} =~ '^[0-9]+$' ]]; then + local id="${1}" + shift + else + local id="0" + fi + unshare --keep-caps --map-auto -S "${id}" -G "${id}" "$@" +} + +eunpack() { + env PORTAGE_USERNAME=${USER} \ + PORTAGE_GRPNAME=${USER} \ + FEATURES="unprivileged" \ + PORTAGE_TMPDIR="${2:-.}" \ + ebuild $(equery which "${1}") clean unpack +} |