Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
Last active February 6, 2024 10:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lduboeuf/6c4b1177d0984297ed6818c2521f78b8 to your computer and use it in GitHub Desktop.
Save lduboeuf/6c4b1177d0984297ed6818c2521f78b8 to your computer and use it in GitHub Desktop.
Test UT push notif
monitor Notifs:
dbus-monitor interface=org.freedesktop.Notifications
gdbus call --session --dest com.ubuntu.Postal --object-path /com/ubuntu/Postal/dekko2_2edekkoproject --method com.ubuntu.Postal.Post dekko2.dekkoproject_dekko \
'"{\"message\": \"foobar\", \"notification\":{\"card\": {\"summary\": \"yes\", \"body\": \"hello\", \"popup\": true, \"persist\": true}}}"'
Avec son:
gdbus call --session --dest com.ubuntu.Postal --object-path /com/ubuntu/Postal/dekko2_2edekkoproject --method com.ubuntu.Postal.Post dekko2.dekkoproject_dekko \
'"{\"message\": \"foobar\", \"notification\":{\"sound\": \"test.ogg\",\"card\": {\"summary\": \"yes\", \"body\": \"hello\", \"popup\": true, \"persist\": true}}}"'
DEBUG push client:
/etc/xdg/ubuntu-push-client/config.json -> log level = debug
kill the process, it is auto relaunched
Notif simple:
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 1 "back" "hi mom3" "blah blah blah" "[]" '{}' 5000
persistent notif:
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 3 "security-alert" "hi mom3" "blah blah blah" "[]" '{"urgency": <2>}' 5000
notif avec secondary icon
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 1 "message" "hi mom3" "blah blah blah" "[]" '{"x-lomiri-secondary-icon": <string "incoming-call">}' 5000
@lduboeuf
Copy link
Author

gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 1 "file:///opt/click.ubuntu.com/dekko2.dekkoproject/current/dekko.png" "hi mom3" "blah blah blah" "[]" '{"x-lomiri-secondary-icon": <string "file:///opt/click.ubuntu.com/teleports.ubports/current/assets/icon.svg">}' 5000

@lduboeuf
Copy link
Author

notif with buttons:

gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 0 "security-alert" "hi critical3" "blah blah blah" "['ok', 'OK', 'cancel', 'Annuler']" '{"x-lomiri-snap-decisions": <string "true">, "x-lomiri-snap-decisions-timeout": <2147483647>}' 0

@lduboeuf
Copy link
Author

lduboeuf commented Feb 6, 2024

with sound:

gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 1 "file:///opt/click.ubuntu.com/dekko2.dekkoproject/current/dekko.png" "hi mom3" "blah blah blah" "[]" '{"x-lomiri-secondary-icon": <string "file:///opt/click.ubuntu.com/teleports.ubports/current/assets/icon.svg">, "sound-file": <string "file:///usr/share/sounds/ubports/notifications/Sintonia.ogg">}' 5000

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