Is there a good handler for the #python `logging.handlers` stuff that sends messages via #libnotify? I tend to write CLI tools with a boilerplate I hacked out ages ago, that has some argparse defaults and then does this (somewhat compressed for brevity):

```python
if __name__ == "__main__":
import sys, logging, logging.handlers

args = parse_args()
mylogger = logging.getLogger(sys.argv[0])

if args.syslog or not sys.stdout.isatty():
handler = logging.handlers.SysLogHandler(address="/dev/log", facility=logging.handlers.SysLogHandler.LOG_DAEMON)
handler.setFormatter(logging.Formatter("%(name)s: %(levelname)s %(message)s"))
mylogger.addHandler(handler)
mylogger.setLevel(logging.WARNING - (args.verbose * 10))
else: # use the basic config when on terminal
logging.basicConfig(level=max(logging.WARNING - (args.verbose * 10), 0))

main_loop(args, mylogger)
```

So if it's run from cron, it'll go to syslog by default, but you can also just pass in like `--syslog` and it'll do that from the shell as well. I figure I kind of want `notify-send` messages sometimes too. Maybe always, maybe only for `CRITICAL` and above? #logging

I think it'd be cool to have a background service or something to make my linux phone vibrate for specific notifications from apps that dont do their own vibration.

Does anyone know how to (either via Bash or Python) watch for new notifications from libnotify? Cuz then I could do a little script or gtk app.

#AskFedi #Linux #LinuxMobile #MobileLinux #postmarketOS #LibFeedback #FeedbackD #LibNotify #Notifications #Bash #Python

With libnotify you can send notifications from your console (so basically from anywhere). But what wasn’t obvious to me was how to make them behave like other “real” notifications, i.e. appear in the KDE notification widget. Answer is, you need to add parameter -h "string:desktop-entry:org.kde.konsole". For example, you can create a notification with text “It’s done!”, title “Backup”, icon for warning and normal urgency like this:

notify-send "It's done" -a Backup -i dialog-warning -u normal -h "string:desktop-entry:org.kde.konsole"

https://gitlab.gnome.org/GNOME/libnotify

#KDE #notifications #libnotify

GNOME / libnotify · GitLab

Welcome to GNOME GitLab

GitLab

He instalado #dunst + #libnotify-bin pero no muestra ninguna notificacion.

Ni cuando inserto un USB, descargo una imagen desde Firefox... Algo hago mal seguro

Notifications are coming to #phosh's lockscreen. Also in progress is different haptic/led feedback depending on the set notification category. The #phosh/#feedbackd side is mostly there and it works with #libnotify but needs changes in #glib to work with #GApplication too.

#phosh #librem5 #purism #gnomeonmobile #gnome #linux

Activer les notifications #libnotify de tâches shell longues avec #ZSH / Oh-my-ZSH :
https://www.grimoire-command.es/2018/bgnotify.html
Desktop notification of long running commands via zsh

Activer les notifications libnotify de tâches shell longues This tip requires a working oh-my-zsh plugin management. $ vi ~/.zshrc (1) plugins=( … bgnotify … ) (2) 1 Edit your .zshrc file 2 Add the bgnotify plugin to your list of plugins loaded at startup Open a new console, and launch a long command. $ yes …