diff options
author | Karel Kočí <cynerd@email.cz> | 2018-04-04 09:55:49 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-04-04 09:57:37 +0200 |
commit | 7ad63ac537482aaa43eae2de19ef83d332beacc2 (patch) | |
tree | 80bf10fc01d13a1e2ed7756cee75de103f80cf16 | |
parent | b5d63999c82eb89c0bd671c2ae04b936b6ec714d (diff) | |
parent | e6e04d7c587b17c23a90f3aa37ab5bdeec8415bb (diff) | |
download | myconfigs-7ad63ac537482aaa43eae2de19ef83d332beacc2.tar.gz myconfigs-7ad63ac537482aaa43eae2de19ef83d332beacc2.tar.bz2 myconfigs-7ad63ac537482aaa43eae2de19ef83d332beacc2.zip |
Merge branch 'master' into server
-rw-r--r-- | bashrc | 36 | ||||
-rw-r--r-- | config/htop/htoprc | 26 | ||||
-rwxr-xr-x | install | 14 | ||||
-rw-r--r-- | shellrc | 62 | ||||
-rw-r--r-- | zshrc | 98 |
5 files changed, 4 insertions, 232 deletions
@@ -1,36 +0,0 @@ -# .bashrc - -source ~/.shellrc - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -# Source global definitions -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi - -# PROMPT ####################################################### -PS1='$( -if [ `id -u` -eq "0" ]; then - echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] " -else - echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] " -fi)' - -PROMPT_COMMAND=' -EC=$? -if [[ $EC < 0 ]]; then - echo -e "\e[1;31m"EXIT: $EC"\e[0m" -elif [[ $EC > 0 ]]; then - echo -e "\e[1;33m"EXIT: $EC"\e[0m" -fi' - -function settitle { - echo -ne "\033]0;`whoami`@`hostname`:`pwd`\007" -} -case "$TERM" in - xterm*|*rxvt*|*st*) - trap 'settitle' DEBUG - ;; -esac diff --git a/config/htop/htoprc b/config/htop/htoprc deleted file mode 100644 index 0492e91..0000000 --- a/config/htop/htoprc +++ /dev/null @@ -1,26 +0,0 @@ -# Beware! This file is rewritten by htop when settings are changed in the interface. -# The parser is also very primitive, and not human-friendly. -fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 -sort_direction=1 -hide_threads=1 -hide_kernel_threads=1 -hide_userland_threads=1 -shadow_other_users=0 -show_thread_names=0 -show_program_path=1 -highlight_base_name=0 -highlight_megabytes=1 -highlight_threads=1 -tree_view=1 -header_margin=1 -detailed_cpu_time=0 -cpu_count_from_zero=0 -update_process_names=0 -account_guest_in_cpu_meter=0 -color_scheme=0 -delay=15 -left_meters=LeftCPUs Memory Swap -left_meter_modes=1 1 1 -right_meters=RightCPUs Tasks LoadAverage Uptime -right_meter_modes=1 2 2 2 @@ -12,14 +12,10 @@ git submodule update --init --recursive || (echo "Submodule update failed!"; exi ################################################################################# -if ask "Install Bashrc"; then - inst bashrc ~/.bashrc - inst shellrc ~/.shellrc -fi - -if ask "Install zshrc"; then - inst zshrc ~/.zshrc - inst shellrc ~/.shellrc +# TODO on hosts without shellrc we might want some thin shellrc to be installed +if ask "Install shell profile"; then + inst profile ~/.profile + inst zprofile ~/.zprofile fi if ask "Install GIT configuration"; then @@ -29,8 +25,6 @@ fi if ask "Install configurations for various utility tools"; then inst screenrc ~/.screenrc - mkdir -p ~/.config/htop - inst config/htop/htoprc ~/.config/htop/htoprc fi if ask "Install vim scripts"; then diff --git a/shellrc b/shellrc deleted file mode 100644 index 1deea54..0000000 --- a/shellrc +++ /dev/null @@ -1,62 +0,0 @@ -# vim: ft=sh: -# This is file with aliases and variables shared between bash and zsh - -# Continue only if this is interactive shell -[[ $- != *i* ]] && return - -################################################################################# -# Aliases - -alias ls='ls --color=auto' -eval $(dircolors -b) -alias ll='ls -lh' -alias df='df -h' -alias du='du -h' -alias grep='grep --color=auto' -alias git='LANG=en_GB git' -alias gdb='gdb -q' -alias cgdb='cgdb -q' -alias octave='octave-cli -q' -alias ssh='TERM="xterm-256color" ssh' -alias feh='feh --magick-timeout 10 -.' - -export LESS=-R -export LESS_TERMCAP_mb=$'\E[1;31m' -export LESS_TERMCAP_md=$'\E[1;36m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;44;33m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[1;32m' -[ -x /usr/bin/src-hilite-lesspipe.sh ] && export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" - -alias gst='git status' -alias v='vim' -alias i='i3-msg' - -# Systemd aliases if we are running systemd -if pidof systemd >/dev/null 2>/dev/null; then - alias sctl='sudo systemctl' - alias usctl='systemctl --user' - alias jrn='journalctl' - alias ujrn='jrn --user' -fi - -################################################################################# -# Utility functions - -# Generate random password (optionally takes length of password as first argument) -genpasswd() { - local l=$1 - [ -n "$l" ] || l=16 - tr -dc A-Za-z0-9_ < /dev/urandom | head -c "$l" | xargs -} - -# Run given command every second -dorepeat() { - while true; do - "$@" - sleep 1 - echo - done -} @@ -1,98 +0,0 @@ -source ~/.shellrc - -[[ -o interactive ]] || return # skip on initialization if not interactive - -zstyle ':completion:*' completer _expand _complete _ignored _approximate -zstyle ':completion:*' insert-unambiguous true -zstyle ':completion:*' max-errors 3 -zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path ~/.cache/zsh -zstyle :compinstall filename '/home/kkoci/.zshrc' -zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==32=33}:${(s.:.)LS_COLORS}")' -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} - -autoload -Uz compinit && compinit -autoload -Uz colors && colors - -HISTFILE=~/.histfile -HISTSIZE=10000 -SAVEHIST=10000 -setopt appendhistory -setopt extendedglob -setopt hist_ignore_dups -setopt hist_expire_dups_first -setopt extended_history -setopt inc_append_history -setopt promptsubst -setopt hist_ignore_dups -unsetopt nomatch -bindkey -e - -autoload -U select-word-style -select-word-style bash - -# Delete key workaround -bindkey "^[[3~" delete-char -bindkey "^[3;5~" delete-char - -# PROMPT ####################################################### -[ $UID -eq 0 ] && NCOLOR="red" || NCOLOR="green" -PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %? -)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " -unset NCOLOR - -if [ -e ~/.local/git-prompt.sh ]; then - source ~/.local/git-prompt.sh - export GIT_PS1_SHOWDIRTYSTATE=y - export GIT_PS1_SHOWUNTRACKEDFILES=y - export GIT_PS1_SHOWUPSTREAM="auto" - export GIT_PS1_STATESEPARATOR="" - export GIT_PS1_SHOWUPSTREAM=y - export GIT_PS1_DESCRIBE_STYLE="branch" - RPROMPT='$(__git_ps1 "%s")' -fi -# Long running bell ############################################ -# Inspired by: https://gist.github.com/jpouellet/5278239 -zmodload zsh/datetime # load $EPOCHSECONDS builtin -autoload -Uz add-zsh-hook -lrbell_duration=15 -lrbell_timestamp=$EPOCHSECONDS -lrbell_window_id=0x0 - -lrbell_active_window_id() { - xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2 -} - -lrbell_begin() { - lrbell_timestamp=$EPOCHSECONDS - if [ -n "$DISPLAY" ]; then - lrbell_message="`pwd`: $1" - lrbell_window_id="$(lrbell_active_window_id)" - fi -} -lrbell_end() { - if (( $EPOCHSECONDS - $lrbell_timestamp < $lrbell_duration )); then - return - fi - - print -n '\a' - if [ -n "$DISPLAY" ] && [ -n "$lrbell_window_id" ]; then # notify only if running in X - if [ "$(lrbell_active_window_id)" != "$lrbell_window_id" ]; then # And active window isn't current one - notify-send "Command finished" "$lrbell_message" - fi - fi -} - -add-zsh-hook preexec lrbell_begin -add-zsh-hook precmd lrbell_end -################################################################ -case "$TERM" in - xterm*|*rxvt*|*st*) - precmd() { - print -Pn "\e]0;%n@%m:%~ %(1j,%j job%(2j|s|) ,)\a" - } - preexec() { - print -Pn "\e]0;%n@%m:%~ !$1\a" - } - ;; -esac |