Charger connect/disconnect sound effect

I want some sound feedback when my laptop gets connected/disconnected from charger.
How can I do that?

I am using xfce DE.

You can do this with a udev rule. Here is the relevant ArchWiki article: https://wiki.archlinux.org/title/udev. See also Writing udev rules, which has some examples you can get some inspiration from down near the bottom.

This thread is related to writing a udev rule for plugging/unplugging a laptop if you’d like to check that out: https://superuser.com/questions/1417292/udev-rule-to-start-a-command-on-ac-battery-plug-unplug-event. They have a different action they wanted to do, but it might be a good source for ideas.

1 Like