diff --git a/os/arch/automount/README.md b/os/arch/automount/README.md new file mode 100644 index 00000000..a31fb729 --- /dev/null +++ b/os/arch/automount/README.md @@ -0,0 +1,4 @@ +# Device automounting (powered by udevil) + +Sets up udevil+devmon to look out for new devices, auto-mounts them, then notifies you +via `notify-send`. diff --git a/os/arch/automount/bin/notify-mount b/os/arch/automount/bin/notify-mount new file mode 100755 index 00000000..8c82122d --- /dev/null +++ b/os/arch/automount/bin/notify-mount @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# A script run by devmon/udevil when a device is mounted or unmounted, notifying me. + +DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send -a "devmon" "Device change" "$2" +aplay -N -q /usr/share/sounds/ding.wav & diff --git a/os/arch/automount/install b/os/arch/automount/install new file mode 100644 index 00000000..b9b2d50e --- /dev/null +++ b/os/arch/automount/install @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +[[ -f /etc/arch-release ]] || exit + +sudo pacman -Ss udevil +sudo systemctl enable devmon@$(whoami) +sudo systemctl start devmon@$(whoami) + +sudo sed -i 's@^# \(success_exec =\)@\1 /home/hlissner/.dotfiles/os/arch/udevil/bin/notify-mount@' udevil.conf