From ce2923f6be5fa13ddc1910d80227c3800ace6bc2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 29 Dec 2016 00:20:10 -0500 Subject: [PATCH] os/arch: add automount sub-topic --- os/arch/automount/README.md | 4 ++++ os/arch/automount/bin/notify-mount | 6 ++++++ os/arch/automount/install | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 os/arch/automount/README.md create mode 100755 os/arch/automount/bin/notify-mount create mode 100644 os/arch/automount/install 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