From 84f373435320f6102ce60c7ce624b078f480d06c Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 10 Oct 2017 11:38:12 +0200 Subject: [PATCH] - renamed to over-env - removed garbage - added install.sh --- dotfiles/deploy-dotfiles.zsh | 17 ------ ebuild/over-prompt-9999.ebuild | 70 ---------------------- cfg/main.cfg => etc/over-env/prompt.cfg | 0 {dotfiles/system/etc => etc}/screenrc | 0 {dotfiles/system/etc => etc}/screenrc.over | 0 {dotfiles/system/etc => etc}/zsh/zprofile | 0 {dotfiles/system/etc => etc}/zsh/zshrc | 4 +- install.sh | 11 ++++ share/zsh-init => lib/prompt-init | 4 +- libexec/render.py => lib/prompt.py | 0 10 files changed, 15 insertions(+), 91 deletions(-) delete mode 100755 dotfiles/deploy-dotfiles.zsh delete mode 100644 ebuild/over-prompt-9999.ebuild rename cfg/main.cfg => etc/over-env/prompt.cfg (100%) rename {dotfiles/system/etc => etc}/screenrc (100%) rename {dotfiles/system/etc => etc}/screenrc.over (100%) rename {dotfiles/system/etc => etc}/zsh/zprofile (100%) rename {dotfiles/system/etc => etc}/zsh/zshrc (98%) create mode 100755 install.sh rename share/zsh-init => lib/prompt-init (85%) rename libexec/render.py => lib/prompt.py (100%) diff --git a/dotfiles/deploy-dotfiles.zsh b/dotfiles/deploy-dotfiles.zsh deleted file mode 100755 index 5d26640..0000000 --- a/dotfiles/deploy-dotfiles.zsh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/zsh - -SRCDIR="$1" -DESTDIR="$2" - -pushd "${SRCDIR}" > /dev/null - find . -type d | while read P - do - mkdir -p "${DESTDIR}/${P[3,-1]}" - done - - find . -type f | while read P - do - P="${P[3,-1]}" - cp -bv "${P}" "${DESTDIR}/${P}" - done -popd > /dev/null diff --git a/ebuild/over-prompt-9999.ebuild b/ebuild/over-prompt-9999.ebuild deleted file mode 100644 index d783db7..0000000 --- a/ebuild/over-prompt-9999.ebuild +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI=5 - -inherit git-2 - -DESCRIPTION="A nonintrusive zsh prompt that provides useful data like pwd, git info and system stats to the user." - -HOMEPAGE="https://git.covalent.cz/overwatch/over-prompt" -SRC_URI="" -EGIT_REPO_URI="https://git.covalent.cz/overwatch/over-prompt.git" - -LICENSE="AOJSL" -SLOT="0" -KEYWORDS="x86 amd64" -IUSE="+dotfiles +tools" - -RDEPEND=" - tools? ( dev-python/psutil )" - -src_compile() { - ewarn "This is a prototype written in Python. Expect lower performance." - #g++ -ansi -Wall -o data data.cpp -} - -src_install() { - if use tools; then - for b in bin/* - do - dobin "${b}" - done - - for sb in sbin/* - do - dosbin "${sb}" - done - fi - - insopts -m755 - - insinto /usr/libexec/ - newins libexec/render.py ${PN}.py - - insinto /usr/share/${PN}/ - doins share/zsh-init - - if use dotfiles; then - pushd dotfiles > /dev/null - - einfo "Installing dotfiles." - zsh deploy-dotfiles.zsh system "${D}" - - popd > /dev/null - fi - - insopts -m644 - - insinto /etc/${PN}/ - doins cfg/main.cfg - - insinto /usr/share/i18n/locales/ - doins locale/en_OV -} - -pkg_postinst() { - einfo "Source /usr/share/${PN}/zsh-init to enable the prompt." - einfo "The config file is in /etc/${PN}/." -} diff --git a/cfg/main.cfg b/etc/over-env/prompt.cfg similarity index 100% rename from cfg/main.cfg rename to etc/over-env/prompt.cfg diff --git a/dotfiles/system/etc/screenrc b/etc/screenrc similarity index 100% rename from dotfiles/system/etc/screenrc rename to etc/screenrc diff --git a/dotfiles/system/etc/screenrc.over b/etc/screenrc.over similarity index 100% rename from dotfiles/system/etc/screenrc.over rename to etc/screenrc.over diff --git a/dotfiles/system/etc/zsh/zprofile b/etc/zsh/zprofile similarity index 100% rename from dotfiles/system/etc/zsh/zprofile rename to etc/zsh/zprofile diff --git a/dotfiles/system/etc/zsh/zshrc b/etc/zsh/zshrc similarity index 98% rename from dotfiles/system/etc/zsh/zshrc rename to etc/zsh/zshrc index ac7ff27..3f4c795 100644 --- a/dotfiles/system/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -182,8 +182,8 @@ autoload -U compinit compinit autoload colors zsh/terminfo -# app-shells/over-prompt -source /usr/share/over-prompt/zsh-init +# app-shells/over-env +source /usr/lib/over/env/prompt-init # keyboard stuff bindkey "\e[1~" beginning-of-line diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a68c9db --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +ROOT="${1}" +LIBDIR="${ROOT}/usr/lib/over/env" + +mkdir -p "${LIBDIR}" +cp lib/* "${LIBDIR}" +mkdir -p "${ROOT}/etc" + +# intentionally ignoring zsh stuff - install that manually if you want +cp -r etc/over-env etc/screen* "${ROOT}/etc" diff --git a/share/zsh-init b/lib/prompt-init similarity index 85% rename from share/zsh-init rename to lib/prompt-init index 6635761..d73e83c 100755 --- a/share/zsh-init +++ b/lib/prompt-init @@ -1,6 +1,6 @@ #! /bin/zsh -OVER_PROMPT_CFG="/etc/over-prompt/main.cfg" +OVER_PROMPT_CFG="/etc/over-env/prompt.cfg" if [[ -a "$OVER_PROMPT_CFG" ]]; then source "$OVER_PROMPT_CFG" @@ -21,7 +21,7 @@ function preexec { function precmd { set_title "${USER}: ${PWD}" - python3 /usr/libexec/over-prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=3.0}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}" + python3 /usr/lib/over/env/prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=3.0}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}" PS1="$(print "%(?.%{\e[1;36m%}.%{\e[1;31m%}%?%{\e[0m%}:%{\e[1;31m%})%(\!.#.$)%{\e[0m%} ")" OVER_PROMPT_LAST_REFRESH=$(date +%s) } diff --git a/libexec/render.py b/lib/prompt.py similarity index 100% rename from libexec/render.py rename to lib/prompt.py