diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2018-11-21 12:41:02 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2018-11-21 12:41:02 +0100 |
commit | 7084dd910dfe20a23d8792b0966c4f226157019a (patch) | |
tree | 18d7b6127fcec117473953a268b409f41bf4d0c1 | |
parent | 2109ef0fc6e963abfa0c1139016da3de65ea54e6 (diff) | |
download | scripts-7084dd910dfe20a23d8792b0966c4f226157019a.tar.gz scripts-7084dd910dfe20a23d8792b0966c4f226157019a.zip |
Mount scripts now use dmenu lines
-rw-r--r-- | dmenuMount.sh | 6 | ||||
-rw-r--r-- | dmenuUmount.sh | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/dmenuMount.sh b/dmenuMount.sh index 00c1e73..ce0d93b 100644 --- a/dmenuMount.sh +++ b/dmenuMount.sh @@ -20,12 +20,14 @@ pgrep -x dmenu && exit mountable=$(lsblk -lp | grep "part $" | awk '{print $1, "(" $4 ")"}') [[ "$mountable" = "" ]] && exit 1 -chosen=$(echo "$mountable" | dmenu -i -p "Mount which drive?" | awk '{print $1}') +lines=$(echo "$mountable" | wc -l) +chosen=$(echo "$mountable" | dmenu -i -l $lines -p "Mount which drive?" | awk '{print $1}') [[ "$chosen" = "" ]] && exit 1 #sudo -u inigo mount "$chosen" && exit 0 mount "$chosen" && notify-send "$chosen mounted" && exit 0 dirs=$(find /media /home/inigo/mounts -type d -maxdepth 3 -empty 2>/dev/null) -mountpoint=$(echo "$dirs" | dmenu -i -p "Type in mount point.") +lines=$(echo "$dirs" | wc -l) +mountpoint=$(echo "$dirs" | dmenu -i -l $lines -p "Type in mount point.") [[ "$mountpoint" = "" ]] && exit 1 if [[ ! -d "$mountpoint" ]]; then bash /home/inigo/scripts/prompt.sh "$mountpoint does not exist. Create it?" "mkdir -p $mountpoint" diff --git a/dmenuUmount.sh b/dmenuUmount.sh index 873ad2d..f50f4aa 100644 --- a/dmenuUmount.sh +++ b/dmenuUmount.sh @@ -16,7 +16,8 @@ exclusionregex="\(/boot\|/home\|/\)$" drives=$(lsblk -lp | grep "part /" | grep -v "$exclusionregex" | awk '{print $1, "(" $4 ")", "on", $7}') [[ "$drives" = "" ]] && exit -chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') +lines=$(echo "$drives" | wc -l) +chosen=$(echo "$drives" | dmenu -i -l $lines -p "Unmount which drive?" | awk '{print $1}') [[ "$chosen" = "" ]] && exit umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted." #umount $chosen && notify-send "$chosen unmounted." |