aboutsummaryrefslogblamecommitdiff
path: root/.local/bin/unmount_usb.sh
blob: c90dde424b9b8ddcbf4bd5382c2b606e92451cfe (plain) (tree)
1
2
3
4
5
6
7
8
9
10
           
                                                                  





                                                                    

                                                                                       
  
#!/bin/bash
options=$(lsblk | grep /media/$USER | rev | cut -d ' ' -f 1 | rev)
[ -n "$options" ] && opt_num=$(echo "$options" | wc -l) || opt_num=0
if [ $opt_num == 0 ]; then
	notify-send "Nothing mounted!"
elif [ $opt_num == 1 ]; then
	udiskie-umount "$options"
else
	unmount_device=$(echo "$options" | dmenu -p "What device you want to unmount?")
	[[ ! -z "$unmount_device" ]] && udiskie-umount "$unmount_device"
fi