#! /usr/bin/env dash # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH unmounting() { disk_name="$(find /dev/disk/by-label -type l -printf "%P|" | rofi -sep "|" -dmenu -p "Select disk to mount")" udisksctl unmount --block-device "/dev/disk/by-label/$disk_name" } mounting() { disk_name="$(find /dev/disk/by-label -type l -printf "%P|" | rofi -sep "|" -dmenu -p "Select disk to mount")" udisksctl mount --block-device "/dev/disk/by-label/$disk_name" } case "$1" in "mount") mounting ;; "unmount" | "umount") unmounting ;; *) die "Usage: $NAME mount|unmount" ;; esac