aboutsummaryrefslogtreecommitdiff
path: root/stuff/scripts
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-08-18 14:09:08 +0200
committerMateja <mail@matejamaric.com>2020-08-18 14:09:08 +0200
commit7775115024777a6a891b3fba33b6972187e4b6ef (patch)
tree891fee4b582264633563079c9d26537033511279 /stuff/scripts
downloaddotfiles-7775115024777a6a891b3fba33b6972187e4b6ef.tar.gz
dotfiles-7775115024777a6a891b3fba33b6972187e4b6ef.zip
first commit
Diffstat (limited to 'stuff/scripts')
-rwxr-xr-xstuff/scripts/unmount-usb11
1 files changed, 11 insertions, 0 deletions
diff --git a/stuff/scripts/unmount-usb b/stuff/scripts/unmount-usb
new file mode 100755
index 0000000..f195317
--- /dev/null
+++ b/stuff/scripts/unmount-usb
@@ -0,0 +1,11 @@
+#!/bin/bash
+options=$(lsblk | grep /run/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" | rofi -dmenu -p "What device you want to unmount?")
+ udiskie-umount "$unmount_device"
+fi