summaryrefslogtreecommitdiff
path: root/dmenu_books
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2025-08-30 01:09:18 -0500
committerzachir <zachir@librem.one>2025-08-30 01:09:18 -0500
commitf28d694879239d5d9c319185a278236d317a49b6 (patch)
tree3f684e05c6372c8f0fc0b9f126a184f3aaad68d4 /dmenu_books
parent7d3cbe8f708772e40608260590b717dea6735908 (diff)
Make sh scrips POSIX compliant
Using shellcheck, I went through all of them to make them standards compliant. I also tested as many as I could.
Diffstat (limited to 'dmenu_books')
-rwxr-xr-xdmenu_books9
1 files changed, 3 insertions, 6 deletions
diff --git a/dmenu_books b/dmenu_books
index 3b6f1fe..a579476 100755
--- a/dmenu_books
+++ b/dmenu_books
@@ -5,15 +5,12 @@ printhelp () {
}
while getopts "hd:" o; do case "${o}" in
- d) ARGS="$ARGS$OPTARG " ;;
+ d) ARG="$OPTARG" ;;
*) printhelp ;;
esac done
-DMENU="dmenu"
-DEFARGS="-l 15 -p"
-
-BOOK=`ls ~/Documents/shared | $DMENU $DEFARGS \"books\" $ARGS`
+BOOK=$(find ~/Documents/shared | dmenu -l 15 -p \"books\" ${ARG:+"$ARG"})
[ -z "$BOOK" ] && exit 1
-zathura "~/Documents/shared/$BOOK"
+zathura "$HOME/Documents/shared/$BOOK"