scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

commit b88e387692f87ccb3a2b6c56d2f4aa4cbf9e9917
parent 8078747f2700f562070b9d2908ee473387313e47
Author: Sebastiano Tronto <sebastiano.tronto@gmail.com>
Date:   Fri, 14 Jan 2022 20:09:45 +0100

Fixed bug and added sel open command

Diffstat:
Msel | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sel b/sel @@ -9,9 +9,10 @@ # cp: copy to current dir, possbily after editing filenames # edit: open selection in editor # mv: move to current dir, possbily after editing filenames +# open: open files using open-file # rm: remove selected files and clear selection -# Requires: dmenu (or similar), trashrm (optional) +# Requires: dmenu (or similar), trashrm (optional), open-file (for open only) # TODO: add possibility of specifying file. # TODO 2: The usage of paste(1) is a bit of a hack, and for example it does @@ -35,7 +36,6 @@ cphere() { fnew=$(echo "$f" | sed 's/.*\t//') cp -R "$fold" ./"$fnew" done - clear } remove() { @@ -80,6 +80,7 @@ case "$1" in ;; cp) cphere + clear ;; edit) $editor "$file" @@ -87,6 +88,12 @@ case "$1" in mv) cphere remove + clear + ;; + open) + while read f; do + open-file "$f" + done < "$file" ;; rm) remove