dot

packages and services management
Log | Files | Refs | README

commit 19c39dd9844f0eb2abfa7d2b1e99dc2249d71d81
parent c47d0138b45fac76d5335c2ea6c53f91b789b524
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 21 Mar 2018 03:30:42 +0100

the solution is sometimes so simple

Diffstat:
Mbin/xdg-abduco | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/bin/xdg-abduco b/bin/xdg-abduco @@ -7,11 +7,11 @@ dir="$HOME/.abduco" mkdir -p "$dir" -touch "$dir/sessions" +touch "$dir/names" # only keep existing session names -grep -e"^$(abduco | sed -rn 's/.* ([0-9]+)$/\1/p')" "$dir/sessions" | -sort -uo "$dir/sessions" +grep -e "^$(abduco | sed -rn 's/.* ([0-9]+)$/\1/p') " "$dir/names" | + sort -uo "$dir/names" # get the reas path name ! [ -h "$1" ] || set -- "$(readlink -f "$1")" @@ -20,14 +20,13 @@ sort -uo "$dir/sessions" case "$#" in (0) - cut -f 2 "$dir/sessions" + cut -f 2 "$dir/names" ;; (1) - printf '\033]0;%s\a' "$1" 1>&2 hash="$(printf %s "$1" | cksum | cut -d ' ' -f 1)" - printf '%s\t%s\n' "$hash" "$1" >> "$dir/sessions" + printf '%s\t%s\n' "$hash" "$1" >> "$dir/names" [ "$ABDUCO" ] || ABDUCO="$1" exec abduco -A "$hash" xdg-open "$1" ;; esac