aboutsummaryrefslogtreecommitdiff
path: root/dmenu-filepicker
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-02-21 15:44:09 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2022-02-21 15:44:09 +0100
commit57480153adee5b08e9748baeabd6aa11997f17c7 (patch)
treef35a827b06aaf4d320c9d80eafb15d34ed08a7ed /dmenu-filepicker
parent29cfb84fede08cb68fc386ad1c5eb3d164262649 (diff)
downloadscripts-57480153adee5b08e9748baeabd6aa11997f17c7.tar.gz
scripts-57480153adee5b08e9748baeabd6aa11997f17c7.zip
Fixed picking going up to / with ..
Diffstat (limited to '')
-rwxr-xr-xdmenu-filepicker5
1 files changed, 3 insertions, 2 deletions
diff --git a/dmenu-filepicker b/dmenu-filepicker
index 27654f8..547f2b5 100755
--- a/dmenu-filepicker
+++ b/dmenu-filepicker
@@ -13,8 +13,9 @@ while true; do
13 if [ "$sel" = "." ]; then 13 if [ "$sel" = "." ]; then
14 echo "$fullpath" | sed 's|/\.||' 14 echo "$fullpath" | sed 's|/\.||'
15 break 15 break
16 elif [ -d "$fullpath" ]; then 16 elif [ -d "$fullpath" ] || [ -z "$fullpath" ]; then
17 sel=$(ls -a "$fullpath" | sed 's|.*/||' | $menu $menuopts) 17 if [ -z "$fullpath" ]; then fp="/"; else fp="$fullpath"; fi
18 sel=$(ls -a "$fp" | sed 's|.*/||' | $menu $menuopts)
18 if [ "$sel" = ".." ]; then 19 if [ "$sel" = ".." ]; then
19 fullpath=$(echo "$fullpath" | sed "s|/[^/]*$||") 20 fullpath=$(echo "$fullpath" | sed "s|/[^/]*$||")
20 else 21 else

Generated with cgit - Back to sebastiano.tronto.net