diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/zshfunctions | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index fb24fee..4a7f0b9 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -1,11 +1,13 @@ -# Nice mappings to restart/... the services -Start Stop Reload Restart () -{ - local SUDO +if [[ -n $_IS_GENTOO ]]; then + # Nice mappings to restart/... the services + Start Stop Reload Restart () + { + local SUDO - [[ $UID != 0 ]] && SUDO="sudo" - $SUDO /etc/init.d/$1 ${0:l} -} + [[ $UID != 0 ]] && SUDO="sudo" + $SUDO /etc/init.d/$1 ${0:l} + } +fi # Quick find f() @@ -20,18 +22,6 @@ zman() { PAGER="less -g -s '+/(?i)^ "$1"'" man zshall } -# Change to the directory of a specific package -_cdu () -{ - cd ${1:h} -} - -# unpacks a specific package -_unpack () -{ - ebuild $1 clean unpack -} - check_libs() { local pmapc=" @@ -101,31 +91,45 @@ PROG esac } -# set job count to 1 if there is only one package to install -emerge() -{ - if [[ $# < 3 ]]; then - command emerge --jobs=1 $@ - else - command emerge $@ - fi -} +if [[ -n $_IS_GENTOO ]]; then + # Change to the directory of a specific package + _cdu () + { + cd ${1:h} + } -# keyword a specific package using flaggie -# relies on the $_kw variable set in .zshenv -kw() -{ - if [[ -z $1 ]]; then - echo "Error: Need the package" - return 1 - fi - - if whence flaggie NOE; then - # use 'flaggie' - flaggie $1 "+$_kw" - else - echo "Error: flaggie not installed" - echo "Do it yourself!" - return 1 - fi -} + # unpacks a specific package + _unpack () + { + ebuild $1 clean unpack + } + + # set job count to 1 if there is only one package to install + emerge() + { + if [[ $# < 3 ]]; then + command emerge --jobs=1 $@ + else + command emerge $@ + fi + } + + # keyword a specific package using flaggie + # relies on the $_kw variable set in .zshenv + kw() + { + if [[ -z $1 ]]; then + echo "Error: Need the package" + return 1 + fi + + if whence flaggie NOE; then + # use 'flaggie' + flaggie $1 "+$_kw" + else + echo "Error: flaggie not installed" + echo "Do it yourself!" + return 1 + fi + } +fi |