From db8b36c89bb56651b11bf34da61bca236472afaa Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Sun, 31 Jul 2022 12:02:45 +0200 Subject: Created dmenuOpen.sh to select a file in a folder and open it. --- dmenuOpen.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 dmenuOpen.sh diff --git a/dmenuOpen.sh b/dmenuOpen.sh new file mode 100755 index 0000000..ff0a839 --- /dev/null +++ b/dmenuOpen.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# dmenuOpen.sh +# +# Selects a file in a folder with dmenu and opens it with rifle + +set -euo pipefail +IFS=$'\n\t' + +folder="$1" +[ -z "$folder" ] && exit 0 + +lines="$(find "$folder" -type f | wc -l)" +selected="$(find "$folder" -type f | grep -o '[^/]*$' | dmenu -l "$lines" -p "File to open: ")" +o "${folder}/${selected}" -- cgit v1.2.1