diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-05-18 17:54:09 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-05-18 17:54:09 +0200 |
commit | ce43b91f3035dcc984ed519920198ef91bf89177 (patch) | |
tree | 817ddf8a08a327d18c3f13f736c3fc937b5b191c /usb-device-remove.sh | |
parent | 65f4b25db5d0f085b2a33b5fb22b6e8d364afdc9 (diff) | |
download | scripts-ce43b91f3035dcc984ed519920198ef91bf89177.tar.gz scripts-ce43b91f3035dcc984ed519920198ef91bf89177.tar.bz2 scripts-ce43b91f3035dcc984ed519920198ef91bf89177.zip |
update
Diffstat (limited to 'usb-device-remove.sh')
-rwxr-xr-x | usb-device-remove.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usb-device-remove.sh b/usb-device-remove.sh index 55189d5..e9d8cd5 100755 --- a/usb-device-remove.sh +++ b/usb-device-remove.sh @@ -5,7 +5,7 @@ export DISPLAY=:0 export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" busname="/dev/$1"; -devpath=$2; +#devpath="$2"; deviceDetails=$(lsusb -D ${busname} 2>/dev/null | head -n 1) deviceName=$(cut -d " " -f4- <<< ${deviceDetails}) @@ -15,20 +15,25 @@ case "$deviceID" in "1b3f:2019") pactl set-default-source rnnoise_source dunstify -t 2000 -a "Microphone" -u low -i media-removable-symbolic \ - -h string:x-dunst-stack-tag:usb-microphone "USB Microphone removed" + -h string:x-dunst-stack-tag:usb-microphone "$deviceName removed" ;; "04e8:4001") # Samsung Electronics Co., Ltd PSSD T7 dunstify -t 2000 -a "SSD" -u low -i media-removable-symbolic \ - -h string:x-dunst-stack-tag:usb-ssd "USB SSD disconnected" + -h string:x-dunst-stack-tag:usb-ssd "$deviceName removed" ;; + "2237:4237") + # Kobo Clara Colour + dunstify -t 2000 -a "SSD" -u low -i media-removable-symbolic \ + -h string:x-dunst-stack-tag:usb-ssd "$deviceName removed" + ;; "8087:0024") # Intel Corp. Integrated Rate Matching Hub # internal hub, do nothing ;; *) dunstify -u normal -t 1000 -r 9000 -i media-removable-symbolic \ - -h string:x-dunst-stack-tag:usb-device "Removed $deviceDetails" + -h string:x-dunst-stack-tag:usb-device "$deviceID $deviceName removed" ;; esac |