dot

packages and services management
Log | Files | Refs | README

commit 39fd4e72207f71825bfe5946675b735e0bff25ba
parent 72107e37f79d8cbba4b052ecb8c1ad552daf7b28
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed,  6 Dec 2017 02:02:04 +0100

try a much simpler approach

Diffstat:
Mbin/git-status | 38++++++++++++++++++++++----------------
Mbin/io | 6+++++-
Rbin/io-pwd -> bin/io-grpwd | 0
Mbin/mblaze-filter | 13++++++++++---
Mbin/xdg-open | 1-
Mconfig/git/config | 5++---
Mdot/bashrc | 12++++--------
7 files changed, 43 insertions(+), 32 deletions(-)

diff --git a/bin/git-status b/bin/git-status @@ -23,24 +23,30 @@ git status --porcelain -b | awk ' next; } -/^\?\? / { untracked++; next; } -/^U. / { conflicts++; next; } -/^.U / { conflicts++; next; } -/^DD / { conflicts++; next; } -/^AA / { conflicts++; next; } -/^.M / { changed++; } -/^.D / { changed++; } -/^[^ ]. / { staged++; } +/^\?\? / { untracked++; next; } +/^U. / { conflicts++; next; } +/^.U / { conflicts++; next; } +/^DD / { conflicts++; next; } +/^AA / { conflicts++; next; } +/^.M / { changed++; } +/^.D / { changed++; } +/^[^ ]. / { staged++; } END { - printf(" %s", branch); - - if (untracked) printf(" ?%d", untracked); - if (conflicts) printf(" x%d", conflicts); - if (changed ) printf(" +%d", changed); - if (staged ) printf(" #%d", staged); - if (behind ) printf(" v%d", behind); - if (ahead ) printf(" ^%d", ahead); + printf("%s", branch); + + if (untracked) + printf(" \033[33m?\033[m%d", untracked); + if (conflicts) + printf(" \033[31mx\033[m%d", conflicts); + if (changed) + printf(" \033[32m+\033[m%d", changed); + if (staged) + printf(" \033[34m#\033[m%d", staged); + if (behind) + printf(" \033[35mv\033[m%d", behind); + if (ahead) + printf(" \033[35m^\033[m%d", ahead); }' [ -d "$(git rev-parse --git-dir)/rebase-merge" ] && printf ' rebase' diff --git a/bin/io b/bin/io @@ -50,7 +50,11 @@ case ${sel%% *} in exec man $(printf "$name" | sed -r 's/([_a-zA-Z0-9]*).*\(([0-9p]+).*\)/\2 \1/') ;; -(*files*|*uri*|'') +(*files*|*uri*) exec xdg-open "$name" ;; +('') + printf '\033];2%s\a' "$name" + abduco -a "$(printf %s "$name" | tr / !)" + ;; esac diff --git a/bin/io-pwd b/bin/io-grpwd diff --git a/bin/mblaze-filter b/bin/mblaze-filter @@ -3,14 +3,14 @@ minc "$MAIL" | mscan -while read -r dir test +while read -r dir t do mkdir -p "${MAIL%/*}/$dir/cur" mkdir -p "${MAIL%/*}/$dir/new" mkdir -p "${MAIL%/*}/$dir/tmp" printf '%-25s ' "$dir" - mlist "$MAIL" | mpick -t "$test" | xargs -rI {} mv {} "$MAIL/../$dir/new" -done << 'EOF' + mlist "$MAIL" | mpick -t "$t" | xargs -rI {} mv {} "$MAIL/../$dir/new" +done << 'EOF' 2>&1 | less actux.eu.org "Reply-To" ~~~ "*@actux.eu.org*" amazon.com "From" ~~~ "*@amazon.*" amnesty.org "From" ~~~ "*amnesty.*" @@ -32,13 +32,20 @@ gandi.net "From" ~~~ "*gandi.net*" github.com "From" ~~~ "*github.com*" gobolinux.org "Subject" ~~~ "*\[gobolinux*\]" google.com "From" ~~~ "*google.com*" +gopherproject.org "From" ~~~ "*gopher-project*" +grifon.fr "From" ~~~ "*@grifon.fr*" +grifon.fr "To" ~~~ "*@grifon.fr*" keybase.io "From" ~~~ "*keybase.io*" lobste.rs "From" ~~~ "*@lobste.rs*" +netsukuku.freaknet.org "From" ~~~ "*netsukuku*@*dyne.org*" nixers.net "From" ~~~ "*@nixers.net*" noip.com "From" ~~~ "*@noip.com*" openbsd.org/tech "Cc" ~~~ "*tech@openbsd.org*" openbsd.org/tech "To" ~~~ "*tech@openbsd.org*" openbsd.org/announce "To" ~~~ "*announce@openbsd.org*" +openbsd.org/announce "Cc" ~~~ "*announce@openbsd.org*" +openbsd.org/advocacy "To" ~~~ "*advocacy@openbsd.org*" +openbsd.org/advocacy "Cc" ~~~ "*advocacy@openbsd.org*" paypal.com "From" ~~~ "*paypal.*" reddit.com "From" ~~~ "*@reddit.*" repo.or.cz "Subject" ~~~ "*\[repo.or.cz\]*" diff --git a/bin/xdg-open b/bin/xdg-open @@ -10,7 +10,6 @@ aexec() for name in "$@"; do continue; done [ -e "$name" ] && name=$(cd "$(dirname "$1")"; pwd)/$(basename "$1") -printf '\033]0;%s\a' "$name" tty | grep -q -e '^/dev/pts/.*' -e '^/dev/tty*' || exec st -f terminus:pixelsize=18 -e "$0" "$@" diff --git a/config/git/config b/config/git/config @@ -3,9 +3,8 @@ name = Josuah Demangeon [alias] - dog = log --graph --date=short --decorate --tags --branches \ - --remotes --format='%h %ad %s' - stat = log --graph --decorate --tags --branches --remotes --stat + dog = log --graph --date=short --decorate --format='%h %ad %s' + stat = log --graph --decorate --stat poule = pull [core] diff --git a/dot/bashrc b/dot/bashrc @@ -1,15 +1,11 @@ -PS1='$( - err=$? - printf "\033];%s %s%s\007" "$(uname -n)" "$PWD" "$(git-status)" - printf "\r\033[1%sm$\033[m " "$([ "$err" = 0 ] || printf ";31")" -)' -PS2=' -- ' +[ "$(whoami)" = root ] && u='#' || u='$' +[ "$SSH_TTY" ] && h=$(uname -n) || h='' +PS1=$h'$([ $? = 0 ] && printf "'$u'" || printf x) ' alias blih='blih -u "$BLIH"' alias c='cd "$(find . -maxdepth 4 -name .git -prune -o -type d | iomenu)"' alias f='f=$(find . -name .git -prune -o -print | iomenu)' -alias p='p=$(io-ps)' -alias cl='printf "\033[H\033[2J"' +alias clear='printf "\033[H\033[2J"' alias l='ls -Alp' alias o='xdg-open' alias s='git status -s --branch'