浏览代码

Initial bash costumisation

master
Dirk Alders 4 年前
父节点
当前提交
bd9bdbc97b
共有 12 个文件被更改,包括 90 次插入0 次删除
  1. 2
    0
      .gitignore
  2. 5
    0
      BASHRC_ADDON
  3. 12
    0
      add
  4. 19
    0
      available/aliases.sh
  5. 4
    0
      available/bin.sh
  6. 2
    0
      available/git_prompt.sh
  7. 3
    0
      available/neofetch.sh
  8. 14
    0
      available/powerline.sh
  9. 二进制
      available/powerline.tgz
  10. 10
    0
      available/tmux_local.sh
  11. 19
    0
      available/venv_prompt.sh
  12. 0
    0
      enabled/.keep

+ 2
- 0
.gitignore 查看文件

@@ -1,3 +1,5 @@
1
+enabled
2
+
1 3
 # ---> Linux
2 4
 *~
3 5
 

+ 5
- 0
BASHRC_ADDON 查看文件

@@ -0,0 +1,5 @@
1
+# You may want to put all your additions into a folder file like
2
+# ~/.bash, instead of adding them here directly.
3
+for file in ~/.bash/enabled/*.sh; do
4
+  . $file
5
+done

+ 12
- 0
add 查看文件

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+#
3
+if [[ -e $1 ]]; then
4
+  target=`basename $1`
5
+  if [[ $target == "venv_prompt.sh" ]]; then
6
+    target="10_$target"
7
+  else
8
+    target="50_$target"
9
+  fi
10
+  cd enabled
11
+  ln -s ../$1 $target
12
+fi

+ 19
- 0
available/aliases.sh 查看文件

@@ -0,0 +1,19 @@
1
+# enable color support of ls and also add handy aliases
2
+if [ -x /usr/bin/dircolors ]; then
3
+    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
4
+    alias ls='ls --color=auto'
5
+    alias dir='dir -lh --color=auto'
6
+    #alias vdir='vdir --color=auto'
7
+
8
+    alias grep='grep --color=auto'
9
+    alias fgrep='fgrep --color=auto'
10
+    alias egrep='egrep --color=auto'
11
+fi
12
+
13
+# some more ls aliases
14
+alias ll='ls -alF'
15
+alias la='ls -A'
16
+alias l='ls -CF'
17
+function ssh() { /usr/bin/ssh $@ -X -t "tmux attach-session -t default_ssh || tmux new-session -s default_ssh"; }
18
+alias dd='dd status=progress'
19
+alias dd_status="watch -n5 'sudo kill -USR1 $(pgrep ^dd)'"

+ 4
- 0
available/bin.sh 查看文件

@@ -0,0 +1,4 @@
1
+# set PATH so it includes user's private bin if it exists
2
+if [ -d "$HOME/bin" ] ; then
3
+    PATH="$HOME/bin:$PATH"
4
+fi

+ 2
- 0
available/git_prompt.sh 查看文件

@@ -0,0 +1,2 @@
1
+PS1='$(giti)'"$PS1"
2
+export PS1

+ 3
- 0
available/neofetch.sh 查看文件

@@ -0,0 +1,3 @@
1
+neofetch
2
+
3
+

+ 14
- 0
available/powerline.sh 查看文件

@@ -0,0 +1,14 @@
1
+#!/bin/sh
2
+#
3
+
4
+# You need to install powerline and fonts-powerline
5
+#
6
+# You need to install powerline-gitstatus by sudo pip install powerline-gitstatus
7
+# See also powerline.zip for the content in ~/config/powerline
8
+
9
+if [ ! `which powerline-daemon` == "" ]; then
10
+  powerline-daemon -q
11
+  POWERLINE_BASH_SELECT=1
12
+  POWERLINE_BASH_CONTINUATION=1
13
+  . /usr/share/powerline/bindings/bash/powerline.sh
14
+fi

二进制
available/powerline.tgz 查看文件


+ 10
- 0
available/tmux_local.sh 查看文件

@@ -0,0 +1,10 @@
1
+#!/bin/sh
2
+#
3
+if [ -z "$TMUX" ]; then
4
+    if tmux attach -t $(tmux ls | grep -v attached | head -1 | cut -f1 -d:) || tmux; then
5
+        exit
6
+    else
7
+        echo "Error while exicuting tmux. Check if tmux is installed"
8
+    fi
9
+fi
10
+

+ 19
- 0
available/venv_prompt.sh 查看文件

@@ -0,0 +1,19 @@
1
+function venv_status {
2
+  COLOR_WHITE="\033[00m"
3
+  COLOR_CYAN="\033[1;36m"
4
+  COLOR_RED="\033[1;31m"
5
+  COLOR_YELLOW="\033[1;33m"
6
+  COLOR_DARKYELLOW="\033[0;33m"
7
+  COLOR_GREEN="\033[1;32m"
8
+  COLOR_DARKGREEN="\033[0;32m"
9
+  COLOR_OCHRE="\033[38;5;95m"
10
+
11
+  if [[ ! $VIRTUAL_ENV == "" ]]; then
12
+    echo -e "$COLOR_DARKGREEN(🐍 `basename \"$VIRTUAL_ENV\"`)$COLOR_OCHRE "
13
+  fi
14
+}
15
+
16
+export VIRTUAL_ENV_DISABLE_PROMPT=1
17
+PS1='$(venv_status)'"$PS1"
18
+export PS1
19
+

+ 0
- 0
enabled/.keep 查看文件


正在加载...
取消
保存