From 87fd0f48be5b34a87f82f79ded0cd5515583428e Mon Sep 17 00:00:00 2001 From: Adam Gausmann Date: Fri, 20 Oct 2017 17:05:04 +0000 Subject: [PATCH] Powerline integration --- .bashrc | 19 ++++-- .config/powerline/colorschemes/wm/exams.json | 69 ++++++++++++++++++++ .config/powerline/themes/shell/custom.json | 31 +++++++++ .config/powerline/themes/tmux/custom.json | 20 ++++++ .config/powerline/themes/wm/exams.json | 32 +++++++++ .gitignore | 1 + .i3/config | 8 +-- .tmux.conf | 2 + 8 files changed, 172 insertions(+), 10 deletions(-) create mode 100644 .config/powerline/colorschemes/wm/exams.json create mode 100644 .config/powerline/themes/shell/custom.json create mode 100644 .config/powerline/themes/tmux/custom.json create mode 100644 .config/powerline/themes/wm/exams.json create mode 100644 .gitignore diff --git a/.bashrc b/.bashrc index 12ec2de..ec70834 100644 --- a/.bashrc +++ b/.bashrc @@ -6,15 +6,24 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return -# Color aliases -alias ls='ls --color=auto' - -PS1='[\u@\h \W]\$ ' - export EDITOR=/usr/bin/nano export GIT_EDITOR=$EDITOR export SUDO_EDITOR=$EDITOR +# Powerline +if [ -z $ENABLE_POWERLINE ] +then + PS1='[\u@\h \W]\$ ' +else + powerline-daemon -q + POWERLINE_BASH_CONTINUATION=1 + POWERLINE_BASH_SELECT=1 + . ~/.local/lib/powerline/bindings/bash/powerline.sh +fi + +# Color aliases +alias ls='ls --color=auto' + # Aliases alias ll="ls -l" alias la="ls -la" diff --git a/.config/powerline/colorschemes/wm/exams.json b/.config/powerline/colorschemes/wm/exams.json new file mode 100644 index 0000000..4ccf7c1 --- /dev/null +++ b/.config/powerline/colorschemes/wm/exams.json @@ -0,0 +1,69 @@ +{ + "groups": { + "mode": { + "fg": "gray8", + "bg": "darkred", + "attrs": ["bold"] + }, + "w_focused": { + "fg": "white", + "bg": "darkestblue", + "attrs": ["bold"] + }, + "w_visible": { + "fg": "gray2", + "bg": "gray8", + "attrs": [] + }, + "workspace": { + "fg": "gray8", + "bg": "gray2", + "attrs": [] + }, + "internal_ip": { + "fg": "gray8", + "bg": "gray2", + "attrs": [] + }, + "system_load": { + "fg": "gray8", + "bg": "gray2", + "attrs": [] + }, + "cpu_load_percent": { + "fg": "gray8", + "bg": "gray2", + "attrs": [] + }, + "volume": { + "fg": "gray2", + "bg": "gray8", + "attrs": [] + }, + "mute": { + "fg": "gray2", + "bg": "gray8", + "attrs": [] + }, + "battery": { + "fg": "gray8", + "bg": "gray2", + "attrs": [] + }, + "battery_full": { + "fg": "white", + "bg": "darkestgreen", + "attrs": [] + }, + "battery_empty": { + "fg": "gray9", + "bg": "red", + "attrs": ["bold"] + }, + "date": { + "fg": "white", + "bg": "darkestblue", + "attrs": [] + } + } +} diff --git a/.config/powerline/themes/shell/custom.json b/.config/powerline/themes/shell/custom.json new file mode 100644 index 0000000..a2812c5 --- /dev/null +++ b/.config/powerline/themes/shell/custom.json @@ -0,0 +1,31 @@ +{ + "segments": { + "left": [ + { + "function": "powerline.segments.shell.last_status", + "priority": 10 + }, + { + "function": "powerline.segments.common.net.hostname", + "priority": 10 + }, + { + "function": "powerline.segments.common.env.user", + "priority": 30 + }, + { + "function": "powerline.segments.shell.cwd", + "priority": 10 + }, + { + "function": "powerline.segments.shell.jobnum", + "priority": 20 + }, + { + "function": "powerline.segments.common.vcs.branch", + "priority": 40 + } + + ] + } +} diff --git a/.config/powerline/themes/tmux/custom.json b/.config/powerline/themes/tmux/custom.json new file mode 100644 index 0000000..24ad5bf --- /dev/null +++ b/.config/powerline/themes/tmux/custom.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/.config/powerline/themes/wm/exams.json b/.config/powerline/themes/wm/exams.json new file mode 100644 index 0000000..7455a0c --- /dev/null +++ b/.config/powerline/themes/wm/exams.json @@ -0,0 +1,32 @@ +{ + "segments": { + "left": [ + { + "function": "powerline.segments.i3wm.mode" + }, + { + "function": "powerline.segments.i3wm.workspaces" + } + ], + "right": [ + { + "function": "powerline-pulseaudio.segments.mute" + }, + { + "function": "powerline-pulseaudio.segments.volume" + }, + { + "function": "powerline.segments.common.bat.battery" + }, + { + "function": "powerline.segments.common.sys.cpu_load_percent" + }, + { + "function": "powerline.segments.common.time.date", + "args": { + "format": "%Y-%m-%d %H:%M:%S" + } + } + ] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3df798a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.config/powerline/config.json diff --git a/.i3/config b/.i3/config index ff42898..68549b7 100644 --- a/.i3/config +++ b/.i3/config @@ -9,6 +9,8 @@ # # Please see http://i3wm.org/docs/userguide.html for a complete reference! +exec --no-startup-id shopt -s huponexit + set $mod Mod4 # Font for window titles. Will also be used by the bar unless a different font @@ -153,11 +155,7 @@ mode "resize" { bindsym $mod+r mode "resize" -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - status_command i3status -} +exec --no-startup-id "~/.local/lib/powerline/bindings/lemonbar/powerline-lemonbar.py --i3 --height 20 -i 5 -- -b -f 'DejaVu:size=10' -f 'PowerlineSymbols:size=12'" # Multimedia keys bindsym XF86MonBrightnessDown exec xbacklight -dec 10 diff --git a/.tmux.conf b/.tmux.conf index 653af3a..794df5d 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -9,3 +9,5 @@ set -g status-bg cyan set -g status-fg black bind-key b send-prefix + +source ~/.local/lib/powerline/bindings/tmux/powerline.conf