From a64e38b30534b300748b8e2d8864c55bdfe6278a Mon Sep 17 00:00:00 2001 From: crater2150 Date: Sun, 11 Mar 2018 12:18:44 +0100 Subject: [PATCH] Updates --- aliases/portage | 49 +------------------------------------------ aliases/void | 17 +++++++++++++++ compdef/_sv-manage | 8 +++++++ modules/bindings/init | 4 ++-- zprofile | 5 ----- 5 files changed, 28 insertions(+), 55 deletions(-) create mode 100644 compdef/_sv-manage diff --git a/aliases/portage b/aliases/portage index c5cf2ea..e635519 100644 --- a/aliases/portage +++ b/aliases/portage @@ -3,7 +3,7 @@ grep -q "gentoo" /etc/os-release || return lesswrap eix -F -alias eud="emerge -vabuDUN -j4 --keep-going world" +alias eud="emerge -vabuDUN --with-bdeps=y --backtrack=300 -j4 --keep-going world" alias fetchlog="tail -f /var/log/emerge-fetch.log" alias emerge="noglob sudo -i emerge" @@ -28,50 +28,3 @@ gpo-get() { cd "$1/${basename}" ebuild $name digest } - -nolto() { - pkgenvconf $1 nolto nolto -} - -notmpfs() { - pkgenvconf $1 notmpfs notmpfs -} - -noaggressive() { - pkgenvconf $1 noaggressive noaggressive -} - -nographite() { - pkgenvconf $1 nographite nographite -} - -onlysafe() { - pkgenvconf $1 onlysafe onlysafe -} - -cflags_reset() { - if [ -n "$1" ]; then - for i in \ - /etc/portage/package.env/noaggressive \ - /etc/portage/package.env/nographite \ - /etc/portage/package.env/nolto; do - sed -i "/$1/d" $i; - done - fi -} - -pkgenvconf() { - ltoline="$1 $2.conf" - echo -e '\e[1mInsert following line into package.env/'$2'?\e[0m' - echo "$ltoline" - echo "Looking for matching lines..." - grep $1 /etc/portage/package.env/$3 - echo -e -n '\e[1m[y/n] \e[0m' - read answer - case "$answer" in - yes|y|YES|Yes|Really|"why not") - echo "$ltoline" | sudo tee -a /etc/portage/package.env/$3 - ;; - *) ;; - esac -} diff --git a/aliases/void b/aliases/void index 318f62b..da7defd 100644 --- a/aliases/void +++ b/aliases/void @@ -19,3 +19,20 @@ sv() { command sv check "$@" fi } + +sv-manage() { + action=$1 + shift + case "$action" in + add) + for service in "$@"; do + ln -s /etc/sv/${service:s#/##} /var/service + done + ;; + remove|rm) + for service in "$@"; do + rm /var/service/${service:s#/##} + done + ;; + esac +} diff --git a/compdef/_sv-manage b/compdef/_sv-manage new file mode 100644 index 0000000..c7ae698 --- /dev/null +++ b/compdef/_sv-manage @@ -0,0 +1,8 @@ +#compdef sv-manage + +typeset -A opt_args +local context state line + +_arguments \ + "1:Action:(add rm remove)"\ + "*:service:_files -W /etc/sv" diff --git a/modules/bindings/init b/modules/bindings/init index cdeb385..835076b 100644 --- a/modules/bindings/init +++ b/modules/bindings/init @@ -52,10 +52,10 @@ bindkey -s "^F" "fuck\n" # Finally, make sure the terminal is in application mode, when zle is # active. Only then are the values from $terminfo valid. local function zle-line-init () { - echoti smkx + echoti smkx 2> /dev/null } local function zle-line-finish () { - echoti rmkx + echoti rmkx 2> /dev/null } zle -N zle-line-init zle -N zle-line-finish diff --git a/zprofile b/zprofile index b62a7a9..aa96b0a 100644 --- a/zprofile +++ b/zprofile @@ -26,11 +26,6 @@ export XDG_DATA_HOME="$HOME/.local/share" # 077 would be more secure, but 022 is generally quite realistic umask 022 -PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}:$PATH" - -export PATH -unset ROOTPATH - shopts=$- set -$shopts unset sh shopts