dot

packages and services management
Log | Files | Refs | README

commit 7cc386594601b720ab766cfcb938518aa9ae8bb9
parent e6af4a453db6fa1b696e9de7148d9f2d8412ba11
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed,  6 Dec 2017 17:44:06 +0100

only xdg-open in io

Diffstat:
Mbin/io | 72+++++++++++++++++-------------------------------------------------------
Rbin/io-mount -> bin/io-fs | 0
Abin/io-mail | 9+++++++++
Abin/io-man | 9+++++++++
4 files changed, 35 insertions(+), 55 deletions(-)

diff --git a/bin/io b/bin/io @@ -2,59 +2,21 @@ export LC_COLLATE=C -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 > "$HOME/.cache/mail" - cat "$HOME/.cache/mail" -) -#--- man ----------------------------------------------------------------------- -$( - IFS=: - for dir in $MANPATH - do [ $dir -nt "$HOME/.cache/man" ] && - man -k ' ' | sed -r >> "$HOME/.cache/man" \ - -e 's/ - / - /' \ - -e 's/(.{25}[^ ]* ) * - /\1- /' - done - cat "$HOME/.cache/man" -) -#--- files --------------------------------------------------------------------- -$( - mkdir -p "$HOME/.cache/find" - find "$HOME" -maxdepth 1 -mindepth 1 | while IFS='' read -r dir - do - cache=$HOME/.cache/find/${dir##*/} - [ "$dir" -nt "$cache" ] && - find "$dir" -name .git -prune -o -print | sort -o "$cache" - done - find "$HOME/.cache/find" -type f -exec cat {} + -) -#--- uri ----------------------------------------------------------------------- -$(cat "$HOME/etc/uri") -EOF -) +mkdir -p "$HOME/.cache/find" +find "$HOME" -maxdepth 1 -mindepth 1 | while IFS='' read -r dir +do + cache=$HOME/.cache/find/${dir##*/} + [ "$dir" -nt "$cache" ] && + find "$dir" -name .git -prune -o -print | sort -o "$cache" +done -name=${sel##* } -case ${sel%% *} in -(*mail*) - printf %s "$name" | mlist | mthread | msort -r -d | - mseq -S | mscan -f '%6n %u %D %20f %t%2i%120S' | iomenu -p mail | - sed -r 's/^ *([0-9]*) .*/\1/'| xargs mless - ;; -(*man*) - exec man $(printf "$name" | - sed -r 's/([_a-zA-Z0-9]*).*\(([0-9p]+).*\)/\2 \1/') - ;; -(*files*|*uri*) - exec xdg-open "$name" - ;; -('') - printf '\033];2%s\a' "$name" - abduco -a "$(printf %s "$name" | tr / !)" - ;; -esac +name=$({ + xdg-open + printf -- '#----------------------------------------' + printf -- '----------------------------------------\n' + find "$HOME/.cache/find" "$HOME/etc/uri" -type f -exec cat {} + +} | iomenu -# | cut -f 2) + +clear + +exec xdg-open "$name" diff --git a/bin/io-mount b/bin/io-fs diff --git a/bin/io-mail b/bin/io-mail @@ -0,0 +1,9 @@ +#!/bin/sh + +export LC_COLLATE=C + +mdirs "$MAIL/.." | sort | while IFS='' read -r dir +do printf '%s\t%s\n' "$(mlist -s "$dir" | wc -l)" "${dir#$PWD/}" +done | iomenu -p mail | cut -f 2 | mlist | mthread | msort -r -d | +mseq -S | mscan -f '%6n %u %D %20f %t%2i%120S' | iomenu -p mail | +sed -r 's/^ *([0-9]*) .*/\1/'| xargs mless diff --git a/bin/io-man b/bin/io-man @@ -0,0 +1,9 @@ +#!/bin/sh + +export LC_COLLATE=C + +man -k ' ' | sed -r ' + s/ - / - / + s/(.{25}[^ ]* ) * - /\1- / +' | iomenu -p man | sed -r 's/([_a-zA-Z0-9]*).*\(([0-9p]+).*\).*/\2 \1/' | +xargs man