summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-08-16 13:21:09 -0500
committerzachir <zachir@librem.one>2023-08-16 13:21:09 -0500
commitcf8b3ea27cb1a5eb14a1c1a932f908e165653d88 (patch)
tree0ce88d73770e0cbf339362126d257df07c226520
parent63d56b52a85da451a04f63a6948287e7602fc687 (diff)
Large fix, support hfsplus
-rwxr-xr-xdmount25
1 files changed, 17 insertions, 8 deletions
diff --git a/dmount b/dmount
index bbfd587..bc49df5 100755
--- a/dmount
+++ b/dmount
@@ -29,6 +29,8 @@ while getopts "hpPugd:" o; do case "${o}" in
exit 1;;
esac done
+IS_HFS=""
+
if [ -n "$WAYLAND_DISPLAY" ]; then
DMENU="tofi"
DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text"
@@ -89,24 +91,31 @@ getmount() { \
mount_device () {
getmount "/mnt /media /mount /home -maxdepth 3 -type d -empty $alreadymounted"
- if [ -z "$USE_USER_ID" ]; then
- doas mount "$1" "$mp" && show "Mounted successfully\n"
- else
+ if [ -n "$USE_USER_ID" ]; then
if [ -n "$USERID" -a -n "$GROUPID" ]; then
- MOUNTPROPS="uid=$USERID,gid=$GROUPID"
+ MOUNTPROPS="-o uid=$USERID,gid=$GROUPID"
elif [ -n "$USERID" ]; then
- MOUNTPROPS="uid=$USERID"
+ MOUNTPROPS="-o uid=$USERID"
elif [ -n "$GROUPID" ]; then
- MOUNTPROPS="gid=$GROUPID"
+ MOUNTPROPS="-o gid=$GROUPID"
+ else
+ MOUNTPROPS="-o $(grep "$(whoami)" /etc/passwd | sed 's/:/ /g' | awk '{print "uid="$3",gid="$4}')"
+ fi
+ fi
+ if [ -n "$IS_HFS" ]; then
+ MOUNTARGS="-t hfsplus"
+ if [ -z "$MOUNTPROPS" ]; then
+ MOUNTPROPS="-o force,rw"
else
- MOUNTPROPS="$(grep "$(whoami)" /etc/passwd | sed 's/:/ /g' | awk '{print "uid="$3",gid="$4}')"
+ MOUNTPROPS="${MOUNTPROPS},force,rw"
fi
- doas mount -o "$MOUNTPROPS" "$1" "$mp" && show "Mounted successfully\n"
fi
+ doas mount $MOUNTARGS $MOUNTPROPS "$1" "$mp" && show "Mounted successfully\n"
}
DEVICE="$(get_available | $DMENU $DEFARGS "Devices" $ARGS )"
[ -z "$DEVICE" ] && exit 1
+echo "$DEVICE" | grep -q "hfsplus" && IS_HFS="y"
chosen="${DEVICE%% *}"
if [ -n "$(is_crypto "$chosen")" ]; then