diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-02-21 15:44:09 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-02-21 15:44:09 +0100 |
| commit | 57480153adee5b08e9748baeabd6aa11997f17c7 (patch) | |
| tree | f35a827b06aaf4d320c9d80eafb15d34ed08a7ed /dmenu-filepicker | |
| parent | 29cfb84fede08cb68fc386ad1c5eb3d164262649 (diff) | |
| download | scripts-57480153adee5b08e9748baeabd6aa11997f17c7.tar.gz scripts-57480153adee5b08e9748baeabd6aa11997f17c7.zip | |
Fixed picking going up to / with ..
Diffstat (limited to '')
| -rwxr-xr-x | dmenu-filepicker | 5 |
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 |
