aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/unmount_usb.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/.local/bin/unmount_usb.sh b/.local/bin/unmount_usb.sh
index 764365c..1c257a8 100755
--- a/.local/bin/unmount_usb.sh
+++ b/.local/bin/unmount_usb.sh
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
+shopt -s expand_aliases
+# alias usb_prompt='dmenu -p'
+alias usb_prompt='rofi -dmenu -p'
+
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
@@ -7,6 +11,6 @@ if [ $opt_num == 0 ]; then
elif [ $opt_num == 1 ]; then
udiskie-umount "$options"
else
- unmount_device=$(echo "$options" | dmenu -p "What device you want to unmount?")
+ unmount_device=$(echo "$options" | usb_prompt "What device you want to unmount?")
[[ ! -z "$unmount_device" ]] && udiskie-umount "$unmount_device"
fi