aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2018-11-25 21:41:10 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2018-11-25 21:41:10 +0100
commit061c5efe58ab33deef712f7b8199efa7a3083352 (patch)
tree7f9581c6ad7dd891c4126f6f313505cc5e25fb18
parent02500565fa852dba828e9de91f34559cc0e41b1c (diff)
downloadscripts-061c5efe58ab33deef712f7b8199efa7a3083352.tar.gz
scripts-061c5efe58ab33deef712f7b8199efa7a3083352.zip
Cleaned mount scripts
-rw-r--r--dmenuMount.sh4
-rw-r--r--dmenuUmount.sh2
2 files changed, 1 insertions, 5 deletions
diff --git a/dmenuMount.sh b/dmenuMount.sh
index 05615cc..1e39427 100644
--- a/dmenuMount.sh
+++ b/dmenuMount.sh
@@ -19,7 +19,6 @@
pgrep -x dmenu && exit
# Select partition to mount
-mountable=$(lsblk -lp | grep "part $" | awk '{print $1, "(" $4 ")"}')
mountable=""
i=0
while read -r line
@@ -27,13 +26,13 @@ do
i=$((i+1))
mountable="$mountable$i. $( echo "$line" | awk '{print $1, "(" $4 ")"}' )"$'\n'
done <<< "$(lsblk -lp | grep "part $" )"
+[[ "$mountable" = "" ]] && exit 1
lines=$(echo "$mountable" | wc -l)
chosen=$(echo "$mountable" | dmenu -i -l $lines -p "Mount which drive?" | awk '{print $2}')
[[ "$chosen" = "" ]] && exit 1
mount "$chosen" && notify-send "$chosen mounted" && exit 0
# Select mount point
-dirs=$(find /media /home/inigo/mounts -type d -maxdepth 3 -empty 2>/dev/null)
directories=""
i=0
while read -r line
@@ -47,5 +46,4 @@ mountpoint=$(echo "$directories" | dmenu -i -l $lines -p "Type in mount point."
if [[ ! -d "$mountpoint" ]]; then
bash /home/inigo/scripts/prompt.sh "$mountpoint does not exist. Create it?" "mkdir -p $mountpoint"
fi
-#sudo -u inigo mount $chosen $mountpoint && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint."
mount $chosen $mountpoint && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint."
diff --git a/dmenuUmount.sh b/dmenuUmount.sh
index ecc5160..99e60db 100644
--- a/dmenuUmount.sh
+++ b/dmenuUmount.sh
@@ -21,10 +21,8 @@ do
i=$((i+1))
drives="$drives$i. $( echo "$line" | awk '{print $1, "(" $4 ")", "on", $7}' )"$'\n'
done <<< "$(lsblk -lp | grep "part /" | grep -v "$exclusionregex" )"
-
[[ "$drives" = "" ]] && exit
lines=$(echo "$drives" | wc -l)
chosen=$(echo "$drives" | dmenu -i -l $lines -p "Unmount which drive?" | awk '{print $2}')
[[ "$chosen" = "" ]] && exit
umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted."
-#umount $chosen && notify-send "$chosen unmounted."