added multiselection support to de
This commit is contained in:
parent
6880d648c6
commit
79c9a24006
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
#A script that launches documents in their respective viewers
|
#A script that launches documents in their respective viewers
|
||||||
#either via dmenu or fzf depending on the context
|
#either via dmenu or fzf depending on the context
|
||||||
ppid () { ps -p ${1:-$$} -o ppid=; }
|
ppid () { ps -p ${1:-$$} -o ppid=; }
|
||||||
@ -27,10 +27,13 @@ else
|
|||||||
fi
|
fi
|
||||||
#process selection if it's from dmenu
|
#process selection if it's from dmenu
|
||||||
[ -z "$file" ] && exit
|
[ -z "$file" ] && exit
|
||||||
path="$(printf '%s%s' "$HOME" "${file//\~/}")"
|
path="$(echo "$file" | sed "s|\~|$HOME|")"
|
||||||
cd "$( dirname "$path" )" || exit
|
echo "$path" |
|
||||||
if rifle -l "$path" | head -n1 | grep -q 'EDITOR';then
|
while read -r pathfile; do
|
||||||
st rifle "$path"
|
cd "$( dirname "$pathfile" )" || exit
|
||||||
|
if rifle -l "$pathfile" | head -n1 | grep -q 'EDITOR';then
|
||||||
|
st rifle "$pathfile"
|
||||||
else
|
else
|
||||||
rifle "$path"
|
rifle "$pathfile"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user