From 97487ed1431ed0cfa4f5b6facd69dbd0f13911f4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 3 Mar 2023 19:53:22 +0100 Subject: renamed dmscripts to guiscripts --- bin/guiscripts/dmpdf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/guiscripts/dmpdf (limited to 'bin/guiscripts/dmpdf') diff --git a/bin/guiscripts/dmpdf b/bin/guiscripts/dmpdf new file mode 100755 index 0000000..cf1f0dd --- /dev/null +++ b/bin/guiscripts/dmpdf @@ -0,0 +1,14 @@ +#!/bin/bash + +find ${1:-~/docs ~/Downloads} 2> /dev/null | grep -E ".+\.pdf" | sort > /tmp/dmpdf +choice="$(\ + sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmpdf \ + | awk '{printf "%s %s\n", NR ":", $0}' \ + | dmenu -l 10 -g 1 -x -i \ + | grep -oE "^[0-9]+:" \ +)" +if [ -z "$choice" ]; then + exit +fi +file="$(sed -n "${choice::-1}p" /tmp/dmpdf)" +evince "$file" & -- cgit v1.2.3