From 6e1ce4f87831d3761a46497f80e56ac7a73e14c8 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 9 Apr 2019 16:26:46 +0200 Subject: Minor changes. --- dmenuUmount.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dmenuUmount.sh') diff --git a/dmenuUmount.sh b/dmenuUmount.sh index 7c19019..d2c8fb3 100755 --- a/dmenuUmount.sh +++ b/dmenuUmount.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # _ # __| |_ __ ___ ___ _ __ _ _ # / _` | '_ ` _ \ / _ \ '_ \| | | | @@ -15,7 +15,7 @@ exclusionregex="\(/boot/efi\|/home\|/\)$" list="$(lsblk -lp | grep "part /" | grep -v "$exclusionregex")" -[ "$list" == "" ] && notify-send -t 2000 "No devices found to unmount." && exit 0 +[ "$list" = "" ] && notify-send -t 2000 "No devices found to unmount." && exit 0 drives="" i=0 while read -r line @@ -28,8 +28,8 @@ do fstype="$(lsblk -lpo "name,fstype" | grep "$name" | awk '{print $2}')" drives="$drives$i. $name ($size) \"$label\" [$fstype] on $mountpoint"$'\n' done <<< "$list" -[ "$drives" == "" ] && exit +[ "$drives" = "" ] && exit lines=$(echo "$drives" | wc -l) -chosen=$(echo "$drives" | dmenu -i -l $lines -p "Unmount which drive?" | awk '{print $2}') -[ "$chosen" == "" ] && exit -sudo umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted." +chosen=$(echo "$drives" | dmenu -i -l "$lines" -p "Unmount which drive?" | awk '{print $2}') +[ "$chosen" = "" ] && exit +sudo umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted." -- cgit v1.2.1