Skip to content

Instantly share code, notes, and snippets.

@ageldama
Created January 6, 2020 13:34
Show Gist options
  • Save ageldama/d01c67208249c1f6980e894125042973 to your computer and use it in GitHub Desktop.
Save ageldama/d01c67208249c1f6980e894125042973 to your computer and use it in GitHub Desktop.
DBus, org.freedesktop.Notifications, dbus-send fun
dbus-send --session \
--dest=org.freedesktop.Notifications \
--type=method_call --print-reply \
/org/freedesktop/Notifications \
org.freedesktop.DBus.Introspectable.Introspect
dbus-send --session \
--dest=org.freedesktop.Notifications \
--type=method_call --print-reply \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.Notify \
string:'Myself' uint32:0 \
string: string:'Title' \
string:'Body' \
array:string: dict:string:string: int32:10000
https://dbus.freedesktop.org/doc/dbus-send.1.html
https://www.freedesktop.org/wiki/Software/dbus/
# Desktop Notifications Specification
http://www.galago-project.org/specs/notification/0.9/x408.html
@zlietapki
Copy link

notifications-send.sh not work
Error org.freedesktop.DBus.Error.InvalidArgs: Type of message, “(susssasa{ss}i)”, does not match expected type “(susssasa{sv}i)”
It is impossible to send notifications via dbus-send. Use dbus

gdbus call --session \
  --dest=org.freedesktop.Notifications \
  --object-path=/org/freedesktop/Notifications \
  --method=org.freedesktop.Notifications.Notify \
  "" \
  0 \
  "icon name" \
  "summary" \
  "body message" \
  '[]' \
  '{"urgency": <1>}' \
  5000

or notify-send

notify-send "summary" "message"

or dunstify

dunstify "summary" "body"

@ageldama
Copy link
Author

ageldama commented Jun 5, 2023

@zlietapki wow, thanks, but: https://github.com/ageldama/configs/blob/master/xscreensaver-toggle.pl#L19

I'm using notify-send or something else too, just like you told me, thanks.

it was my scratch script, sorry if it gave some trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment