From d04632bd05c713555a877154523aea2b9f47295e Mon Sep 17 00:00:00 2001 From: samedamci Date: Sun, 17 May 2020 11:18:58 +0200 Subject: [PATCH] Add more colors to 'fglog' script --- .local/bin/scripts/dwmbar/mails | 2 +- .local/bin/scripts/fglog | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.local/bin/scripts/dwmbar/mails b/.local/bin/scripts/dwmbar/mails index f69f4b5..176cde1 100755 --- a/.local/bin/scripts/dwmbar/mails +++ b/.local/bin/scripts/dwmbar/mails @@ -6,5 +6,5 @@ unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" -[ "$unread" -gt "0" ] && echo " $unread " || echo "" +[ "$unread" -gt "0" ] && echo " $unread" || echo "" echo "$icon" diff --git a/.local/bin/scripts/fglog b/.local/bin/scripts/fglog index f5e2138..a7cbeda 100755 --- a/.local/bin/scripts/fglog +++ b/.local/bin/scripts/fglog @@ -1,7 +1,9 @@ #!/bin/sh -# Fuzzy Git commits browser. +# Fuzzy Git commit browser. -git log --no-decorate --format=short | awk '/^commit|^ /' | - sed 's/ //g; s/commit //g' | paste -d " " - - | fzf --preview \ - 'git log -n 1 {1}; printf "\n" && git diff --color=always {1}~ {1}' +show_diff="git log --color=always -n 1 {1}; seq -s_ 150|tr -d '[:digit:]' && \ + git diff --color=always {1}~ {1}" + +git log --color=always --format="%C(auto)%h %s" | fzf --ansi \ + --preview="$show_diff" --preview-window=right:55%