Package: hdn
HDNHDN is CLI tool for sending notification messages toD-Buson a Linux desktop. It was originally built so I could use Home Assistant to send alerts to my desktop when certain events in my house change and it was namedhass-dbus-notify. Since it can be used without Home Assistant it was renamed HDN. As a command line tool you can automate sending messages to D-Bus for almost anything.Under the hood it usesJeepenywhich is a pure Python 3 implementation of the D-Bus protocol. It does all of the heavy lifting for HDN. Since HDN only requires Python 3, you do not need to install any system packages to interface with D-Bus. :tada:InstallpipinstallhdnUsageSendThe first command of HDN issend. It can be used via the CLI to send messages to D-Bus. It also can read environment variables for it's configuration. This is the more fully featured command since it fully usesTyper'sfeatures to ensure the data for each option is correct.Required options--summary            TEXT     Summary of the notification. [env var: HDN_SUMMARY] [required]--body               TEXT     Body of the notification. [env var: HDN_BODY] [required]Optional options--urgency            TEXT     Urgency: low, normal, critical [env var: HDN_URGENCY] [default: normal]--object-path        TEXT     Object path [env var: HDN_OBJECT_PATH] [default: /org/freedesktop/Notifications]--bus-name           TEXT     Bus name [env var: HDN_BUS_NAME] [default: org.freedesktop.Notifications]--interface          TEXT     Interface [env var: HDN_INTERFACE] [default: org.freedesktop.Notifications]--message-bus        TEXT     Message bus: session, system [env var: HDN_MESSAGE_BUS] [default: session]--icon               TEXT     Message icon [env var: HDN_ICON] [default: dialog-warning]--expire             INTEGER  Message expiration (seconds) [env var: HDN_EXPIRE] [default: 3]--help                        Show the message and exit.JSONThe second command of HDN isjson. It can be used to read a JSON data from a file or stdin. It lightly uses Typer for the command but any options that are fed in via JSON are lightly sanity checked before being processed by HDN and sent to D-Bus. Expect weird things to happen if you send unexpected data in your values. At a minimum the required keys in your JSON need to be:{"summary":"Minimal example summary","body":"Minimal example body"}Here is a full example of a JSON payload that can be processed by HDN:{"summary":"Full example summary","body":"Full example body","urgency":"critical","object_path":"/org/freedesktop/Notifications","bus_name":"org.freedesktop.Notifications","interface":"org.freedesktop.Notifications","message_bus":"session","icon":"dialog-warning","expire":20}See theexamplesdirectory for more samples of JSON that are used in testing.Debugging D-BusIf you want to see what is going on with your messages you can usedbus-monitorto watch the bus in real time.dbus-monitorinterface=org.freedesktop.NotificationsReferenceD-Bus Basic DesignD-Bus Protocolfreedesktop.org Icon NamesLicenseMIT LicenseCopyright (c) 2023 Joe DossPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.