17 lines
384 B
Bash
17 lines
384 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
name="$(lsblk -lpno"name,size,type,mountpoint"\
|
||
|
| grep "/dev\/sd.*part"\
|
||
|
| fuzzel -d -p "mount > "\
|
||
|
| cut -d" " -f1)"
|
||
|
|
||
|
[ -z "$name" ] && return
|
||
|
|
||
|
mountpoint="$(lsblk -lpno"mountpoint" "$name")"
|
||
|
|
||
|
if [ -z "$mountpoint" ]; then
|
||
|
exec udisksctl mount -b "$name" 2>&1 | xargs -I{} notify-send "{}"
|
||
|
else
|
||
|
exec udisksctl unmount -b "$name" 2>&1 | xargs -I{} notify-send "{}"
|
||
|
fi
|