summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-11 21:48:56 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-11 21:48:56 +0200
commita857f247d9a71b88a4f0dbcfa95e3679e8456e70 (patch)
tree846ddcd8117be1505a970e3638fc65d0ec954a2e /bin/guiscripts
parent75196520b3d6a0e60db1d03a64aaa0655cc4f202 (diff)
parent6251d6ba1054cd79387f0f88ce25d2f4bc8b78c4 (diff)
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/dmfm22
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm
index 9485469..b7a68d2 100755
--- a/bin/guiscripts/dmfm
+++ b/bin/guiscripts/dmfm
@@ -1,20 +1,20 @@
#!/bin/sh
-while true
-do
- dir="$(printf '%s' "$PWD" | sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g")"
- file=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' |
+[ -d "$1" ] && cd "$1"
+
+while true; do
+ choice=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' |
sort -k 1 -k 2 | cut -f 2- |
- commander -xc -p "$dir")
+ dmenu -x -c -i -p "$(pwd)")
- [ "$file" ] || break
- [ ! -e "$file" ] && continue
+ [ "$choice" ] || break
+ [ -e "$choice" ] || continue
- if [ -d "$file" ]
- then
- cd "$file" || continue
+ if [ -d "$choice" ]; then
+ cd "$choice" || continue
else
- setsid xdg-open "$PWD/$file" &
+ setsid xdg-open "$choice" &
+ exit
fi
done