You are not logged in.
Can i disable the notification (xfce4-notifyd) using the command line for a specific app? I only found the do-not-disturb function but this disables all notifications for all apps.
Last edited by Friedrich (2023-11-21 23:37:44)
Offline
Depending on the version of xfce4-notifyd, it uses the xfconf property "/applications/muted_applications":
xfconf-query -c xfce4-notifyd -p /applications/muted_applications
Unfortunately, it is an array.
If the the application you want muted is the only application you want muted, it is simple:
xfconf-query -c xfce4-notifyd -p /applications/muted_applications -s "APPLICATION_NAME" -a
...replace "APPLICATION_NAME" with the actual application name as identified by xfce4-notifyd in it's properties "applications" tab.
If there are multiple applications involved, xfconf-query doesn't include functionality to insert or delete from arrays (the above command will overwrite any existing array), so you'll need to program something to do that (ie. save existing array members and recreate with additional new array member).
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
There is an error
Property "/applications/muted_applications" does not exist on channel "xfce4-notifyd". If a new property should be created, use the --create option.
Other people had the same problem when they tried to toggle do not disturb. The problem was solved with this
xfconf-query --channel xfce4-notifyd --create --property /do-not-disturb --set true
but this doesn't work for me.
xfce4-notifyd version is 0.9.3
If there are multiple applications involved, xfconf-query doesn't include functionality to insert or delete from arrays (the above command will overwrite any existing array), so you'll need to program something to do that (ie. save existing array members and recreate with additional new array member).
How can i read and write the array?
Offline
There is an error
If the property doesn't exist, you can either go into xfce4-notifyd settings, to the Applications tab, and toggle one of the application's "mute" settings. This will force the property to be created. Or:
xfconf-query -c xfce4-notifyd -p /applications/muted_applications -t string -s "APPLICATION_NAME" -a --create
How can i read and write the array?
Consider the following with 2 muted applications:
$ xfconf-query -c xfce4-notifyd -p /applications/muted_applications
Value is an array with 2 items:
notify-send
org.freedesktop.network-manager-applet
To add "thunar" to this list, I would need to:
xfconf-query -c xfce4-notifyd -p /applications/muted_applications -t string -s "notify-send" -t string -s "org.freedesktop.network-manager-applet" -t string -s "org.xfce.thunar" -a
To then delete thunar from the list:
xfconf-query -c xfce4-notifyd -p /applications/muted_applications -t string -s "notify-send" -t string -s "org.freedesktop.network-manager-applet" -a
Notice how the array always needs to be recreated to preserve existing values.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
OK, thanks for the help.
Offline
[ Generated in 0.009 seconds, 8 queries executed - Memory usage: 565.73 KiB (Peak: 585.4 KiB) ]