aboutsummaryrefslogtreecommitdiff
path: root/env/.local/bin/scripts/dmount
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2025-06-30 00:05:45 -0500
committericeyrazor <iceyrazor@mailfence.com>2025-06-30 00:05:45 -0500
commitb95ae4c5c9ff4d693d6424cce8a0d579754c4202 (patch)
treeaa6385301fc4dce26d70bc473fd876c794fc5f74 /env/.local/bin/scripts/dmount
parent22b2eb9a952bf252af29eb5ed905de4bb62386a2 (diff)
- moved system scripts to here
- config changes - fixed my backup scripts. rsync -a - added dmenu script - fixed finds in env.sh
Diffstat (limited to 'env/.local/bin/scripts/dmount')
-rwxr-xr-xenv/.local/bin/scripts/dmount35
1 files changed, 35 insertions, 0 deletions
diff --git a/env/.local/bin/scripts/dmount b/env/.local/bin/scripts/dmount
new file mode 100755
index 0000000..6a3415c
--- /dev/null
+++ b/env/.local/bin/scripts/dmount
@@ -0,0 +1,35 @@
+#!/bin/bash
+sudo="sudo"
+[ doas ] && sudo="doas"
+
+umo=0
+
+while getopts "u" opt; do
+ case "$opt" in
+ u) umo=1
+ ;;
+ esac
+done
+
+shift $((OPTIND-1))
+[ "${1:-}" = "--" ] && shift
+
+if [ $umo == 1 ]; then
+ nf=4
+else
+ nf=3
+fi
+
+
+parts="$(lsblk -rno path,size,type,mountpoint | grep -e part -e lvm | awk "NF==$nf {print \$1, \$2, \$3, \$4}")"
+
+# choice="$(printf "$parts" | rofi -dmenu "beans" | sed 's/ .*//')"
+choice="$(printf "$parts" | fzf | sed 's/ .*//')"
+
+[ "$choice" == "" ] && exit 0
+
+if [ $umo == 1 ]; then
+ $sudo umount $choice
+else
+ $sudo mount $choice ~/u
+fi