How do I create notification like volume/brightness change for AC plug in/out

How can I produce notification like these for custom events, e.g: AC plug in or out?
image
image

p.s. I’m aware of this, but I wanna replicate the aforementioned look.

thank you

There are already notifications for these events, their sounds are already enabled, you just need to enable their visual popups:

well, I’m currently using that, but that shows a regular notification.

I don’t know if this will work on your laptop, but:

Then add the following command to “When entering this power state”

qdbus org.freedesktop.Notifications /org/kde/osdService org.kde.osdService.showText battery "AC Connected"

Screenshot_20240524_123531

Screenshot_20240524_123601

Then add the following command to “When exiting this power state”

qdbus org.freedesktop.Notifications /org/kde/osdService org.kde.osdService.showText battery "AC Disconnected"

Screenshot_20240524_123726

Finally click apply.

NB: You can change that “battery” icon to another one by picking name from icon selector

Screenshot_20240524_124204

1 Like

It worked like a charm!
thank you.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.