diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-01-24 14:24:44 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-01-24 14:24:44 +0100 |
commit | da8c4b7b65235909b7c03da480689d9d871f8d59 (patch) | |
tree | 5dbcadd5a70c172eed8300efec727552eae89301 /dmenuMount.sh | |
parent | 95aa68aeb4b629e9a98a9a480a558b757b2a732e (diff) | |
download | scripts-da8c4b7b65235909b7c03da480689d9d871f8d59.tar.gz scripts-da8c4b7b65235909b7c03da480689d9d871f8d59.zip |
Created music mode and added some other little stuff.
Diffstat (limited to 'dmenuMount.sh')
-rwxr-xr-x | dmenuMount.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dmenuMount.sh b/dmenuMount.sh index c94543b..a5fb0d7 100755 --- a/dmenuMount.sh +++ b/dmenuMount.sh @@ -29,10 +29,10 @@ 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" && pgrep -x dunst && notify-send "$chosen mounted" && exit 0 +[ "$chosen" == "" ] && exit 1 +sudo mount "$chosen" && pgrep -x dunst && notify-send "$chosen mounted" && exit 0 -# Select mount point +# Select mount point (reached if previous mount failed, e.g. device not in /etc/fstab) directories="" i=0 while read -r line @@ -42,7 +42,7 @@ do done <<< "$(find /media ~/mounts -type d -maxdepth 3 -empty 2>/dev/null)" lines=$(echo "$directories" | wc -l) mountpoint=$(echo "$directories" | dmenu -i -l $lines -p "Type in mount point." | awk '{print $2}') -[[ "$mountpoint" = "" ]] && exit 1 +[ "$mountpoint" == "" ] && exit 1 if [[ ! -d "$mountpoint" ]]; then bash ~/scripts/prompt.sh "$mountpoint does not exist. Create it?" "mkdir -p $mountpoint" fi |