notify 532 B

12345678910111213141516171819
  1. notify() {
  2. app="$1"
  3. icon="$2"
  4. summary="$3"
  5. text="$4"
  6. popup_summary="$5"
  7. popup_text="$6"
  8. [ "$icon" = "" ] && icon="icon-lock-information"
  9. [ "$app" = "" ] && app="${0##*/}"
  10. [ "$app" != "${app#-}" ] && app="\\$app" # esacpe leading dash
  11. # Why 42?
  12. gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify\
  13. "$app" 42 "$icon" "$summary" "$text" "[]" "{'x-nemo-preview-summary':<'$popup_summary'>, 'x-nemo-preview-body':<'$popup_text'>}" 0
  14. }