From 7fdf5c15cce0f37580d9e6d757c53edafa6e3d5a Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Tue, 3 Oct 2017 19:39:45 +0300
Subject: [PATCH] - Added Powerline config.

---
 .bashrc                                      |  8 +++++
 .config/powerline/config.json                | 13 ++++++++
 .config/powerline/themes/shell/personal.json | 34 ++++++++++++++++++++
 .config/powerline/themes/tmux/personal.json  | 20 ++++++++++++
 .tmux.conf                                   |  1 +
 .vimrc                                       |  6 ++++
 6 files changed, 82 insertions(+)
 create mode 100644 .config/powerline/config.json
 create mode 100644 .config/powerline/themes/shell/personal.json
 create mode 100644 .config/powerline/themes/tmux/personal.json

diff --git a/.bashrc b/.bashrc
index 7753bdf..10af2c0 100644
--- a/.bashrc
+++ b/.bashrc
@@ -47,6 +47,14 @@ fi
 # shellcheck disable=SC2142
 [ -f /usr/local/bin/virtualenvwrapper.sh ] && . /usr/local/bin/virtualenvwrapper.sh
 
+if which powerline-daemon > /dev/null && [ -f /usr/share/powerline/bindings/bash/powerline.sh ]
+then
+    export POWERLINE_BASH_CONTINUATION=1
+    export POWERLINE_BASH_SELECT=1
+    pgrep -f powerline-daemon > /dev/null || powerline-daemon -q
+    . /usr/share/powerline/bindings/bash/powerline.sh
+fi
+
 export REPREPRO_BASE_DIR="$HOME/Documents/Shore/debian-repository"
 export EDITOR=vim
 export GOPATH="$HOME/Documents/Golang"
diff --git a/.config/powerline/config.json b/.config/powerline/config.json
new file mode 100644
index 0000000..a8e5f3e
--- /dev/null
+++ b/.config/powerline/config.json
@@ -0,0 +1,13 @@
+{
+    "ext": {
+        "shell": {
+            "theme": "personal"
+        },
+        "vim": {
+            "theme": "default"
+        },
+        "tmux": {
+            "theme": "personal"
+        }
+    }
+}
diff --git a/.config/powerline/themes/shell/personal.json b/.config/powerline/themes/shell/personal.json
new file mode 100644
index 0000000..61e59f8
--- /dev/null
+++ b/.config/powerline/themes/shell/personal.json
@@ -0,0 +1,34 @@
+{
+	"segments": {
+		"left": [
+			{
+				"function": "powerline.segments.common.net.hostname",
+				"priority": 10
+			},
+			{
+				"function": "powerline.segments.common.env.user",
+				"priority": 30
+			},
+			{
+				"function": "powerline.segments.common.env.virtualenv",
+				"priority": 50
+			},
+			{
+				"function": "powerline.segments.common.vcs.branch",
+				"priority": 40
+			},
+			{
+				"function": "powerline.segments.shell.cwd",
+				"priority": 10
+			},
+			{
+				"function": "powerline.segments.shell.jobnum",
+				"priority": 20
+			},
+			{
+				"function": "powerline.segments.shell.last_status",
+				"priority": 10
+			}
+		]
+	}
+}
diff --git a/.config/powerline/themes/tmux/personal.json b/.config/powerline/themes/tmux/personal.json
new file mode 100644
index 0000000..24ad5bf
--- /dev/null
+++ b/.config/powerline/themes/tmux/personal.json
@@ -0,0 +1,20 @@
+{
+	"segments": {
+		"right": [
+			{
+				"function": "powerline.segments.common.time.date"
+			},
+			{
+				"function": "powerline.segments.common.time.date",
+				"name": "time",
+				"args": {
+					"format": "%H:%M",
+					"istime": true
+				}
+			},
+			{
+				"function": "powerline.segments.common.net.hostname"
+			}
+		]
+	}
+}
diff --git a/.tmux.conf b/.tmux.conf
index 4f0383f..433b406 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -1 +1,2 @@
+if-shell '[ -f /usr/share/powerline/bindings/tmux/powerline.conf ]' 'source "/usr/share/powerline/bindings/tmux/powerline.conf"'
 bind-key b send-prefix
diff --git a/.vimrc b/.vimrc
index c147704..d79dc95 100644
--- a/.vimrc
+++ b/.vimrc
@@ -9,3 +9,9 @@ setlocal textwidth=80
 setlocal smarttab
 setlocal expandtab
 syntax on
+:silent! python3 from powerline.vim import setup as powerline_setup
+:silent! python3 powerline_setup()
+:silent! python3 del powerline_setup
+set laststatus=2 " Always display the statusline in all windows
+set showtabline=2 " Always display the tabline, even if there is only one tab
+set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
-- 
GitLab