dot

packages and services management
Log | Files | Refs | README

commit f7ab5e2d703afeef0241d528d5152830231ccf07
parent 84f1ccf2b6df91f6c5194a1bce280faff43aa3f6
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu, 30 Nov 2017 16:46:11 +0100

io is flawed as it will not update cache

If a subdirectory is changed, the mtime of the parent is not updated.

So file creation and deletion in subdirectories of "$HOME" will not be noticed.

Diffstat:
Mbin/http | 6++++--
Abin/iioo | 21+++++++++++++++++++++
Mbin/io | 37+++++++++++++++++++++----------------
Mbin/term | 2+-
Mbin/xdg-open | 11+++++------
Mdot/profile | 2+-
Mdot/ssh/config | 4----
Mdot/tmux.conf | 3++-
8 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/bin/http b/bin/http @@ -8,8 +8,7 @@ case $1 in (ip) curl icanhazip.com ;; -(ix) - curl -F f:1=@- ix.io +(ix) curl -F f:1=@- ix.io ;; (rfc) curl -L "http://www.ietf.org/rfc/rfc$2".txt | @@ -24,6 +23,9 @@ case $1 in (wttr) curl wttr.in ;; +(1337) + nc 0x1A4.1337.cx 9998 + ;; (*) printf 'usage: http [0x0 | ip | ix | rfc num | sprunge | w1r3 | wttr\n' printf ' [< data]]\n' diff --git a/bin/iioo b/bin/iioo @@ -0,0 +1,21 @@ +#!/bin/sh + +case $1 in +(n|netstat) + netstat -a | sed 's/^[AP]/#&/' | iomenu -# + ;; +(p|ps) + { ps -ax || ps; } | sed '1 s/^/#/' | iomenu -p ps -# | + sed -r 's/[^ ]* *([0-9]*).*/\1/' + ;; +(s|src) + xdg-open "$(find "$2" -type f ! -path '*/.git/*' | sort | + xargs -n 1 awk ' + FNR == 1 { printf("#%s\n", FILENAME); } + { printf("%7s\t%s\n", FNR, $0); } + ' | iomenu -# -p search | sed 's/ .*//')" + ;; +(*) + printf 'usage: io [n[etstat] | p[s] | s[rc] path]\n' + ;; +esac diff --git a/bin/io b/bin/io @@ -2,15 +2,18 @@ export LC_COLLATE=C -sel=$({ - abduco | sed 1d | cut -f 3 - - printf '#--- mail ---\n' +sel=$(iomenu -# << EOF +$(abduco | sed 1d | cut -f 3 | tr ! /) +#--- mail ---------------------------------------------------------------------- +$( + [ "$MAIL/new" -nt "$HOME/.cache/mail" ] && mdirs "$MAIL/.." | sort | while IFS='' read -r dir do printf '%s\t%s\n' "$(mlist -s "$dir" | wc -l)" "${dir#$PWD/}" - done - - printf '#--- man ---\n' + done > "$HOME/.cache/mail" + cat "$HOME/.cache/mail" +) +#--- man ----------------------------------------------------------------------- +$( IFS=: for dir in $MANPATH do [ $dir -nt "$HOME/.cache/man" ] && @@ -19,8 +22,9 @@ sel=$({ -e 's/(.{25}[^ ]* ) * - /\1- /' done cat "$HOME/.cache/man" - - printf '#--- files ---\n' +) +#--- files --------------------------------------------------------------------- +$( mkdir -p "$HOME/.cache/find" find "$HOME" -maxdepth 1 -mindepth 1 | while IFS='' read -r dir do @@ -28,13 +32,14 @@ sel=$({ [ "$dir" -nt "$cache" ] && find "$dir" -name .git -prune -o -print | sort -o "$cache" done - find "$HOME/.cache/find" -type f -exec cat {} + - - printf '#--- uri ---\n' - cat etc/uri -} | iomenu -#) name=${sel# } mode=${sel%% *} + cat "$HOME/.cache/find"/* "$HOME/.cache/find"/.* +) +#--- uri ----------------------------------------------------------------------- +$(cat "$HOME/etc/uri") +EOF) -case $mode in +name=${sel#* } +case ${sel%% *} in (*mail*) printf %s "$name" | cut -f 2 | mlist | mthread | msort -r -d | mseq -S | mscan -f '%6n %u %D %20f %t%2i%120S' | iomenu -p mail | @@ -44,7 +49,7 @@ case $mode in exec man $(printf "$name" | sed -r 's/([_a-zA-Z0-9]*).*\(([0-9p]+).*\)/\2 \1/') ;; -(*files*|'') +(*files*|*uri*|'') exec xdg-open "$name" ;; esac diff --git a/bin/term b/bin/term @@ -6,6 +6,6 @@ case $1 in ;; (name) shift - printf '\033]0;%s\a "$*" + printf '\033]0;%s\a' "$*" ;; esac diff --git a/bin/xdg-open b/bin/xdg-open @@ -1,18 +1,17 @@ #!/bin/sh # override the xdg-open utility +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" "$1" +exec st -f terminus:pixelsize=18 -e "$0" "$@" -# Wrap everything in an abduco session aexec() { - for name in "$@"; do continue; done - [ -e "$name" ] && - name=$(cd "$(dirname "$name")"; pwd)/$(basename "$name") name=$(printf %s "$name" | tr / ! | sed -r 's/.*(.{53})$/\1/') [ "$SSH_TTY" ] && e='^Z' || e='^\' - printf '\033]0;%s\007' "$*" ABDUCO=$name exec abduco -e "$e" -A "$name" "$@" } diff --git a/dot/profile b/dot/profile @@ -25,7 +25,7 @@ export LC_TIME=en_US.UTF-8 export ABDUCO_SOCKET_DIR="$HOME/.cache" -export LESS="-R" +export LESS="-~R" export BLIH="josuah.demangeon@epitech.eu" diff --git a/dot/ssh/config b/dot/ssh/config @@ -29,7 +29,3 @@ host josuah.net host git.josuah.net IdentityFile /mnt/key/ssh/josuah.net.key AddKeysToAgent yes - -host pushswap.josuah.net - IdentityFile /mnt/key/ssh/store.josuah.net.key - AddKeysToAgent yes diff --git a/dot/tmux.conf b/dot/tmux.conf @@ -88,4 +88,5 @@ set -g window-status-activity-style fg=white,bg=yellow # borders -set -g pane-border-style bold,fg=white +set -g pane-border-style fg=#ffffff +set -g pane-active-border-style fg=#ff0000