dot

packages and services management
Log | Files | Refs | README

commit a121c7d8acf12e8f4e09ebf9a8c85969f98b1a59
parent 91d2b7e0184b22b4e724a32e21e45800562e54a3
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 19 Dec 2017 18:45:08 +0100

always display the whole $HOME

Diffstat:
Mbin/io | 32+++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/bin/io b/bin/io @@ -2,28 +2,22 @@ export LC_COLLATE=C -mkdir -p "$HOME/.cache/find" -cache=$HOME/.cache/find/$(printf %s "${PWD##$HOME/}" | sed "s|/.*||") -find='( -name .git -o -name CVS ) -prune -o -print' +cache=$HOME/.cache/find/ +mkdir -p "$cache" + +case $PWD in ($HOME/*) + dir=$(printf %s "${PWD##$HOME/}" | sed 's|/.*||') + find "$HOME/$dir" '(' -name .git -o -name CVS ')' -prune -o -print | + sort > "$cache/$dir" +esac exec xdg-open "$(iomenu -# << EOF | cut -f 2 $(xdg-open) -#---files----------------------------------------------------------------------- -$( -case $PWD in -($HOME) - find . -maxdepth 1 -mindepth 1 \ - -exec test -f .cache/find/{} ';' -exec cat .cache/find/{} ';' - ;; -($HOME/*) - find "$PWD" $find | tee "$cache" - ;; -(*) - find "$PWD" -maxdepth 3 $find - ;; -esac | sort -) -#---uri------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +$(find "$HOME" -maxdepth 1 -mindepth 1 | sort | cut -c $((${#HOME} + 2))- | + xargs -I {} printf '%s/%s\n' "$cache" {} | + xargs -I {} cat "$cache" {} 2> /dev/null) +#------------------------------------------------------------------------------- $(cat "$HOME/etc/lib/uri") EOF )"