You are not logged in.

#1 2016-04-24 09:56:50

ghorvath
Member
Registered: 2015-10-01
Posts: 161

[SOLVED] Basic dbus notifications for keyboard backlight

Does anyone know how can I get the notification dbus popups? E.g. if I press my keyboard backlight up/down button, then I get a slider in the upper right corner moving up/down. I would like to get this slider notification via a script without pressing anything. Currently, I have a script that manages to change the keyboard backlight (downloaded from https://keramida.wordpress.com/2013/03/ … -from-cli/ ), but it uses notify-send which looks completely different than the notification that came out of the box.

Similar notifications happen if I change the LCD screen or change the volume by buttons, or if network connects, then I also get a nice-looking notification.

If anyone could help me where to look, what files should I search for, I would greatly appreciate it.

Thanks.

Last edited by ghorvath (2016-04-24 14:15:51)

Offline

#2 2016-04-24 10:29:32

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] Basic dbus notifications for keyboard backlight

I'm definitely no dbus expert, but have you tried using libnotify as a tool for this?

debian-libnotify


the libnotify suite implements the gnome desktop notifications. Apparently though in order to use libnotify you'll need a notification server. You have a few to pick from as it seems:
Notification Servers

Look at the above link, as there are ways to script your own dbus calls, in various languages, like java, C, or Python, of course requiring a lot more effort, but you can probably fine tune it specifically to your needs of the keyboard backlight etc...


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#3 2016-04-24 10:44:54

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,063
Website

Re: [SOLVED] Basic dbus notifications for keyboard backlight

ghorvath wrote:

I would like to get this slider notification via a script without pressing anything

BunsenLabs uses xfce4-notifyd as the server for the notification system.

http://goodies.xfce.org/projects/applic … e4-notifyd

Offline

#4 2016-04-24 10:45:44

ghorvath
Member
Registered: 2015-10-01
Posts: 161

Re: [SOLVED] Basic dbus notifications for keyboard backlight

@Horizon_Brave Thank you, I will look at these.

However, the system must have everything in place already, because I get the nice notifications when I push the buttons. I simply want to have the same notifications when using the script.

Anyway, I will look at the links, maybe they will shed some light on this.

Thanks.

Offline

#5 2016-04-24 13:32:29

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] Basic dbus notifications for keyboard backlight

Head_on_a_Stick wrote:
ghorvath wrote:

I would like to get this slider notification via a script without pressing anything

BunsenLabs uses xfce4-notifyd as the server for the notification system.

http://goodies.xfce.org/projects/applic … e4-notifyd

Ah, thanks HoaS, wasn't aware we came shipped with our own. My apologies! But atleast OP has a few other options just in case ;D


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#6 2016-04-24 14:15:05

ghorvath
Member
Registered: 2015-10-01
Posts: 161

Re: [SOLVED] Basic dbus notifications for keyboard backlight

In the end, I managed to find the icon, and write this small function to my script which works perfectly:

notify_of_backlight_change()
{
VALUE=$1
MAX=$( backlight_get_max )
notify-send -t 800                                                       \
-i /usr/share/icons/hicolor/scalable/status/xfpm-brightness-keyboard.svg \
-h int:value:$((100*VALUE/MAX))                                          \
"Keyboard brightness set to $VALUE"
}

The original script can be downloaded from https://keramida.wordpress.com/2013/03/ … -from-cli/ if anyone is interested.

Thank you very much for all the help.

Offline

#7 2016-04-24 19:20:33

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] Basic dbus notifications for keyboard backlight

So... just before I can put this to bed, and be able to rest at night...

Dbus = The specification for many different clients to write and send notifications to each other and the desktop.

xfce-notifiyd = is one particular implentation of the dbus server (what recieves and decides how/when/how long etc.. to display the message..

gdbus = Is a client side application used my client programs to interact with the xfce-notifyd daemon right?
The screen shot I took below shows a bunch of spawned gdbus child processes, so I"m assuming each one is making calls using the gdbus api?

gdbus.jpg

Do I have this right HoaS?


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

Board footer

Powered by FluxBB