diff options
author | Karel Kočí <cynerd@email.cz> | 2017-05-07 11:43:33 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-05-07 11:49:39 +0200 |
commit | 36e9201b0fd130f3aaf924b06bf29c0e46c88743 (patch) | |
tree | 20e48fafa829da0a2aeac92e54a0e355b21d4f84 | |
parent | a793b23435567f2d4f49846196ceebcc47cd764c (diff) | |
parent | 9fbf8d27ddbfb136351780615d42af82ddb42337 (diff) | |
download | myconfigs-36e9201b0fd130f3aaf924b06bf29c0e46c88743.tar.gz myconfigs-36e9201b0fd130f3aaf924b06bf29c0e46c88743.tar.bz2 myconfigs-36e9201b0fd130f3aaf924b06bf29c0e46c88743.zip |
Merge branch 'master' into server
-rwxr-xr-x | install | 17 | ||||
-rw-r--r-- | screenrc | 8 | ||||
-rw-r--r-- | shellrc | 5 | ||||
-rw-r--r-- | system/etc/issue | 13 | ||||
-rw-r--r-- | system/etc/profile.d/path.sh | 1 | ||||
-rw-r--r-- | utils/inst | 30 | ||||
-rw-r--r-- | vimrc | 1 |
7 files changed, 49 insertions, 26 deletions
@@ -10,29 +10,28 @@ git submodule update --init || (echo "Submodule update failed!"; exit 5) ################################################################################# source private/install # private files, sorry but some privacy is required. -read -p "Install Bashrc? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install Bashrc?"; then inst bashrc ~/.bashrc inst shellrc ~/.shellrc inst profile ~/.profile fi -read -p "Install zshrc? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install zshrc?"; then inst zshrc ~/.zshrc inst shellrc ~/.shellrc inst zprofile ~/.zprofile fi -read -p "Install GIT configuration? (Y/n) " -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install GIT configuration?"; then inst gitconfig ~/.gitconfig inst local/git-prompt.sh ~/.local/ fi -read -p "Install VIM scripts? (Y/n) " -YCM_PATH=~/.vim/bundle/YouCompleteMe -if [[ $REPLY =~ ^[Yy]?$ ]]; then +if ask "Install configurations for various utility tools?"; then + inst screenrc ~/.screenrc +fi + +if ask "Install VIM scripts?"; then inst vimrc ~/.vimrc mkdir -p ~/.cache/vim # directory for *.swp files mkdir -p ~/.cache/vim-undo # directory for undo files diff --git a/screenrc b/screenrc new file mode 100644 index 0000000..8bc675c --- /dev/null +++ b/screenrc @@ -0,0 +1,8 @@ +vbell off +autodetach on + +defscrollback 50000 +obuflimit 50000 + +termcapinfo xterm* ti@:te@ +termcapinfo rxvt* ti@:te@ @@ -1,9 +1,6 @@ # vim: ft=sh: # This is file with aliases and variables shared between bash and zsh -export PATH=~/.local/bin:$PATH:$(ruby -e "print Gem.user_dir")/bin -export EDITOR=vim - # Continue only if this is interactive shell [[ $- != *i* ]] && return @@ -17,7 +14,7 @@ alias cgdb='cgdb -q' alias octave='octave-cli -q' alias ssh='TERM="xterm-256color" ssh' alias feh='feh --magick-timeout 1 -.' -alias make='make -j 8' +alias make="make -j$(nproc)" export LESS=-R export LESS_TERMCAP_mb=$'\E[1;31m' diff --git a/system/etc/issue b/system/etc/issue new file mode 100644 index 0000000..9de90ce --- /dev/null +++ b/system/etc/issue @@ -0,0 +1,13 @@ +\e{blue} + . + .vir. d$b + .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b. + $$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b. + Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$ + "$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$ + d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P + $$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P" + `Q$$P" """ +\e{reset} +\e{green}\n\e{reset} (\s \r) \e{red}\l\e{reset} + diff --git a/system/etc/profile.d/path.sh b/system/etc/profile.d/path.sh new file mode 100644 index 0000000..ae00916 --- /dev/null +++ b/system/etc/profile.d/path.sh @@ -0,0 +1 @@ +PATH="$PATH:/usr/sbin:/sbin" @@ -1,6 +1,12 @@ # Functions used for interactive installation of new changes to running system # vim: ft=sh +ask() { + echo -ne "\e[1;34m$1 (Y/n) \e[0m" + read + [[ $REPLY =~ ^[Yy]?$ ]] +} + dodiff() { if [ -d "$2" ]; then # If we just copying some file to directory @@ -9,15 +15,14 @@ dodiff() { OUT=$2 fi if ! [ -f "$OUT" ]; then - echo "Not installed: $1 => $OUT" - read -p "Install? (Y/n) " - if [[ $REPLY =~ ^[Yy]?$ ]]; then + echo -e "\e[1;33mNot installed:\e[0m $1 => $OUT" + if ask "Install?"; then doinst "$1" "$OUT" fi return fi - if cmp "$1" "$OUT" >/dev/null; then - echo "No difference detected: $OUT" + if cmp "$1" "$OUT" >/dev/null 2>&1; then + echo -e "\e[1;32mNo difference detected:\e[0m $OUT" return fi vimdiff "$1" "$OUT" @@ -31,7 +36,7 @@ checkdiff() { # directory than it have to have trailing slash to ensure that no # additional directory is created. if ! echo "$1" | grep -qE '/$'; then - echo ERROR: Directory without trailing slash detected: $1 + echo -e "\e[1;31mERROR: Directory without trailing slash detected:\e[0m $1" exit 1 fi # Got trough all files ignoring git repositories @@ -43,9 +48,8 @@ checkdiff() { for d in `find "$1" -type d -print -exec test -e '{}'/.git \; -prune`; do D="${d#$1}" if [ ! -d "$2/$D" ]; then - echo "Directory not installed: $1/$D => $2/$D" - read -p "Install? (Y/n) " - if [[ $REPLY =~ ^[Yy]?$ ]]; then + echo -e "\e[1;33mDirectory not installed:\e[0m $1/$D => $2/$D" + if ask "Install?"; then doinst "$1/$D/" "$2/$D" fi fi @@ -57,9 +61,9 @@ checkdiff() { cd "$2/$G" # Check if we have any change at all if git --work-tree=. diff --exit-code -s; then - echo "No difference detected in git: $2/$G" + echo -e "\e[1;32mNo difference detected in git:\e[0m $2/$G" else - echo "Checkout of git repository: $2/$G" + echo -e "\e[0;32mCheckout of git repository:\e[0m $2/$G" # Checkout all files to HEAD git --work-tree=. checkout -f HEAD # Update all submodules @@ -77,14 +81,14 @@ checkdiff() { # commands not on deployed tree but on tree in this repository, so we need specify # work tree on command line every time we want target deployed work tree. doinst() { - echo rsync -rlpt $1 $2 + echo -e "\e[1;34mrsync -rlpt $1 $2\e[0m" rsync -rlpt $1 $2 # Now edit all .git files in target directory for g in `find "$2" -name '.git' -type f`; do if ! grep -q "gitdir: " "$g"; then continue # Probably not a git repository or who knows. fi - echo "Pointing git repository $g to this repository" + echo -e "\e[1;34mPointing git repository $g to this repository\e[0m" echo gitdir: $PWD/.git`sed "s/^gitdir: [./]*git//" "$g"` > "$g" done } @@ -18,6 +18,7 @@ set hlsearch set foldmethod=syntax set wildmode=longest:full,full set wildmenu +set modeline set number set colorcolumn=82 |