Linux MInt 19.x Mate Sounds

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Linux MInt 19.x Mate Sounds

Post by zaileion »

I want to add some system sounds, or activate existing but disabled system sounds. Primarily the USB device connection sound but others also. I don't know which other ones because I don't know which options are available.

I have done my due dilligance and searched for this but have not found anything post Linux MInt 18, and I'm pretty sure Linux Mint 19 is different and dconf doesn't work any more. There is also a script out there specifically for USB connection but there are other posts saying there are already sounds pre-loaded in Linux Mint but just deactivated due to most users finding them annoying. Again, all these posts are pre Linux Mint 19...

To give further explanation... I purchased several android tablets in an auction that may or may not work. The USB connection sound is very handy in Windows when troubleshooting and of course as a Linux lover, I'm forever trying to avoid the use of Windows for anything other than games which is slowly fading also. Wahoo! When the tablet doesn't connect on Linux, i have to quickly connect it to windows to see if there is a sound which further determines that the device does connect, the battery is not bad, and the USB connection is not broken but may just need partitioning and the proper firmware installed... blah... blah.. blah... I'm sure no one cares. :-)

Anyway, how can I activate system sounds?

EDIT: OK so I found several sound files in the /usr/share/sounds directory. How do I "activate" them? Screen capture, camera shutter, power connection, and many others that I would like to implement...

Edit 2: So I found this website but its for Cinnamon. https://unix.stackexchange.com/question ... n-cinnamon It has a list of sound effects. How do I find something like this for Mate? Any ideas or suggestions would be much appreciated!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

Anyone? Any help would be very much appreciated, very much indeed!
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

Hi zaileion.

First, your old post here may be of some use to you again: viewtopic.php?t=218410#p1144101

Regardless, it sounds like you want to be sure your sound theme includes device-added.oga and device-removed.oga. The freedesktop folder in /usr/share/sounds should have those files. If necessary, you could copy them to your chosen sound theme folder.

Hope that helps.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

Thank you for the help!!

Yes, finny thing, i found that post from several years ago and did follow the instructions. I also found this post https://www.debugpoint.com/2018/08/how- ... ntu-linux/ it does work when i connect/disconnect power cord but window, switch, and device connected sounds don't play. I checked that the sound theme did indeed have these files within and did check to make sure the sound files actually contained a sound... for some reason i cannot get them to play.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

If you have changed the theme during this session, you may need to log out-in or reboot before it becomes effective.

I'll see if I can find anything else that may be useful. I don't use MATE myself so don't have anything else to offer off the top of my head.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

Does your Sound Preferences window look like this:
Image

I assume it should be close to that as that's from Ubuntu MATE. Is that bottom box checked on yours? And the Mute box unchecked and volume slider for Alert volume up enough?
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

ok. thank you. it seems that several sound events do not work in Mate. I wish they did... I wonder how to edit the operating system code to enable these events. I use operating system code for lack of a better term. If I could find directions that provided some idea how I would try... I did a quick google search, maybe ill try bluefish...

In response to your post. They are checked, screen shot attached
Attachments
Selection_004.png
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

Your screenshot looks perfect.

Yes, there are sounds that will not work. If it's the same as on Xfce, the main issue is that canberra-gtk-module.c only has this:

Code: Select all

/*
   We generate these sounds:

   dialog-error
   dialog-warning
   dialog-information
   dialog-question
   window-new
   window-close
   window-minimized
   window-unminimized
   window-maximized
   window-unmaximized
   notebook-tab-changed
   dialog-ok
   dialog-cancel
   item-selected
   link-pressed
   link-released
   button-pressed
   button-released
   menu-click
   button-toggle-on
   button-toggle-off
   menu-popup
   menu-popdown
   menu-replace
   tooltip-popup
   tooltip-popdown
   drag-start
   drag-accept
   drag-fail
   expander-toggle-on
   expander-toggle-off

   TODO:
   scroll-xxx
   window-switch
   window-resize-xxx
   window-move-xxx

*/
Other apps or the OS itself can add event sounds that aren't in that list. Such as Thunderbird having a sound play when new mail arrives. How each go about this, I don't know.

I'm sure there's a way to capture the device connected event (ACPI listening maybe, or a udev rule?) that you could then simply play a sound file of your choosing when it occurs, but that's above my pay grade. I'll try searching and see if I find something that seems simple enough.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

simple sounds great! udev rules, i saw that in a script somewhere, ill check it out. thanks again for the assistance, and research!
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

Here's the best thing I've found: https://help.ubuntu.com/community/UsbDr ... thingHowto

Based on that, for your use here's what I'd do:

1. In the terminal enter sudo touch /etc/udev/rules.d/99-deviceconnected.rules
2. In the terminal enter xed admin:///etc/udev/rules.d/99-deviceconnected.rules
3. When the file opens, add this content:

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", RUN+="/usr/local/bin/99-deviceconnected.sh"
4. Save and close the file and ignore the warnings from the terminal.
5. In the terminal enter sudo touch /usr/local/bin/99-deviceconnected.sh
6. In the terminal enter xed admin:///usr/local/bin/99-deviceconnected.sh
7. When the file opens add this content:

Code: Select all

#!/bin/bash
canberra-gtk-play -i device-added
8. Save and close that file and ignore the warnings from the terminal.
9. In the terminal enter sudo chmod +x /usr/local/bin/99-deviceconnected.sh
10. Reboot and pray it works!
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

it doesnt work. :-(

I tried this command canberra-gtk-play -i device-added and it does indeed play the sound.

here is my udev output. My phone requires me to "allow" connection this the removal and reconnection. I connect and it bonds, then i click allow on the phone, it unbinds then rebinds...

Code: Select all

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[193.780128] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[193.783873] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[193.784922] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[193.785809] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[193.785973] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[193.787055] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[193.787214] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[193.787620] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
KERNEL[193.787823] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [193.844297] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [193.865880] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[193.868834] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV  [193.872070] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV  [193.875308] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV  [193.875538] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [193.876085] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV  [193.879139] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [193.880193] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV  [193.882981] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [193.884659] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[204.230060] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[204.230190] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV  [204.236076] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[204.236257] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[204.236372] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[204.236470] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[204.236571] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[204.236673] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[204.236765] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV  [204.244605] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[204.244779] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[204.244921] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [204.246839] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [204.249063] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV  [204.254281] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV  [204.258303] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV  [204.260897] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV  [204.263278] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [204.266164] unbind   /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [204.280818] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[204.995203] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[204.996951] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[204.997875] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[204.997951] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[204.998024] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[204.998719] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[204.998805] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[204.999553] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
KERNEL[205.000472] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [205.046868] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV  [205.064887] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV  [205.065546] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV  [205.071809] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [205.072453] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV  [205.074606] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV  [205.075918] add      /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV  [205.077887] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV  [205.079272] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[205.081514] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV  [205.084069] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

Here is a different output from a different device, still requires the "allow" button to be touched on the phone thus the bind, unbind, bind...
looks like device always is /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb) for any usb device. Ill check a different USB port on the laptop and see if ti gives same output.

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[744.726501] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[744.728544] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[744.728696] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [744.791261] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [744.807373] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [744.812310] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[744.820721] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [744.822274] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[752.498084] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[752.498250] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[752.501438] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[752.501621] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [752.505505] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [752.510720] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [752.518976] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [752.530866] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[753.168845] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[753.170230] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[753.170270] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [753.192529] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[753.214290] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [753.214959] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [753.215750] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [753.219032] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)


Here is a different USB port on the laptop. it has a "3" in it. looks like the usb ports are numbered...

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[998.785369] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[998.791254] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[998.791442] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [998.843523] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [998.861403] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [998.863702] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[998.870214] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [998.871968] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[1009.056378] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[1009.056426] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[1009.056899] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[1009.056950] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [1009.058454] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [1009.059523] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [1009.060681] unbind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [1009.066133] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[1009.732766] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[1009.735017] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
KERNEL[1009.735071] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [1009.767025] add /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
UDEV [1009.783954] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [1009.786923] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3 (usb)
KERNEL[1009.790840] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
UDEV [1009.792369] bind /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0 (usb)
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I am not a scripter. I'm wondering if we might have an environment issue here. I'll try to look that up.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

it says the scripts don't work on that post, and it also looks like we need to put more than just "usb" in the udev rule... but that is just a guess...

I wonder why Mate doesn't have a full set of sounds like Cinnamon. Its funny, many sounds play like pop-out menu, power cord connect/disconnect etc.. but many also dont play like device connection, and minimize/maximize window, etc... there is a GUI in Cinnamon for selecting sounds for each different event, I would use Cinnamon but it doesnt work with Compiz which is a must have for me. After you get used to using it its freaking awesome especially for touch screen computers and media center computers.

Thanks again for your time on a Friday night.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I found this in a thread about crontab, and think we should try it here (thanks ajgringo619):

In the terminal enter xed admin:///usr/local/bin/99-deviceconnected.sh and edit the file to look like this:

Code: Select all

#!/bin/bash
XAUTHORITY="/home/tom/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1000"
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
canberra-gtk-play -i device-added
Make sure to replace tom with your username.
Save the file, reboot and plug away.
zaileion
Level 4
Level 4
Posts: 297
Joined: Sun Jan 25, 2015 6:01 pm

Re: Linux MInt 19.x Mate Sounds

Post by zaileion »

still no go.

here is the script

Code: Select all

#!/bin/bash
XAUTHORITY="/home/zaileion/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1000"
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
canberra-gtk-play -i device-added
when i double click the script it it plays the sound as expected. it just seems to somehow not to be kicking off when a device is connected.

You don't need to spend all night working on this... I appreciate your time, knowledge and energy very much!
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I don't think any more is needed for the udev rule. We're checking for an add and usb, as your udevadm is showing. The other stuff in the link is to narrow down the device being connected, which is not anything we need.

I'll let you know if something else comes to mind.

EDIT: Scroll to my newest post before trying other changes.
Last edited by MrEen on Fri Nov 01, 2019 10:11 pm, edited 1 time in total.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I think rene's suggestion here might be what we need.

Change the script again to this:

Code: Select all

#!/bin/bash
sudo -u zaileion canberra-gtk-play -i device-added
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I found another example of using a udev rule that has this content:

Code: Select all

# cat /etc/udev/rules.d/5-usbstick-font.rules
ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="90c/1000/1100", RUN=="/bin/su godiego --command='/home/godiego/run-start.sh'"
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="90c/1000/1100", RUN+="/bin/su godiego --command='/home/godiego/run-stop.sh'"
Notice the first use of RUN uses RUN== instead of RUN+=. You could also try that in yours and see if it helps.

I didn't mean to be spending this much effort on this, but am intrigued myself and can't drop it. :wink:
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Linux MInt 19.x Mate Sounds

Post by MrEen »

I'm also seeing some posts saying SUBSYSTEMS=="usb" with an S on the end.

This is very likely the reason is wasn't firing before. Try making this change first.
Locked

Return to “Beginner Questions”