blob: 7426115a6e23ad325beb84628bb981f7f2088f0b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#! /usr/bin/env dash
# shellcheck source=/dev/null
SHELL_LIBRARY_VERSION="2.0.13" . %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
;;
esac
|