1
0
Fork 0
dot/.local/bin/fuzzel_udisksctl.sh

17 lines
384 B
Bash
Executable File

#!/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