dotfiles/scripts/menu/menu-mount
2023-08-03 18:22:46 -06:00

11 lines
454 B
Bash
Executable file

#!/bin/sh
# Mount devices based on LABEL,
# will not work with uuid or other
# disk identification method
# Get LABEL of disk and device name
disk=$(blkid | grep -wv primary | cut -d '=' -f 2 | cut -d '"' -f2 | menu "Mount:")
device=$(blkid | grep "$disk" | cut -d ':' -f 1 | cut -d '/' -f 3)
# Attempt to mount $device and notify success of command
mount /dev/"$device" && notify-send "$disk" "Mounted" || notify-send "$disk" "Operation unsuccessful"