summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-19 11:22:31 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-19 11:22:31 +0200
commit067b07eb24262b34c00fe7be786cbdcfcd6383c6 (patch)
tree6bb3d51de3cccd6a12a223075436cf484cbe5ac6 /bin/guiscripts
parent9928d64cd712a25634481e81d67d2537ccdaf4df (diff)
refactor
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/dmfm28
1 files changed, 15 insertions, 13 deletions
diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm
index 969c111..d1dd8b8 100755
--- a/bin/guiscripts/dmfm
+++ b/bin/guiscripts/dmfm
@@ -1,17 +1,19 @@
#!/bin/sh
-file=1
-while [ "$file" ]; do
- file=$(ls -1 --group-directories-first | dmenu -i -l 8 -g 1 -p "$(basename $(pwd)):")
- if [ -e "$file" ]; then
- owd=$(pwd)
- if [ -d "$file" ]; then
- cd "$file"
- else [ -f "$file" ]
- if which xdg-open &> /dev/null; then
- exec xdg-open "$owd/$file" &
- unset file
- fi
- fi
+while true
+do
+ file=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' |
+ sort -k 1 -k 2 | cut -f 2- |
+ commander -xcd -p "$PWD>")
+
+ [ "$file" ] || break
+ [ ! -e "$file" ] && continue
+
+ if [ -d "$file" ]
+ then
+ cd "$file" || continue
+ else
+ setsid xdg-open "$PWD/$file" &
fi
+
done