summaryrefslogtreecommitdiff
path: root/bin
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
parent9928d64cd712a25634481e81d67d2537ccdaf4df (diff)
refactor
Diffstat (limited to 'bin')
-rwxr-xr-xbin/guiscripts/dmfm28
-rwxr-xr-xbin/menuscripts/mhelp6
2 files changed, 18 insertions, 16 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
diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp
index 339d6bf..cb7977b 100755
--- a/bin/menuscripts/mhelp
+++ b/bin/menuscripts/mhelp
@@ -1,16 +1,16 @@
#!/usr/bin/env sh
-program="$(commander -r -c -d)"
+program="$(commander -rcd)"
[ "$program" ] || exit 1
option="$("$program" --help |
# Parse options
- grep "^ *-[-a-zA-Z0-9]* " |
+ grep -- "^ *-[-a-zA-Z0-9]* " |
tr -s ' ' |
sort | uniq |
column -l 2 -t |
- commander -l -x -c -d |
+ commander -lxcd |
awk '{print $1}')"
[ "$option" ] || exit 1