profile: Fallback to custom udisks-automount
parent
3b429e3a32
commit
83c6396485
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
## From https://wiki.archlinux.org/index.php/Udisks#udevadm_monitor.
|
||||
|
||||
pathtoname() {
|
||||
udevadm info -p /sys/"$1" | awk -v FS== '/DEVNAME/ {print $2}'
|
||||
}
|
||||
|
||||
stdbuf -oL -- udevadm monitor --udev -s block | while read -r -- _ _ event devpath _; do
|
||||
if [ "$event" = add ]; then
|
||||
devname=$(pathtoname "$devpath")
|
||||
udisksctl mount --block-device "$devname" --no-user-interaction
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue